picard.sam

## Class DownsampleSam

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

-     public class DownsampleSam
      extends CommandLineProgram

  Class to randomly downsample a BAM file while respecting that we should either retain or discard all of the reads for a template - i.e. all reads with the same name, whether first or second of pair, secondary or supplementary, all travel together.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `double` | `ACCURACY`
    `File` | `INPUT`
    `File` | `OUTPUT`
    `double` | `PROBABILITY`
    `Integer` | `RANDOM_SEED`
    `htsjdk.samtools.DownsamplingIteratorFactory.Strategy` | `STRATEGY`

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `doWork()` Do the work after command line has been parsed.
    `static void` | `main(String[] args)`

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

      `customCommandLineValidation, 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="The input SAM or BAM file to downsample.")
          public File INPUT

    - #### OUTPUT

          @Option(shortName="O",
                  doc="The output, downsampled, SAM or BAM file to write.")
          public File OUTPUT

    - #### STRATEGY

          @Option(shortName="S",
                  doc="The downsampling strategy to use. See usage for discussion.")
          public htsjdk.samtools.DownsamplingIteratorFactory.Strategy STRATEGY

    - #### RANDOM_SEED

          @Option(shortName="R",
                  doc="Random seed to use if deterministic behavior is desired.  Setting to null will cause multiple invocations to produce different results.")
          public Integer RANDOM_SEED

    - #### PROBABILITY

          @Option(shortName="P",
                  doc="The probability of keeping any individual read, between 0 and 1.")
          public double PROBABILITY

    - #### ACCURACY

          @Option(shortName="A",
                  doc="The accuracy that the downsampler should try to achieve if the selected strategy supports it. Note that accuracy is never guaranteed, but some strategies will attempt to provide accuracy within the requested bounds.Higher accuracy will generally require more memory.")
          public double ACCURACY

  - ### Constructor Detail

    - #### DownsampleSam

          public DownsampleSam()

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