picard.sam

## Class ViewSam

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.sam.ViewSam

-     public class ViewSam
      extends CommandLineProgram

  Very simple command that just reads a SAM or BAM file and writes out the header and each records to standard out. When an (optional) intervals file is specified, only records overlapping those intervals will be output.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ViewSam.AlignmentStatus`
    `static class` | `ViewSam.PfStatus`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ViewSam.AlignmentStatus` | `ALIGNMENT_STATUS`
    `boolean` | `HEADER_ONLY`
    `String` | `INPUT`
    `File` | `INTERVAL_LIST`
    `ViewSam.PfStatus` | `PF_STATUS`
    `boolean` | `RECORDS_ONLY`
    `String` | `USAGE`

    - ### Fields inherited from class picard.cmdline.CommandLineProgram

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, TMP_DIR, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViewSam()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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)`

    - ### Methods inherited from class picard.cmdline.CommandLineProgram

      `getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getNestedOptions, getNestedOptionsForHelp, getStandardUsagePreamble, getVersion, instanceMain, instanceMainWithExit, parseArgs, setDefaultHeaders`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### USAGE

          public final String USAGE

    - #### INPUT

          @Option(shortName="I",
                  doc="The SAM or BAM file or GA4GH url to view.")
          public String INPUT

    - #### ALIGNMENT_STATUS

          @Option(doc="Print out all reads, just the aligned reads or just the unaligned reads.")
          public ViewSam.AlignmentStatus ALIGNMENT_STATUS

    - #### PF_STATUS

          @Option(doc="Print out all reads, just the PF reads or just the non-PF reads.")
          public ViewSam.PfStatus PF_STATUS

    - #### HEADER_ONLY

          @Option(doc="Print the SAM header only.",
                  optional=true)
          public boolean HEADER_ONLY

    - #### RECORDS_ONLY

          @Option(doc="Print the alignment records only.",
                  optional=true)
          public boolean RECORDS_ONLY

    - #### INTERVAL_LIST

          @Option(doc="An intervals file used to restrict what records are output.",
                  optional=true)
          public File INTERVAL_LIST

  - ### Constructor Detail

    - #### ViewSam

          public ViewSam()

  - ### Method Detail

    - #### main

          public static void main(String[] args)

    - #### 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 class `CommandLineProgram`
      Returns:
        program exit status.

    - #### customCommandLineValidation

          protected String[] 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 class `CommandLineProgram`
      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.