@DocumentedFeature public class LiftoverVcf extends CommandLineProgram
CommandLineProgram.REFERENCE_SEQUENCE should be the
target reference build (that is, the "new" one). The tool is based on the UCSC LiftOver tool
and uses a UCSC chain file to guide its operation.
java -jar picard.jar LiftoverVcf \\
I=input.vcf \\
O=lifted_over.vcf \\
CHAIN=b37tohg38.chain \\
REJECT=rejected_variants.vcf \\
R=reference_sequence.fasta
REJECT file using the source
genome build coordinates. The reason for the rejection will be stated in the FILTER field, and more detail may be placed
in the INFO field.
SortingCollection which relies on CommandLineProgram.MAX_RECORDS_IN_RAM
to specify how many (vcf) records to hold in memory before "spilling" to disk. The default value is reasonable when sorting SAM files,
but not for VCFs as there is no good default due to the dependence on the number of samples and amount of information in the INFO and FORMAT
fields. Consider lowering to 100,000 or even less if you have many genotypes.| Modifier and Type | Field | Description |
|---|---|---|
boolean |
ALLOW_MISSING_FIELDS_IN_HEADER |
|
static String |
ATTEMPTED_LOCUS |
Attribute used to store the position of the failed variant on the target contig prior to finding out that alleles do not match.
|
File |
CHAIN |
|
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_INDEL_STRADDLES_TWO_INTERVALS |
Filter name to use when an indel cannot be lifted over since it straddles two intervals in a chain which means
that it is unclear what are the right alleles to be used.
|
static String |
FILTER_MISMATCHING_REF_ALLELE |
Filter name to use when a target is lifted over, but the reference allele doesn'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 |
|
boolean |
LOG_FAILED_INTERVALS |
|
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 |
REJECT |
|
Collection<String> |
TAGS_TO_DROP |
|
Collection<String> |
TAGS_TO_REVERSE |
|
boolean |
WARN_ON_MISSING_CONTIG |
|
boolean |
WRITE_ORIGINAL_POSITION |
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY| Constructor | Description |
|---|---|
LiftoverVcf() |
| Modifier and Type | Method | Description |
|---|---|---|
protected int |
doWork() |
Do the work after command line has been parsed.
|
protected ReferenceArgumentCollection |
makeReferenceArgumentCollection() |
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getFaqLink, getMetricsFile, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser@Argument(shortName="I",
doc="The input VCF/BCF file to be lifted over.")
public File INPUT
@Argument(shortName="O",
doc="The output location for the lifted over VCF/BCF.")
public File OUTPUT
@Argument(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
@Argument(doc="File to which to write rejected records.") public File REJECT
@Argument(shortName="WMC",
doc="Warn on missing contig.",
optional=true)
public boolean WARN_ON_MISSING_CONTIG
@Argument(shortName="LFI",
doc="If true, intervals failing due to match below LIFTOVER_MIN_MATCH will be logged as a warning to the console.",
optional=true)
public boolean LOG_FAILED_INTERVALS
@Argument(doc="Write the original contig/position for lifted variants to the INFO field.",
optional=true)
public boolean WRITE_ORIGINAL_POSITION
@Argument(doc="The minimum percent match required for a variant to be lifted.",
optional=true)
public double LIFTOVER_MIN_MATCH
@Argument(doc="Allow INFO and FORMAT in the records that are not found in the header",
optional=true)
public boolean ALLOW_MISSING_FIELDS_IN_HEADER
@Argument(doc="INFO field annotations that behave like an Allele Frequency and should be transformed with x->1-x when swapping reference with variant alleles.",
optional=true)
public Collection<String> TAGS_TO_REVERSE
@Argument(doc="INFO field annotations that should be deleted when swapping reference with variant alleles.",
optional=true)
public Collection<String> TAGS_TO_DROP
public static int EXIT_CODE_WHEN_CONTIG_NOT_IN_REFERENCE
public static final String FILTER_CANNOT_LIFTOVER_INDEL
public static final String FILTER_NO_TARGET
public static final String FILTER_MISMATCHING_REF_ALLELE
public static final String FILTER_INDEL_STRADDLES_TWO_INTERVALS
public static final String ORIGINAL_CONTIG
public static final String ORIGINAL_START
public static final String ATTEMPTED_LOCUS
protected ReferenceArgumentCollection makeReferenceArgumentCollection()
makeReferenceArgumentCollection in class CommandLineProgramprotected int doWork()
CommandLineProgramdoWork in class CommandLineProgram