public final class VariantContextAnnotator extends Object
VariantAnnotations
objects from VariantContext
s.Modifier and Type | Class and Description |
---|---|
static class |
VariantContextAnnotator.Options
Options class for
VariantContextAnnotator |
Constructor and Description |
---|
VariantContextAnnotator(ReferenceDictionary refDict,
com.google.common.collect.ImmutableMap<Integer,Chromosome> chromosomeMap)
Construct annotator with default options.
|
VariantContextAnnotator(ReferenceDictionary refDict,
com.google.common.collect.ImmutableMap<Integer,Chromosome> chromosomeMap,
VariantContextAnnotator.Options options)
Construct Annotator.
|
Modifier and Type | Method and Description |
---|---|
htsjdk.variant.variantcontext.VariantContext |
applyAnnotations(htsjdk.variant.variantcontext.VariantContext vc,
List<VariantAnnotations> annos)
Write annotations from
annos to vc |
com.google.common.collect.ImmutableList<VariantAnnotations> |
buildAnnotations(htsjdk.variant.variantcontext.VariantContext vc)
Given a
VariantContext , generate one VariantAnnotations for each alternative allele. |
VariantAnnotations |
buildErrorAnnotations(GenomeVariant change) |
GenomeVariant |
buildGenomeVariant(htsjdk.variant.variantcontext.VariantContext vc,
int alleleID)
Build a
GenomeVariant from a VariantContext object. |
VariantAnnotator |
getAnnotator() |
com.google.common.collect.ImmutableMap<Integer,Chromosome> |
getChromosomeMap() |
VariantContextAnnotator.Options |
getOptions() |
ReferenceDictionary |
getRefDict() |
void |
putErrorAnnotation(htsjdk.variant.variantcontext.VariantContext vc,
Set<AnnotationMessage> messages)
Put error annotation messages to a
VariantContext into the ANN field in the INFO column. |
public VariantContextAnnotator(ReferenceDictionary refDict, com.google.common.collect.ImmutableMap<Integer,Chromosome> chromosomeMap)
refDict
- ReferencedictionarychromosomeMap
- the chomosomal mappublic VariantContextAnnotator(ReferenceDictionary refDict, com.google.common.collect.ImmutableMap<Integer,Chromosome> chromosomeMap, VariantContextAnnotator.Options options)
refDict
- ReferenceDictionary
to use, probably from JannovarData
chromosomeMap
- Chromosome
map to use, probably from JannovarData
options
- configuration of the Annotator, for applyAnnotations(htsjdk.variant.variantcontext.VariantContext, java.util.List<de.charite.compbio.jannovar.annotation.VariantAnnotations>)
public ReferenceDictionary getRefDict()
public com.google.common.collect.ImmutableMap<Integer,Chromosome> getChromosomeMap()
public VariantContextAnnotator.Options getOptions()
public VariantAnnotator getAnnotator()
public GenomeVariant buildGenomeVariant(htsjdk.variant.variantcontext.VariantContext vc, int alleleID) throws InvalidCoordinatesException
GenomeVariant
from a VariantContext
object.
In the case of exceptions, you can use buildErrorAnnotations(de.charite.compbio.jannovar.reference.GenomeVariant)
to build an VariantAnnotations
with
an error message.vc
- VariantContext
describing the variantalleleID
- numeric identifier of the alleleGenomeVariant
corresponding to vc
, guaranteed to be on Strand.FWD
.InvalidCoordinatesException
- in the case that the reference in vc
is not known in refDict
.public void putErrorAnnotation(htsjdk.variant.variantcontext.VariantContext vc, Set<AnnotationMessage> messages)
VariantContext
into the ANN field in the INFO column.
Previous values are overwritten.vc
- VariantContext
to add the error message tomessages
- set of messages to write into the VariantContext
public com.google.common.collect.ImmutableList<VariantAnnotations> buildAnnotations(htsjdk.variant.variantcontext.VariantContext vc) throws InvalidCoordinatesException
VariantContext
, generate one VariantAnnotations
for each alternative allele.
Note that in the case of an exception being thrown, you have to add an error annotation yourself to the
VariantContext
yourself, e.g. by using putErrorAnnotation(htsjdk.variant.variantcontext.VariantContext, java.util.Set<de.charite.compbio.jannovar.annotation.AnnotationMessage>)
.vc
- the VCF record to annotate, remains unchangedImmutableList
of VariantAnnotations
s, one for each alternative allele, in the order of
the alternative alleles in vc
InvalidCoordinatesException
- in the case of problems with resolving coordinates internally, namely building the
GenomeVariant
object one one of the returned VariantAnnotations
s.public htsjdk.variant.variantcontext.VariantContext applyAnnotations(htsjdk.variant.variantcontext.VariantContext vc, List<VariantAnnotations> annos)
annos
to vc
vc
- VariantContext
to write the annotations to (to INFO column)annos
- annotations to apply (one for each alternative allele in vc
)vc
public VariantAnnotations buildErrorAnnotations(GenomeVariant change)
change
- GenomeVariant
to build error annotation forAnnotationMessage.ERROR_PROBLEM_DURING_ANNOTATION
.Copyright © 2016. All rights reserved.