F
- the driving feature type.public abstract class FeatureWalker<F extends htsjdk.tribble.Feature> extends WalkerBase
Feature
at a time from a source of Features, with
optional contextual information from a reference, sets of reads, and/or supplementary sources
of Features.
Subclasses must implement the apply(Feature, ReadsContext, ReferenceContext, FeatureContext)
method to process each Feature,
as well as isAcceptableFeatureType(Class)
and getDrivingFeatureFile()
, and may optionally implement
GATKTool.onTraversalStart()
, GATKTool.onTraversalSuccess()
, and/or GATKTool.closeTool()
.addOutputSAMProgramRecord, addOutputVCFCommandLine, cloudIndexPrefetchBuffer, cloudPrefetchBuffer, createOutputBamIndex, createOutputBamMD5, createOutputVariantIndex, createOutputVariantMD5, disableBamIndexCaching, features, intervalArgumentCollection, lenientVCFProcessing, outputSitesOnlyVCFs, progressMeter, readArguments, referenceArguments, SECONDS_BETWEEN_PROGRESS_UPDATES_NAME, seqValidationArguments
GATK_CONFIG_FILE, logger, NIO_MAX_REOPENS, NIO_PROJECT_FOR_REQUESTER_PAYS, QUIET, specialArgumentsCollection, tmpDir, useJdkDeflater, useJdkInflater, VERBOSITY
Constructor and Description |
---|
FeatureWalker() |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(F feature,
ReadsContext readsContext,
ReferenceContext referenceContext,
FeatureContext featureContext)
Process an individual feature.
|
abstract java.io.File |
getDrivingFeatureFile()
Returns the file that contains the driving features.
|
java.lang.String |
getProgressMeterRecordLabel() |
protected abstract boolean |
isAcceptableFeatureType(java.lang.Class<? extends htsjdk.tribble.Feature> featureType)
Returns whether the given class of features is acceptable for this walker.
|
protected <T extends htsjdk.tribble.Feature> |
makeFeatureInterval(T feature)
This method can be overridden if you need to customize the interval for a given feature.
|
protected void |
onShutdown()
Close the reads and reference data sources.
|
protected void |
onStartup()
Set the intervals for traversal in the driving features.
|
boolean |
requiresFeatures()
Does this tool require features? Traversals types and/or tools that do should override to return true.
|
void |
traverse()
A complete traversal from start to finish.
|
directlyAccessEngineFeatureManager, directlyAccessEngineReadsDataSource, directlyAccessEngineReferenceDataSource
addFeatureInputsAfterInitialization, closeTool, createSAMWriter, createSAMWriter, createVCFWriter, createVCFWriter, doWork, getBestAvailableSequenceDictionary, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultReadFilters, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getGenomicsDBOptions, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolName, getTransformedReadStream, getTraversalIntervals, hasFeatures, hasReads, hasReference, hasUserSuppliedIntervals, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeVariantAnnotations, onTraversalStart, onTraversalSuccess, requiresIntervals, requiresReads, requiresReference, transformTraversalIntervals, useVariantAnnotations
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getSupportInformation, getToolkitName, getToolkitShortName, getToolStatusWarning, getUsage, getVersion, instanceMain, instanceMainPostParseArgs, isBetaFeature, isExperimentalFeature, parseArgs, printLibraryVersions, printSettings, printStartupMessage, runTool, setDefaultHeaders, warnOnToolStatus
public boolean requiresFeatures()
GATKTool
requiresFeatures
in class GATKTool
public java.lang.String getProgressMeterRecordLabel()
getProgressMeterRecordLabel
in class GATKTool
ProgressMeter.DEFAULT_RECORD_LABEL
,
but tools may override to provide a more appropriate label (like "reads" or "regions")protected final void onStartup()
GATKTool.onTraversalStart()
instead.protected abstract boolean isAcceptableFeatureType(java.lang.Class<? extends htsjdk.tribble.Feature> featureType)
public void traverse()
traverse()
if you are writing a new walker base class in the
engine package that extends this class. It is not meant to be overridden by tools outside of the engine
package.protected <T extends htsjdk.tribble.Feature> SimpleInterval makeFeatureInterval(T feature)
T
- Class that extends feature.feature
- Feature
to derive the interval.null
public abstract void apply(F feature, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext)
feature
- Current Feature being processed.readsContext
- Reads overlapping the current feature. Will be an empty, but non-null, context object
if there is no backing source of reads data (in which case all queries on it will return
an empty array/iterator)referenceContext
- Reference bases spanning the current feature. Will be an empty, but non-null, context object
if there is no backing source of reference data (in which case all queries on it will return
an empty array/iterator). Can request extra bases of context around the current feature's interval
by invoking ReferenceContext.setWindow(int, int)
on this object before calling ReferenceContext.getBases()
featureContext
- Features spanning the current feature. Will be an empty, but non-null, context object
if there is no backing source of Feature data (in which case all queries on it will return an
empty List).protected final void onShutdown()
GATKTool.onTraversalSuccess()
instead.onShutdown
in class GATKTool
public abstract java.io.File getDrivingFeatureFile()
null
.