picard.vcf

## Class LiftoverVcf

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

-     public class LiftoverVcf
      extends CommandLineProgram

  Tool for lifting over a VCF to another genome build and producing a properly header'd, sorted and indexed VCF in one go.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `ALLOW_MISSING_FIELDS_IN_HEADER`
    `File` | `CHAIN`
    `protected static int` | `EXIT_CODE_WHEN_CONTIG_NOT_IN_REFERENCE`
    `static String` | `FILTER_CANNOT_LIFTOVER_INDEL` Filter name to use when a target cannot be lifted over.
    `static String` | `FILTER_MISMATCHING_REF_ALLELE` Filter name to use when a target is lifted over, but the reference allele doens't match the new reference.
    `static String` | `FILTER_NO_TARGET` Filter name to use when a target cannot be lifted over.
    `File` | `INPUT`
    `double` | `LIFTOVER_MIN_MATCH`
    `static String` | `ORIGINAL_CONTIG` Attribute used to store the name of the source contig/chromosome prior to liftover.
    `static String` | `ORIGINAL_START` Attribute used to store the position of the variant on the source contig prior to liftover.
    `File` | `OUTPUT`
    `File` | `REFERENCE_SEQUENCE`
    `File` | `REJECT`
    `boolean` | `WARN_ON_MISSING_CONTIG`
    `boolean` | `WRITE_ORIGINAL_POSITION`

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LiftoverVcf()`

  - ### 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.
    `protected static htsjdk.variant.variantcontext.GenotypesContext` | `fixGenotypes(htsjdk.variant.variantcontext.GenotypesContext originals, Map<htsjdk.variant.variantcontext.Allele,htsjdk.variant.variantcontext.Allele> reverseComplementAlleleMap)`
    `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 VCF/BCF file to be lifted over.")
          public File INPUT

    - #### OUTPUT

          @Option(shortName="O",
                  doc="The output location to write the lifted over VCF/BCF to.")
          public File OUTPUT

    - #### CHAIN

          @Option(shortName="C",
                  doc="The liftover chain file. See https://genome.ucsc.edu/goldenPath/help/chain.html for a description of chain files.  See http://hgdownload.soe.ucsc.edu/downloads.html#terms for where to download chain files.")
          public File CHAIN

    - #### REJECT

          @Option(doc="File to which to write rejected records.")
          public File REJECT

    - #### REFERENCE_SEQUENCE

          @Option(shortName="R",
                  common=false,
                  doc="The reference sequence (fasta) for the TARGET genome build.  The fasta file must have an accompanying sequence dictionary (.dict file).")
          public File REFERENCE_SEQUENCE

    - #### WARN_ON_MISSING_CONTIG

          @Option(shortName="WMC",
                  doc="Warn on missing contig.",
                  optional=true)
          public boolean WARN_ON_MISSING_CONTIG

    - #### WRITE_ORIGINAL_POSITION

          @Option(doc="Write the original contig/position for lifted variants to the INFO field.",
                  optional=true)
          public boolean WRITE_ORIGINAL_POSITION

    - #### LIFTOVER_MIN_MATCH

          @Option(doc="The minimum percent match required for a variant to be lifted.",
                  optional=true)
          public double LIFTOVER_MIN_MATCH

    - #### ALLOW_MISSING_FIELDS_IN_HEADER

          @Option(doc="Allow INFO and FORMAT in the records that are not found in the header",
                  optional=true)
          public boolean ALLOW_MISSING_FIELDS_IN_HEADER

    - #### EXIT_CODE_WHEN_CONTIG_NOT_IN_REFERENCE

          protected static int EXIT_CODE_WHEN_CONTIG_NOT_IN_REFERENCE

    - #### FILTER_CANNOT_LIFTOVER_INDEL

          public static final String FILTER_CANNOT_LIFTOVER_INDEL

      Filter name to use when a target cannot be lifted over.
      See Also:
        Constant Field Values

    - #### FILTER_NO_TARGET

          public static final String FILTER_NO_TARGET

      Filter name to use when a target cannot be lifted over.
      See Also:
        Constant Field Values

    - #### FILTER_MISMATCHING_REF_ALLELE

          public static final String FILTER_MISMATCHING_REF_ALLELE

      Filter name to use when a target is lifted over, but the reference allele doens't match the new reference.
      See Also:
        Constant Field Values

    - #### ORIGINAL_CONTIG

          public static final String ORIGINAL_CONTIG

      Attribute used to store the name of the source contig/chromosome prior to liftover.
      See Also:
        Constant Field Values

    - #### ORIGINAL_START

          public static final String ORIGINAL_START

      Attribute used to store the position of the variant on the source contig prior to liftover.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LiftoverVcf

          public LiftoverVcf()

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

    - #### fixGenotypes

          protected static htsjdk.variant.variantcontext.GenotypesContext fixGenotypes(htsjdk.variant.variantcontext.GenotypesContext originals,
                                                                                       Map<htsjdk.variant.variantcontext.Allele,htsjdk.variant.variantcontext.Allele> reverseComplementAlleleMap)