public abstract class ReadWalker extends WalkerBase
GATKTool.makePreReadFilterTransformer()
before filtering.
- Filtered with GATKTool.makeReadFilter()
before post-transformers.
- Transformed with GATKTool.makePostReadFilterTransformer()
before processing.
- Passed to apply(GATKRead, ReferenceContext, FeatureContext)
for processing.
ReadWalker authors must implement the apply() method to process each read, and may optionally implement
onTraversalStart() and/or onTraversalSuccess(). See the PrintReadsWithReference walker for an example.Modifier and Type | Field and Description |
---|---|
static int |
FEATURE_CACHE_LOOKAHEAD
This number controls the size of the cache for our FeatureInputs
(specifically, the number of additional bases worth of overlapping records to cache when querying feature sources).
|
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 |
---|
ReadWalker() |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(GATKRead read,
ReferenceContext referenceContext,
FeatureContext featureContext)
Process an individual read (with optional contextual information).
|
java.util.List<ReadFilter> |
getDefaultReadFilters()
Returns the default list of CommandLineReadFilters that are used for this tool.
|
java.lang.String |
getProgressMeterRecordLabel() |
protected void |
onShutdown()
Shutdown data sources.
|
protected void |
onStartup()
Initialize data sources for traversal.
|
boolean |
requiresReads()
Does this tool require reads? Traversals types and/or tools that do should override to return true.
|
void |
resetReadsDataSource()
Reset the reads data source so the caller can iterate through the reads again.
|
void |
traverse()
A complete traversal from start to finish.
|
directlyAccessEngineFeatureManager, directlyAccessEngineReadsDataSource, directlyAccessEngineReferenceDataSource
addFeatureInputsAfterInitialization, closeTool, createSAMWriter, createVCFWriter, createVCFWriter, createVCFWriter, doWork, getBestAvailableSequenceDictionary, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getGenomicsDBOptions, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolName, getTransformedReadStream, getTraversalIntervals, hasFeatures, hasReads, hasReference, hasUserSuppliedIntervals, initializeProgressMeter, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeVariantAnnotations, onTraversalStart, onTraversalSuccess, requiresFeatures, requiresIntervals, 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 static final int FEATURE_CACHE_LOOKAHEAD
public boolean requiresReads()
GATKTool
requiresReads
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()
public void traverse()
GATKTool.makeReadFilter()
and transformers using
GATKTool.makePreReadFilterTransformer()
GATKTool.makePostReadFilterTransformer()
and then iterates over all reads, applies
the pre-filter transformer, the filter, then the post-filter transformer and hands the resulting reads to the apply(org.broadinstitute.hellbender.utils.read.GATKRead, org.broadinstitute.hellbender.engine.ReferenceContext, org.broadinstitute.hellbender.engine.FeatureContext)
function of the walker (along with additional contextual information, if present, such as reference bases).
NOTE: You should only override 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.public java.util.List<ReadFilter> getDefaultReadFilters()
WellformedReadFilter
filter with all default options. Subclasses
can override to provide alternative filters.
Note: this method is called before command line parsing begins, and thus before a SAMFileHeader is
available through {link #getHeaderForReads}.getDefaultReadFilters
in class GATKTool
public void resetReadsDataSource()
public abstract void apply(GATKRead read, ReferenceContext referenceContext, FeatureContext featureContext)
read
- current readreferenceContext
- Reference bases spanning the current read. 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 read's interval
by invoking ReferenceContext.setWindow(int, int)
on this object before calling ReferenceContext.getBases()
featureContext
- Features spanning the current read. 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()
onShutdown
in class GATKTool