Class VcfFuncotationFactory
java.lang.Object
org.broadinstitute.hellbender.tools.funcotator.DataSourceFuncotationFactory
org.broadinstitute.hellbender.tools.funcotator.dataSources.vcf.VcfFuncotationFactory
- All Implemented Interfaces:
Closeable
,AutoCloseable
A class to create annotations from VCF feature sources.
Created by jonn on 3/23/18.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.apache.logging.log4j.Logger
Standard Logger.Fields inherited from class org.broadinstitute.hellbender.tools.funcotator.DataSourceFuncotationFactory
annotationOverrideMap, dataSourceIsB37, DEFAULT_VERSION_STRING, mainSourceFileAsFeatureInput, minBasesForValidSegment, version
-
Constructor Summary
ConstructorDescriptionVcfFuncotationFactory
(String name, String version, Path sourceFilePath, LinkedHashMap<String, String> annotationOverridesMap, FeatureInput<? extends htsjdk.tribble.Feature> mainSourceFileAsFeatureInput) Create aVcfFuncotationFactory
.VcfFuncotationFactory
(String name, String version, Path sourceFilePath, LinkedHashMap<String, String> annotationOverridesMap, FeatureInput<? extends htsjdk.tribble.Feature> mainSourceFileAsFeatureInput, boolean isDataSourceB37) Create aVcfFuncotationFactory
.VcfFuncotationFactory
(String name, String version, Path sourceFilePath, LinkedHashMap<String, String> annotationOverridesMap, FeatureInput<? extends htsjdk.tribble.Feature> mainSourceFileAsFeatureInput, boolean isDataSourceB37, int minBasesForValidSegment) Create aVcfFuncotationFactory
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Perform cleanup tasks for thisDataSourceFuncotationFactory
.protected List<Funcotation>
createDefaultFuncotationsOnVariant
(htsjdk.variant.variantcontext.VariantContext variant, ReferenceContext referenceContext) protected List<Funcotation>
createFuncotationsOnVariant
(htsjdk.variant.variantcontext.VariantContext variant, ReferenceContext referenceContext, List<htsjdk.tribble.Feature> featureList) protected List<Funcotation>
createFuncotationsOnVariant
(htsjdk.variant.variantcontext.VariantContext variant, ReferenceContext referenceContext, List<htsjdk.tribble.Feature> featureList, List<GencodeFuncotation> gencodeFuncotations) Creates aList
ofFuncotation
for the givenvariant
,referenceContext
,featureContext
, andgencodeFuncotations
.Class<? extends htsjdk.tribble.Feature>
getName()
getType()
Methods inherited from class org.broadinstitute.hellbender.tools.funcotator.DataSourceFuncotationFactory
createFuncotations, createFuncotations, createFuncotationsOnSegment, getInfoString, getMainSourceFileAsFeatureInput, getSupportedFuncotationFieldsForSegments, getVersion, initializeAnnotationOverrides, isSupportingSegmentFuncotation, requiresFeatures, setOverrideValuesInFuncotations, transformFeatureQueryInterval
-
Field Details
-
logger
protected static final org.apache.logging.log4j.Logger loggerStandard Logger.
-
-
Constructor Details
-
VcfFuncotationFactory
public VcfFuncotationFactory(String name, String version, Path sourceFilePath, LinkedHashMap<String, String> annotationOverridesMap, FeatureInput<? extends htsjdk.tribble.Feature> mainSourceFileAsFeatureInput) Create aVcfFuncotationFactory
.- Parameters:
name
- AString
containing the name of thisVcfFuncotationFactory
.version
- The versionString
of the backing data source from whichFuncotation
s will be made.sourceFilePath
-Path
to the VCF file from whichVariantContext
s will be read in and used as Features from which to createFuncotation
s.annotationOverridesMap
- ALinkedHashMap<String,
containing user-specified overrides for specificString> Funcotation
s.mainSourceFileAsFeatureInput
- The backingFeatureInput
for thisVcfFuncotationFactory
, from which allFuncotation
s will be created.
-
VcfFuncotationFactory
public VcfFuncotationFactory(String name, String version, Path sourceFilePath, LinkedHashMap<String, String> annotationOverridesMap, FeatureInput<? extends htsjdk.tribble.Feature> mainSourceFileAsFeatureInput, boolean isDataSourceB37) Create aVcfFuncotationFactory
.- Parameters:
name
- AString
containing the name of thisVcfFuncotationFactory
.version
- The versionString
of the backing data source from whichFuncotation
s will be made.sourceFilePath
-Path
to the VCF file from whichVariantContext
s will be read in and used as Features from which to createFuncotation
s.annotationOverridesMap
- ALinkedHashMap<String,
containing user-specified overrides for specificString> Funcotation
s.mainSourceFileAsFeatureInput
- The backingFeatureInput
for thisVcfFuncotationFactory
, from which allFuncotation
s will be created.isDataSourceB37
- Iftrue
, indicates that the data source behind thisGencodeFuncotationFactory
contains B37 data.
-
VcfFuncotationFactory
public VcfFuncotationFactory(String name, String version, Path sourceFilePath, LinkedHashMap<String, String> annotationOverridesMap, FeatureInput<? extends htsjdk.tribble.Feature> mainSourceFileAsFeatureInput, boolean isDataSourceB37, int minBasesForValidSegment) Create aVcfFuncotationFactory
.- Parameters:
name
- AString
containing the name of thisVcfFuncotationFactory
.version
- The versionString
of the backing data source from whichFuncotation
s will be made.sourceFilePath
-Path
to the VCF file from whichVariantContext
s will be read in and used as Features from which to createFuncotation
s.annotationOverridesMap
- ALinkedHashMap<String,
containing user-specified overrides for specificString> Funcotation
s.mainSourceFileAsFeatureInput
- The backingFeatureInput
for thisVcfFuncotationFactory
, from which allFuncotation
s will be created.isDataSourceB37
- Iftrue
, indicates that the data source behind thisGencodeFuncotationFactory
contains B37 data.minBasesForValidSegment
- The minimum number of bases for a segment to be considered valid.
-
-
Method Details
-
getAnnotationFeatureClass
- Specified by:
getAnnotationFeatureClass
in classDataSourceFuncotationFactory
- Returns:
- Get the
Class
of the feature type that can be used to create annotations by thisDataSourceFuncotationFactory
.
-
getName
- Specified by:
getName
in classDataSourceFuncotationFactory
- Returns:
- The name of the data source corresponding to this
DataSourceFuncotationFactory
.
-
getType
- Specified by:
getType
in classDataSourceFuncotationFactory
- Returns:
- The
FuncotatorArgumentDefinitions.DataSourceType
of thisDataSourceFuncotationFactory
.
-
getSupportedFuncotationFields
- Specified by:
getSupportedFuncotationFields
in classDataSourceFuncotationFactory
- Returns:
- An ordered
LinkedHashSet
of the names of annotations that this Data Source supports.
-
createDefaultFuncotationsOnVariant
protected List<Funcotation> createDefaultFuncotationsOnVariant(htsjdk.variant.variantcontext.VariantContext variant, ReferenceContext referenceContext) Description copied from class:DataSourceFuncotationFactory
Creates aList
ofFuncotation
for the givenvariant
andreferenceContext
. These will be default funcotations that essentially have empty values.- Specified by:
createDefaultFuncotationsOnVariant
in classDataSourceFuncotationFactory
- Parameters:
variant
-VariantContext
to annotate.referenceContext
-ReferenceContext
corresponding to the givenvariant
.- Returns:
List
ofFuncotation
given thevariant
,referenceContext
, andfeatureContext
. This should never be empty.
-
createFuncotationsOnVariant
protected List<Funcotation> createFuncotationsOnVariant(htsjdk.variant.variantcontext.VariantContext variant, ReferenceContext referenceContext, List<htsjdk.tribble.Feature> featureList) Creates aList
ofFuncotation
for the givenvariant
,referenceContext
, andfeatureContext
. This is really the only entry point for the Vcf FuncotationFactory.VcfFuncotationFactory
can be used with or without Gencode annotations.- Specified by:
createFuncotationsOnVariant
in classDataSourceFuncotationFactory
- Parameters:
variant
-VariantContext
to annotate.referenceContext
-ReferenceContext
corresponding to the givenvariant
.featureList
-List
ofFeature
corresponding to the givenvariant
.- Returns:
List
ofFuncotation
given thevariant
,referenceContext
, andfeatureContext
. This should never be empty.
-
createFuncotationsOnVariant
protected List<Funcotation> createFuncotationsOnVariant(htsjdk.variant.variantcontext.VariantContext variant, ReferenceContext referenceContext, List<htsjdk.tribble.Feature> featureList, List<GencodeFuncotation> gencodeFuncotations) Description copied from class:DataSourceFuncotationFactory
Creates aList
ofFuncotation
for the givenvariant
,referenceContext
,featureContext
, andgencodeFuncotations
. For some Data Sources knowledge of Gene Name or Transcript ID is required for annotation.- Specified by:
createFuncotationsOnVariant
in classDataSourceFuncotationFactory
- Parameters:
variant
-VariantContext
to annotate.referenceContext
-ReferenceContext
corresponding to the givenvariant
.featureList
-List
ofFeature
corresponding to the givenvariant
.gencodeFuncotations
-List
ofGencodeFuncotation
that have already been created for the givenvariant
/referenceContext
/featureContext
.- Returns:
List
ofFuncotation
given thevariant
,referenceContext
, andfeatureContext
. This should never be empty.
-
close
public void close()Description copied from class:DataSourceFuncotationFactory
Perform cleanup tasks for thisDataSourceFuncotationFactory
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classDataSourceFuncotationFactory
-