@DocumentedFeature public class LiftoverVcf extends CommandLineProgram
Modifier and Type | Field and Description |
---|---|
boolean |
ALLOW_MISSING_FIELDS_IN_HEADER |
static java.lang.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.
|
java.io.File |
CHAIN |
protected static int |
EXIT_CODE_WHEN_CONTIG_NOT_IN_REFERENCE |
static java.lang.String |
FILTER_CANNOT_LIFTOVER_INDEL
Filter name to use when a target cannot be lifted over.
|
static java.lang.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 java.lang.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 java.lang.String |
FILTER_NO_TARGET
Filter name to use when a target cannot be lifted over.
|
java.io.File |
INPUT |
double |
LIFTOVER_MIN_MATCH |
static java.lang.String |
ORIGINAL_CONTIG
Attribute used to store the name of the source contig/chromosome prior to liftover.
|
static java.lang.String |
ORIGINAL_START
Attribute used to store the position of the variant on the source contig prior to liftover.
|
java.io.File |
OUTPUT |
java.io.File |
REJECT |
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 and Description |
---|
LiftoverVcf() |
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,
java.util.Map<htsjdk.variant.variantcontext.Allele,htsjdk.variant.variantcontext.Allele> alleleMap) |
protected static htsjdk.variant.variantcontext.VariantContext |
flipIndel(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.liftover.LiftOver liftOver,
htsjdk.samtools.reference.ReferenceSequence referenceSequence) |
protected static htsjdk.variant.variantcontext.VariantContext |
leftAlignVariant(htsjdk.variant.variantcontext.VariantContext vc,
htsjdk.samtools.reference.ReferenceSequence referenceSequence)
Normalizes and left aligns a
VariantContext . |
protected static htsjdk.variant.variantcontext.VariantContext |
liftSimpleVariant(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target)
liftsOver snps on either positive or negative strand and biallelic indels on positive strand only
|
static void |
main(java.lang.String[] args) |
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 java.io.File INPUT
@Argument(shortName="O", doc="The output location to write the lifted over VCF/BCF to.") public java.io.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 java.io.File CHAIN
@Argument(doc="File to which to write rejected records.") public java.io.File REJECT
@Argument(shortName="WMC", doc="Warn on missing contig.", optional=true) public boolean WARN_ON_MISSING_CONTIG
@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
protected static int EXIT_CODE_WHEN_CONTIG_NOT_IN_REFERENCE
public static final java.lang.String FILTER_CANNOT_LIFTOVER_INDEL
public static final java.lang.String FILTER_NO_TARGET
public static final java.lang.String FILTER_MISMATCHING_REF_ALLELE
public static final java.lang.String FILTER_INDEL_STRADDLES_TWO_INTERVALS
public static final java.lang.String ORIGINAL_CONTIG
public static final java.lang.String ORIGINAL_START
public static final java.lang.String ATTEMPTED_LOCUS
protected ReferenceArgumentCollection makeReferenceArgumentCollection()
makeReferenceArgumentCollection
in class CommandLineProgram
public static void main(java.lang.String[] args)
protected int doWork()
CommandLineProgram
doWork
in class CommandLineProgram
protected static htsjdk.variant.variantcontext.VariantContext liftSimpleVariant(htsjdk.variant.variantcontext.VariantContext source, htsjdk.samtools.util.Interval target)
source
- target
- protected static htsjdk.variant.variantcontext.VariantContext flipIndel(htsjdk.variant.variantcontext.VariantContext source, htsjdk.samtools.liftover.LiftOver liftOver, htsjdk.samtools.reference.ReferenceSequence referenceSequence)
source
- original variant contextliftOver
- the LiftOver object to use for flippingreferenceSequence
- the reference sequence of the targetprotected static htsjdk.variant.variantcontext.GenotypesContext fixGenotypes(htsjdk.variant.variantcontext.GenotypesContext originals, java.util.Map<htsjdk.variant.variantcontext.Allele,htsjdk.variant.variantcontext.Allele> alleleMap)
protected static htsjdk.variant.variantcontext.VariantContext leftAlignVariant(htsjdk.variant.variantcontext.VariantContext vc, htsjdk.samtools.reference.ReferenceSequence referenceSequence)
VariantContext
.
Based on Adrian Tan, Gonçalo R. Abecasis and Hyun Min Kang. (2015)
Unified Representation of Genetic Variants. Bioinformatics.vc
- the VariantContext
to be normalizedreferenceSequence
- the ReferenceSequence
of the same contig as vcVariantContext
which represents the same variation as vc but has
been normalized and left-aligned