@DoNotSubclass public class FeatureContext extends java.lang.Object
hasBackingDataSource()
, and whether there is an interval via getInterval()
Note: This class is NOT intended to be extended outside of the testing harness.Constructor and Description |
---|
FeatureContext()
Creates an empty FeatureContext with no backing data source.
|
FeatureContext(FeatureContext featureContext,
SimpleInterval interval)
Creates a new FeatureContext given a FeatureContext and a query interval.
|
FeatureContext(FeatureManager featureManager,
SimpleInterval interval)
Creates a new FeatureContext given a FeatureManager and a query interval.
|
Modifier and Type | Method and Description |
---|---|
static FeatureContext |
createFeatureContextForTesting(java.util.Map<FeatureInput<? extends htsjdk.tribble.Feature>,java.lang.Class<? extends htsjdk.tribble.Feature>> featureInputsWithType,
java.lang.String dummyToolInstanceName,
SimpleInterval interval,
int featureQueryLookahead,
int cloudPrefetchBuffer,
int cloudIndexPrefetchBuffer,
java.nio.file.Path reference)
Convenience method to create a new instance for test methods.
|
<T extends htsjdk.tribble.Feature> |
getHeader(FeatureInput<T> featureDescriptor)
Gets the header associated with the provided FeatureInput
|
SimpleInterval |
getInterval()
Gets our query interval (the interval that all Features returned by this FeatureContext overlap).
|
<T extends htsjdk.tribble.Feature> |
getValues(java.util.Collection<FeatureInput<T>> featureDescriptors)
Gets all Features from the sources represented by the provided FeatureInput arguments that overlap
this FeatureContext's query interval.
|
<T extends htsjdk.tribble.Feature> |
getValues(java.util.Collection<FeatureInput<T>> featureDescriptors,
int featureStart)
Gets all Features from the sources represented by the provided FeatureInput arguments that overlap
this FeatureContext's query interval, AND that start at the specified start position.
|
<T extends htsjdk.tribble.Feature> |
getValues(FeatureInput<T> featureDescriptor)
Gets all Features from the source represented by the provided FeatureInput argument that overlap
this FeatureContext's query interval.
|
<T extends htsjdk.tribble.Feature> |
getValues(FeatureInput<T> featureDescriptor,
int featureStart)
Gets all Features from the source represented by the provided FeatureInput argument that overlap
this FeatureContext's query interval AND that start at the specified start position.
|
<T extends htsjdk.tribble.Feature> |
getValues(FeatureInput<T> featureDescriptor,
int windowLeadingBases,
int windowTrailingBases)
Gets all Features from the source represented by the provided FeatureInput argument that overlap this
FeatureContext's query interval as expanded by the specified number of leading/trailing bases.
|
<T extends htsjdk.tribble.Feature> |
getValues(FeatureInput<T> featureDescriptor,
htsjdk.samtools.util.Locatable queryInterval)
Gets all Features from the source represented by the provided FeatureInput argument that overlap the given interval.
|
boolean |
hasBackingDataSource()
Determines whether this FeatureContext has a backing source of Features.
|
public FeatureContext()
public FeatureContext(FeatureManager featureManager, SimpleInterval interval)
featureManager
- FeatureManager containing backing data sources for all discovered Feature arguments. Null if there are no sources of Features.interval
- Interval to constrain queries on this FeatureContext. Null if we have no known location.public FeatureContext(FeatureContext featureContext, SimpleInterval interval)
public boolean hasBackingDataSource()
public SimpleInterval getInterval()
public <T extends htsjdk.tribble.Feature> java.lang.Object getHeader(FeatureInput<T> featureDescriptor)
T
- type of Feature in our FeatureInputfeatureDescriptor
- FeatureInput whose header we want to retrievepublic <T extends htsjdk.tribble.Feature> java.util.List<T> getValues(FeatureInput<T> featureDescriptor)
T
- type of Feature in the data source backing the provided FeatureInputfeatureDescriptor
- FeatureInput argument for which to fetch Featurespublic <T extends htsjdk.tribble.Feature> java.util.List<T> getValues(FeatureInput<T> featureDescriptor, int windowLeadingBases, int windowTrailingBases)
T
- type of Feature in the data source backing the provided FeatureInputfeatureDescriptor
- FeatureInput argument for which to fetch FeatureswindowLeadingBases
- Number of extra reference bases to include before the start of our interval. Must be >= 0.windowTrailingBases
- Number of extra reference bases to include after the end of our interval. Must be >= 0.public <T extends htsjdk.tribble.Feature> java.util.List<T> getValues(FeatureInput<T> featureDescriptor, htsjdk.samtools.util.Locatable queryInterval)
T
- type of Feature in the data source backing the provided FeatureInputfeatureDescriptor
- FeatureInput argument for which to fetch Featurespublic <T extends htsjdk.tribble.Feature> java.util.List<T> getValues(FeatureInput<T> featureDescriptor, int featureStart)
T
- type of Feature in the data source backing the provided FeatureInputfeatureDescriptor
- FeatureInput argument for which to fetch FeaturesfeatureStart
- All returned Features must start at this position, in addition to overlapping this
FeatureContext's query intervalpublic <T extends htsjdk.tribble.Feature> java.util.List<T> getValues(java.util.Collection<FeatureInput<T>> featureDescriptors)
T
- type of Feature in the data sources backing the provided FeatureInputsfeatureDescriptors
- FeatureInput arguments for which to fetch Featurespublic <T extends htsjdk.tribble.Feature> java.util.List<T> getValues(java.util.Collection<FeatureInput<T>> featureDescriptors, int featureStart)
T
- type of Feature in the data sources backing the provided FeatureInputsfeatureDescriptors
- FeatureInput arguments for which to fetch FeaturesfeatureStart
- All returned Features must start at this position, in addition to overlapping this
FeatureContext's query intervalpublic static FeatureContext createFeatureContextForTesting(java.util.Map<FeatureInput<? extends htsjdk.tribble.Feature>,java.lang.Class<? extends htsjdk.tribble.Feature>> featureInputsWithType, java.lang.String dummyToolInstanceName, SimpleInterval interval, int featureQueryLookahead, int cloudPrefetchBuffer, int cloudIndexPrefetchBuffer, java.nio.file.Path reference)
featureInputsWithType
- Map
of a FeatureInput
to the output type that must extend Feature
.
Never null
, but empty list is acceptable.dummyToolInstanceName
- A name to use for the "tool". Any string will work here. Never null
.interval
- genomic interval for the result. Typically, this would be the interval of the variant. Never null
.featureQueryLookahead
- When querying FeatureDataSources, cache this many extra bases of context beyond
the end of query intervals in anticipation of future queries. Must be >= 0. If uncertain, use zero.cloudPrefetchBuffer
- See FeatureManager.FeatureManager(CommandLineProgram, int, int, int, org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBOptions)
If uncertain, use zero.cloudIndexPrefetchBuffer
- See FeatureManager.FeatureManager(CommandLineProgram, int, int, int, org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBOptions)
If uncertain, use zero.reference
- See FeatureManager.FeatureManager(CommandLineProgram, int, int, int, org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBOptions)
If uncertain, use null
.