picard.sam

## Class ValidateSamFile

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

-     public class ValidateSamFile
      extends CommandLineProgram

  Command line program wrapping SamFileValidator.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ValidateSamFile.Mode`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `List<htsjdk.samtools.SAMValidationError.Type>` | `IGNORE`
    `boolean` | `IGNORE_WARNINGS`
    `htsjdk.samtools.BamIndexValidator.IndexValidationStringency` | `INDEX_VALIDATION_STRINGENCY`
    `File` | `INPUT`
    `boolean` | `IS_BISULFITE_SEQUENCED`
    `int` | `MAX_OPEN_TEMP_FILES`
    `Integer` | `MAX_OUTPUT`
    `ValidateSamFile.Mode` | `MODE`
    `File` | `OUTPUT`
    `boolean` | `VALIDATE_INDEX`

    - ### 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
    `ValidateSamFile()`

  - ### 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

    - #### INPUT

          @Option(shortName="I",
                  doc="Input SAM/BAM file")
          public File INPUT

    - #### OUTPUT

          @Option(shortName="O",
                  doc="Output file or standard out if missing",
                  optional=true)
          public File OUTPUT

    - #### MODE

          @Option(shortName="M",
                  doc="Mode of output")
          public ValidateSamFile.Mode MODE

    - #### IGNORE

          @Option(doc="List of validation error types to ignore.")
          public List<htsjdk.samtools.SAMValidationError.Type> IGNORE

    - #### MAX_OUTPUT

          @Option(shortName="MO",
                  doc="The maximum number of lines output in verbose mode")
          public Integer MAX_OUTPUT

    - #### IGNORE_WARNINGS

          @Option(doc="If true, only report errors and ignore warnings.")
          public boolean IGNORE_WARNINGS

    - #### VALIDATE_INDEX

          @Option(doc="DEPRECATED.  Use INDEX_VALIDATION_STRINGENCY instead.  If true and input is a BAM file with an index file, also validates the index.  Until this parameter is retired VALIDATE INDEX and INDEX_VALIDATION_STRINGENCY must agree on whether to validate the index.")
          public boolean VALIDATE_INDEX

    - #### INDEX_VALIDATION_STRINGENCY

          @Option(doc="If set to anything other than IndexValidationStringency.NONE and input is a BAM file with an index file, also validates the index at the specified stringency. Until VALIDATE_INDEX is retired, VALIDATE INDEX and INDEX_VALIDATION_STRINGENCY must agree on whether to validate the index.")
          public htsjdk.samtools.BamIndexValidator.IndexValidationStringency INDEX_VALIDATION_STRINGENCY

    - #### IS_BISULFITE_SEQUENCED

          @Option(shortName="BISULFITE",
                  doc="Whether the SAM or BAM file consists of bisulfite sequenced reads. If so, C->T is not counted as an error in computing the value of the NM tag.")
          public boolean IS_BISULFITE_SEQUENCED

    - #### MAX_OPEN_TEMP_FILES

          @Option(doc="Relevant for a coordinate-sorted file containing read pairs only. Maximum number of file handles to keep open when spilling mate info to disk. Set this number a little lower than the per-process maximum number of file that may be open. This number can be found by executing the \'ulimit -n\' command on a Unix system.")
          public int MAX_OPEN_TEMP_FILES

  - ### Constructor Detail

    - #### ValidateSamFile

          public ValidateSamFile()

  - ### 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.