Package picard.sam
Class SplitSamByLibrary
java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.SplitSamByLibrary
Command-line program to split a SAM/BAM/CRAM file into separate files based on
library name.
Output/h3>
This tool takes a SAM or BAM file and separates all the reads into one SAM or BAM file per library name. Reads that do not have a read group specified or whose read group does not have a library name are written to a file called 'unknown.' The format (SAM or BAM) of the output files matches that of the input file.
Inputs
- The BAM or SAM file to be split
- The directory where the library SAM or BAM files should be written
Output/h3>
- One SAM or BAM file per library name
Usage example:
java -jar picard.jar SplitSamByLibrary \ I=input_reads.bam \ O=/output/directory/
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Fields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, 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
Modifier and TypeMethodDescriptionprotected int
doWork()
Do the work after command line has been parsed.Methods inherited from class picard.cmdline.CommandLineProgram
checkRInstallation, customCommandLineValidation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
Field Details
-
INPUT
-
OUTPUT
@Argument(shortName="O", doc="The directory where the per-library output files should be written (defaults to the current directory). ", optional=true) public File OUTPUT -
NO_LIBRARIES_SPECIFIED_IN_HEADER
public static final int NO_LIBRARIES_SPECIFIED_IN_HEADER- See Also:
-
-
Constructor Details
-
SplitSamByLibrary
public SplitSamByLibrary()
-
-
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.
-