Package picard.sam
Class SplitSamByNumberOfReads
java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.SplitSamByNumberOfReads
Splits the input queryname sorted or query-grouped SAM/BAM/CRAM file and writes it into
multiple BAM files, each with an approximately equal number of reads. This will retain the sort order
within each output BAM and if the BAMs are concatenated in order (output files are named
numerically) the order of the reads will match the original BAM. It will traverse the bam twice unless
TOTAL_READS_IN_INPUT is provided.
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
int
long
Fields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, SYNTAX_TRANSITION_URL, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class picard.cmdline.CommandLineProgram
checkRInstallation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
Field Details
-
INPUT
-
SPLIT_TO_N_READS
@Argument(shortName="N_READS", doc="Split to have approximately N reads per output file. The actual number of reads per output file will vary by no more than the number of output files * (the maximum number of reads with the same queryname - 1).", mutex="SPLIT_TO_N_FILES") public int SPLIT_TO_N_READS -
SPLIT_TO_N_FILES
@Argument(shortName="N_FILES", doc="Split to N files.", mutex="SPLIT_TO_N_READS") public int SPLIT_TO_N_FILES -
TOTAL_READS_IN_INPUT
@Argument(shortName="TOTAL_READS", doc="Total number of reads in the input file. If this is not provided, the input will be read twice, the first time to get a count of the total reads.", optional=true) public long TOTAL_READS_IN_INPUT -
OUTPUT
@Argument(shortName="O", doc="Directory in which to output the split BAM files.") public File OUTPUT -
OUT_PREFIX
@Argument(shortName="OUT_PREFIX", doc="Output files will be named <OUT_PREFIX>_N.EXT, where N enumerates the output file and EXT is the same as that of the input.") public String OUT_PREFIX
-
-
Constructor Details
-
SplitSamByNumberOfReads
public SplitSamByNumberOfReads()
-
-
Method Details
-
doWork
protected int doWork()Description copied from class:CommandLineProgram
Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.- Specified by:
doWork
in classCommandLineProgram
- Returns:
- program exit status.
-
customCommandLineValidation
Description copied from class:CommandLineProgram
Put any custom command-line validation in an override of this method. clp is initialized at this point and can be used to print usage and access argv. Any options set by command-line parser can be validated.- Overrides:
customCommandLineValidation
in classCommandLineProgram
- Returns:
- null if command line is valid. If command line is invalid, returns an array of error message to be written to the appropriate place.
-