picard.util

## Class IntervalListTools

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.util.IntervalListTools

-     public class IntervalListTools
      extends CommandLineProgram

  Little class to aid working with interval lists.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `IntervalListTools.Action`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IntervalListTools.Action` | `ACTION`
    `int` | `BREAK_BANDS_AT_MULTIPLES_OF`
    `List<String>` | `COMMENT`
    `boolean` | `INCLUDE_FILTERED`
    `List<File>` | `INPUT`
    `boolean` | `INVERT`
    `File` | `OUTPUT`
    `int` | `PADDING`
    `int` | `SCATTER_COUNT`
    `List<File>` | `SECOND_INPUT`
    `boolean` | `SORT`
    `IntervalListScatterer.Mode` | `SUBDIVISION_MODE`
    `boolean` | `UNIQUE`

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

  - ### 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 File` | `getScatteredFileName(File scatterDirectory, long scatterTotal, String formattedIndex)`
    `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="One or more interval lists. If multiple interval lists are provided the output is theresult of merging the inputs. Supported formats are interval_list and VCF.",
                  minElements=1)
          public List<File> INPUT

    - #### OUTPUT

          @Option(doc="The output interval list file to write (if SCATTER_COUNT is 1) or the directory into which to write the scattered interval sub-directories (if SCATTER_COUNT > 1)",
                  shortName="O",
                  optional=true)
          public File OUTPUT

    - #### PADDING

          @Option(doc="The amount to pad each end of the intervals by before other operations are undertaken. Negative numbers are allowed and indicate intervals should be shrunk. Resulting intervals < 0 bases long will be removed. Padding is applied to the interval lists <b> before </b> the ACTION is performed.",
                  optional=true)
          public int PADDING

    - #### UNIQUE

          @Option(doc="If true, merge overlapping and adjacent intervals to create a list of unique intervals. Implies SORT=true")
          public boolean UNIQUE

    - #### SORT

          @Option(doc="If true, sort the resulting interval list by coordinate.")
          public boolean SORT

    - #### ACTION

          @Option(doc="Action to take on inputs.")
          public IntervalListTools.Action ACTION

    - #### SECOND_INPUT

          @Option(shortName="SI",
                  doc="Second set of intervals for SUBTRACT and DIFFERENCE operations.",
                  optional=true)
          public List<File> SECOND_INPUT

    - #### COMMENT

          @Option(doc="One or more lines of comment to add to the header of the output file.",
                  optional=true)
          public List<String> COMMENT

    - #### SCATTER_COUNT

          @Option(doc="The number of files into which to scatter the resulting list by locus; in some situations, fewer intervals may be emitted.  Note - if > 1, the resultant scattered intervals will be sorted and uniqued.  The sort will be inverted if the INVERT flag is set.")
          public int SCATTER_COUNT

    - #### INCLUDE_FILTERED

          @Option(doc="Whether to include filtered variants in the vcf when generating an interval list from vcf",
                  optional=true)
          public boolean INCLUDE_FILTERED

    - #### BREAK_BANDS_AT_MULTIPLES_OF

          @Option(shortName="BRK",
                  doc="If set to a positive value will create a new interval list with the original intervals broken up at integer multiples of this value.  Set to 0 to NOT break up intervals",
                  optional=true)
          public int BREAK_BANDS_AT_MULTIPLES_OF

    - #### SUBDIVISION_MODE

          @Option(shortName="M",
                  doc="Do not subdivide ")
          public IntervalListScatterer.Mode SUBDIVISION_MODE

    - #### INVERT

          @Option(doc="Produce the inverse list",
                  optional=true)
          public boolean INVERT

  - ### Constructor Detail

    - #### IntervalListTools

          public IntervalListTools()

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

    - #### getScatteredFileName

          public static File getScatteredFileName(File scatterDirectory,
                                                  long scatterTotal,
                                                  String formattedIndex)