@DocumentedFeature public class ViewSam extends CommandLineProgram
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.
java -jar picard.jar ViewSam \
I=input_reads.bam \
HEADER_ONLY=true
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ViewSam.AlignmentStatus |
|
static class |
ViewSam.PfStatus |
| Modifier and Type | Field | Description |
|---|---|---|
ViewSam.AlignmentStatus |
ALIGNMENT_STATUS |
|
boolean |
HEADER_ONLY |
|
String |
INPUT |
|
File |
INTERVAL_LIST |
|
ViewSam.PfStatus |
PF_STATUS |
|
boolean |
RECORDS_ONLY |
|
String |
USAGE |
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY| Constructor | Description |
|---|---|
ViewSam() |
| Modifier and Type | Method | Description |
|---|---|---|
protected String[] |
customCommandLineValidation() |
Put any custom command-line validation in an override of this method.
|
protected int |
doWork() |
Do the work after command line has been parsed.
|
static void |
main(String[] args) |
getCommandLine, getCommandLineParser, getDefaultHeaders, getFaqLink, getMetricsFile, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParserpublic final String USAGE
@Argument(shortName="I",
doc="The SAM or BAM file or GA4GH url to view.")
public String INPUT
@Argument(doc="Print out all reads, just the aligned reads or just the unaligned reads.") public ViewSam.AlignmentStatus ALIGNMENT_STATUS
@Argument(doc="Print out all reads, just the PF reads or just the non-PF reads.") public ViewSam.PfStatus PF_STATUS
@Argument(doc="Print the SAM header only.",
optional=true)
public boolean HEADER_ONLY
@Argument(doc="Print the alignment records only.",
optional=true)
public boolean RECORDS_ONLY
@Argument(doc="An intervals file used to restrict what records are output.",
optional=true)
public File INTERVAL_LIST
public static void main(String[] args)
protected int doWork()
CommandLineProgramdoWork in class CommandLineProgramprotected String[] customCommandLineValidation()
CommandLineProgramcustomCommandLineValidation in class CommandLineProgram