public abstract class LocusWalkerByInterval extends LocusWalker
LocusWalker
that supports arbitrary interval side inputs.
The class works as follows: Before traversal getIntervalObjectsToQueryOver()
will be called to generate a global
list of Locatable that will be stored in memory for the duration of the traversal. For each site apply(AlignmentContext, ReferenceContext, FeatureContext, Set)
} will be called
with a set consisting of all the provided overlapping intervals. The first time any Locus overlaps with the traversal
onIntervalStart(Locatable)
will be called once. Once a the traversal locus no longer overlaps a Locatable, onIntervalEnd(Locatable)
will be called once to perform any necessary post-processing. Otherwise See LocusWalker
for general implementation details.
NOTE: If there are Locatables provided by getIntervalObjectsToQueryOver()
that are never covered by the traversal of
the tool, onIntervalStart(Locatable)
and onIntervalEnd(Locatable)
will not be called on those intervals.MAX_DEPTH_PER_SAMPLE_NAME, maxDepthPerSample
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 |
---|
LocusWalkerByInterval() |
Modifier and Type | Method and Description |
---|---|
void |
apply(AlignmentContext alignmentContext,
ReferenceContext referenceContext,
FeatureContext featureContext)
Process an individual AlignmentContext (with optional contextual information).
|
abstract void |
apply(AlignmentContext alignmentContext,
ReferenceContext referenceContext,
FeatureContext featureContext,
java.util.Set<htsjdk.samtools.util.Locatable> activeIntervals)
Process an individual AlignmentContext (with optional contextual information).
|
abstract java.util.List<htsjdk.samtools.util.Locatable> |
getIntervalObjectsToQueryOver()
Tool-specified list of Locatable objects (which have been read into memory) that will have overlaps queried at each locus
|
abstract void |
onIntervalEnd(htsjdk.samtools.util.Locatable activeInterval)
Perform any closing operations needed once the provided getIntervalObjectsToQueryOver() interval has been passed by the tool
NOTE: This will only ever be called on an interval that has been covered by
onIntervalStart(Locatable) |
abstract void |
onIntervalStart(htsjdk.samtools.util.Locatable activeInterval)
Perform any initialization needed the first time a provided interval is seen.
|
boolean |
requiresIntervals()
Does this tool require intervals? Traversals types and/or tools that do should override to return true.
|
void |
traverse()
Implementation of locus-based traversal.
|
defaultMaxDepthPerSample, emitEmptyLoci, getDefaultReadFilters, getDownsamplingInfo, getProgressMeterRecordLabel, includeDeletions, includeNs, keepUniqueReadListInLibs, onShutdown, onStartup, requiresReads
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, 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 void traverse()
LocusWalker.traverse()
in that it iterates over all positions in the reference
covered by filtered and transformed reads including deletions only if LocusWalker.includeDeletions()
returns true
.
This method also keeps track of interval objects provided by getIntervalObjectsToQueryOver()
and constructs a
global overlaps detector for all of the intervals which is used by the apply(AlignmentContext, ReferenceContext, FeatureContext)
method to track which locatable still have active hooks. This method also makes sure to close out the list of previous intervals
when traversal has completed so that writers can be populated.traverse
in class LocusWalker
public final boolean requiresIntervals()
GATKTool
requiresIntervals
in class GATKTool
public abstract java.util.List<htsjdk.samtools.util.Locatable> getIntervalObjectsToQueryOver()
public final void apply(AlignmentContext alignmentContext, ReferenceContext referenceContext, FeatureContext featureContext)
LocusWalker
apply
in class LocusWalker
alignmentContext
- current alignment contextreferenceContext
- Reference bases spanning the current locus. 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 locus
by invoking ReferenceContext.setWindow(int, int)
on this object before calling ReferenceContext.getBases()
featureContext
- Features spanning the current locus. 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).public abstract void apply(AlignmentContext alignmentContext, ReferenceContext referenceContext, FeatureContext featureContext, java.util.Set<htsjdk.samtools.util.Locatable> activeIntervals)
alignmentContext
- current alignment contextreferenceContext
- Reference bases spanning the current locus. 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 locus
by invoking ReferenceContext.setWindow(int, int)
on this object before calling ReferenceContext.getBases()
featureContext
- Features spanning the current locus. 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).activeIntervals
- Locatables from the set provided by getIntervalObjectsToQueryOver() spanning the current locus.public abstract void onIntervalStart(htsjdk.samtools.util.Locatable activeInterval)
activeInterval
- Locatable an interval from the set provided by getIntervalObjectsToQueryOver() to the walker to be initializedpublic abstract void onIntervalEnd(htsjdk.samtools.util.Locatable activeInterval)
onIntervalStart(Locatable)
activeInterval
- Locatable provided to the walker to be closed