Package picard.sam
Class ViewSam
java.lang.Object
picard.cmdline.CommandLineProgram
picard.sam.ViewSam
Prints a SAM or BAM file to the screen.
Very simple command that just reads a SAM or BAM file and writes out the header and each record to standard out. When an (optional) intervals file is specified, only records overlapping those intervals will be output.
All reads, just the aligned reads, or just the unaligned reads can be printed out by setting AlignmentStatus accordingly. The SAM or BAM header can be printed out separately using HEADER_ONLY. Only the alignment records can be printed using RECORDS_ONLY. However, HEADER_ONLY and RECORDS_ONLY cannot both be specified at one time.
Inputs
- A SAM or BAM file to be viewed
- Optional arguments specifying which reads or records need to be viewed
Usage example:
java -jar picard.jar ViewSam \ I=input_reads.bam \ HEADER_ONLY=true
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
FieldsFields 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
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
-
USAGE
-
INPUT
-
ALIGNMENT_STATUS
@Argument(doc="Print out all reads, just the aligned reads or just the unaligned reads.") public ViewSam.AlignmentStatus ALIGNMENT_STATUS -
PF_STATUS
@Argument(doc="Print out all reads, just the PF reads or just the non-PF reads.") public ViewSam.PfStatus PF_STATUS -
HEADER_ONLY
@Argument(doc="Print the SAM header only.", optional=true) public boolean HEADER_ONLY -
RECORDS_ONLY
@Argument(doc="Print the alignment records only.", optional=true) public boolean RECORDS_ONLY -
INTERVAL_LIST
@Argument(doc="An intervals file used to restrict what records are output.", optional=true) public File INTERVAL_LIST
-
-
Constructor Details
-
ViewSam
public ViewSam()
-
-
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.
-