Package picard.vcf

## Class MergeVcfs

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.vcf.MergeVcfs

-     @DocumentedFeature
      public class MergeVcfs
      extends CommandLineProgram

  Combines multiple variant files into a single variant file.

  ### Inputs

  - One or more input file in VCF format (can be gzipped, i.e. ending in ".vcf.gz", or binary compressed, i.e. ending in ".bcf").
  - Optionally a sequence dictionary file (typically name ending in .dict) if the input VCF does not contain a complete contig list and if the output index is to be created (true by default).

  The input variant data must adhere to the following rules:

  - If there are samples, those must be the same across all input files.
  - Input file headers must be contain compatible declarations for common annotations (INFO, FORMAT fields) and filters.
  - Input files variant records must be sorted by their contig and position following the sequence dictionary provided or the header contig list.

  You can either directly specify the list of files by specifying `INPUT` multiple times, or provide a list in a file with name ending in ".list" to `INPUT`.

  ### Outputs

  A VCF sorted (i) according to the dictionary and (ii) by coordiante.

  ### Usage examples

  #### Example 1:

  We combine several variant files in different formats, where at least one of them contains the contig list in its header.

           java -jar picard.jar MergeVcfs \
                I=input_variants.01.vcf \
                I=input_variants.02.vcf.gz \
                O=output_variants.vcf.gz

  #### Example 2:

  Similar to example 1 but we use an input list file to specify the input files:

           java -jar picard.jar MergeVcfs \
                I=input_variant_files.list \
                O=output_variants.vcf.gz

  Since:
    1.0.1

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `List<String>` | `COMMENT` |
    `List<File>` | `INPUT` |
    `File` | `OUTPUT` |
    `File` | `SEQUENCE_DICTIONARY` |

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

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MergeVcfs()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected int` | `doWork()` | Do the work after command line has been parsed.

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

      `checkRInstallation, customCommandLineValidation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser`

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

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

- - ### Field Detail

    - #### INPUT

          @Argument(shortName="I",
                    doc="VCF or BCF input files (File format is determined by file extension), or a file having a \'.list\' suffix containing the path to the files, one per line.",
                    minElements=1)
          public List<File> INPUT

    - #### OUTPUT

          @Argument(shortName="O",
                    doc="The merged VCF or BCF file. File format is determined by file extension.")
          public File OUTPUT

    - #### SEQUENCE_DICTIONARY

          @Argument(shortName="D",
                    doc="The index sequence dictionary to use instead of the sequence dictionary in the input files",
                    optional=true)
          public File SEQUENCE_DICTIONARY

    - #### COMMENT

          @Argument(doc="Comment(s) to include in the merged output file\'s header.",
                    optional=true,
                    shortName="CO")
          public List<String> COMMENT

  - ### Constructor Detail

    - #### MergeVcfs

          public MergeVcfs()

  - ### Method Detail

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