public class LiftoverUtils extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static Collection<String> |
DEFAULT_TAGS_TO_DROP |
|
static Collection<String> |
DEFAULT_TAGS_TO_REVERSE |
Default list of attributes that need to be reversed or dropped from the INFO field when alleles have been swapped.
|
static htsjdk.samtools.util.Log |
log |
|
static String |
REV_COMPED_ALLELES |
|
static String |
SWAPPED_ALLELES |
Attribute used to store the fact that the alt and ref alleles of the variant have been swapped, while all the INFO annotations have not.
|
| Constructor | Description |
|---|---|
LiftoverUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
protected static htsjdk.variant.variantcontext.GenotypesContext |
fixGenotypes(htsjdk.variant.variantcontext.GenotypesContext originals,
List<htsjdk.variant.variantcontext.Allele> originalAlleles,
List<htsjdk.variant.variantcontext.Allele> newAlleles) |
|
protected static void |
leftAlignVariant(htsjdk.variant.variantcontext.VariantContextBuilder builder,
int start,
int end,
List<htsjdk.variant.variantcontext.Allele> alleles,
htsjdk.samtools.reference.ReferenceSequence referenceSequence) |
Normalizes and left aligns a
VariantContextBuilder. |
protected static htsjdk.variant.variantcontext.VariantContextBuilder |
liftSimpleVariantContext(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target) |
|
static htsjdk.variant.variantcontext.VariantContext |
liftVariant(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target,
htsjdk.samtools.reference.ReferenceSequence refSeq,
boolean writeOriginalPosition) |
This will take an input VariantContext and lift to the provided interval.
|
protected static boolean |
referenceAlleleMatchesReferenceForIndel(List<htsjdk.variant.variantcontext.Allele> alleles,
htsjdk.samtools.reference.ReferenceSequence referenceSequence,
int start,
int end) |
Checks whether the reference allele in the provided variant context actually matches the reference sequence
|
protected static htsjdk.variant.variantcontext.VariantContextBuilder |
reverseComplementVariantContext(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target,
htsjdk.samtools.reference.ReferenceSequence refSeq) |
|
static htsjdk.variant.variantcontext.VariantContext |
swapRefAlt(htsjdk.variant.variantcontext.VariantContext vc,
Collection<String> annotationsToReverse,
Collection<String> annotationsToDrop) |
method to swap the reference and alt alleles of a bi-allelic, SNP
|
public static final String SWAPPED_ALLELES
public static final String REV_COMPED_ALLELES
public static final Collection<String> DEFAULT_TAGS_TO_REVERSE
public static final Collection<String> DEFAULT_TAGS_TO_DROP
public static final htsjdk.samtools.util.Log log
public static htsjdk.variant.variantcontext.VariantContext liftVariant(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target,
htsjdk.samtools.reference.ReferenceSequence refSeq,
boolean writeOriginalPosition)
source - The VariantContext to lifttarget - The target intervalrefSeq - The reference sequence, which should match the target intervalwriteOriginalPosition - If true, INFO field annotations will be added to store the original position and contigprotected static htsjdk.variant.variantcontext.VariantContextBuilder liftSimpleVariantContext(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target)
protected static htsjdk.variant.variantcontext.VariantContextBuilder reverseComplementVariantContext(htsjdk.variant.variantcontext.VariantContext source,
htsjdk.samtools.util.Interval target,
htsjdk.samtools.reference.ReferenceSequence refSeq)
protected static htsjdk.variant.variantcontext.GenotypesContext fixGenotypes(htsjdk.variant.variantcontext.GenotypesContext originals,
List<htsjdk.variant.variantcontext.Allele> originalAlleles,
List<htsjdk.variant.variantcontext.Allele> newAlleles)
public static htsjdk.variant.variantcontext.VariantContext swapRefAlt(htsjdk.variant.variantcontext.VariantContext vc,
Collection<String> annotationsToReverse,
Collection<String> annotationsToDrop)
vc - the VariantContext (bi-allelic SNP) that needs to have it's REF and ALT alleles swapped.annotationsToReverse - INFO field annotations (of double value) that will be reversed (x->1-x)annotationsToDrop - INFO field annotations that will be dropped from the result since they are invalid when REF and ALT are swappedVariantContext with alleles swapped, INFO fields modified and in the genotypes, GT, AD and PL corrected appropriatelyprotected static boolean referenceAlleleMatchesReferenceForIndel(List<htsjdk.variant.variantcontext.Allele> alleles, htsjdk.samtools.reference.ReferenceSequence referenceSequence, int start, int end)
alleles - list of alleles from which to find the reference allelereferenceSequence - the ref sequencestart - the start position of the actual indelend - the end position of the actual indelprotected static void leftAlignVariant(htsjdk.variant.variantcontext.VariantContextBuilder builder,
int start,
int end,
List<htsjdk.variant.variantcontext.Allele> alleles,
htsjdk.samtools.reference.ReferenceSequence referenceSequence)
VariantContextBuilder.
Note: this will modify the start/stop and alleles of this builder.
Also note: if the reference allele does not match the reference sequence, this method will throw an exception
Based on Adrian Tan, G. R. Abecasis and Hyun Min Kang. (2015)
Unified Representation of Genetic Variants. Bioinformatics.