public abstract class LocusWalker extends GATKTool
GATKTool.makePreReadFilterTransformer()
before filtering.
- Filtered with GATKTool.makeReadFilter()
before post-transformers.
- Transformed with GATKTool.makePostReadFilterTransformer()
before processing.
- Include them into the AlignmentContext
before passing to apply(AlignmentContext, ReferenceContext, FeatureContext)
.
LocusWalker authors must implement the apply() method to process each position, and may optionally implement
onTraversalStart(), onTraversalSuccess() and/or closeTool().Modifier and Type | Field and Description |
---|---|
protected int |
maxDepthPerSample |
addOutputSAMProgramRecord, addOutputVCFCommandLine, cloudIndexPrefetchBuffer, cloudPrefetchBuffer, createOutputBamIndex, createOutputBamMD5, createOutputVariantIndex, createOutputVariantMD5, disableBamIndexCaching, intervalArgumentCollection, lenientVCFProcessing, outputSitesOnlyVCFs, progressMeter, readArguments, referenceArguments, SECONDS_BETWEEN_PROGRESS_UPDATES_NAME
GATK_CONFIG_FILE, logger, NIO_MAX_REOPENS, QUIET, specialArgumentsCollection, TMP_DIR, useJdkDeflater, useJdkInflater, VERBOSITY
Constructor and Description |
---|
LocusWalker() |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(AlignmentContext alignmentContext,
ReferenceContext referenceContext,
FeatureContext featureContext)
Process an individual AlignmentContext (with optional contextual information).
|
protected int |
defaultMaxDepthPerSample()
Returns default value for the
maxDepthPerSample parameter, if none is provided on the command line. |
boolean |
emitEmptyLoci()
Does this tool emit information for uncovered loci? Tools that do should override to return
true . |
java.util.List<ReadFilter> |
getDefaultReadFilters()
Returns the default list of CommandLineReadFilters that are used for this tool.
|
protected LIBSDownsamplingInfo |
getDownsamplingInfo()
Returns the downsampling info using
maxDepthPerSample as target coverage. |
java.lang.String |
getProgressMeterRecordLabel() |
boolean |
includeDeletions()
Does this tool require deletions in the AlignmentContext? Tools that don't should override to return
false . |
boolean |
includeNs()
Does this tool require Ns in the AlignmentContext? Tools that do should override to return
true . |
protected boolean |
keepUniqueReadListInLibs()
Should the LIBS keep unique reads? Tools that do should override to return
true . |
protected void |
onShutdown()
Marked final so that tool authors don't override it.
|
protected void |
onStartup()
Marked final so that tool authors don't override it.
|
boolean |
requiresReads()
LocusWalkers requires read sources
|
void |
traverse()
Implementation of locus-based traversal.
|
protected void |
validateEmitEmptyLociParameters()
The emit empty loci parameter comes with several pitfalls when used incorrectly.
|
addFeatureInputsAfterInitialization, closeTool, createSAMWriter, createSAMWriter, createVCFWriter, doWork, getBestAvailableSequenceDictionary, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolkitShortName, getToolName, getTransformedReadStream, hasFeatures, hasIntervals, hasReads, hasReference, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeVariantAnnotations, onTraversalStart, onTraversalSuccess, requiresFeatures, requiresIntervals, requiresReference, useVariantAnnotations
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getSupportInformation, getToolkitName, getToolStatusWarning, getUsage, getVersion, instanceMain, instanceMainPostParseArgs, isBetaFeature, isExperimentalFeature, parseArgs, printLibraryVersions, printSettings, printStartupMessage, runTool, setDefaultHeaders, warnOnToolStatus
@Argument(fullName="maxDepthPerSample", shortName="maxDepthPerSample", doc="Maximum number of reads to retain per sample per locus. Reads above this threshold will be downsampled. Set to 0 to disable.", optional=true) protected int maxDepthPerSample
protected boolean keepUniqueReadListInLibs()
true
.public boolean requiresReads()
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")public boolean includeDeletions()
false
.true
if this tool requires deletions, false
otherwisepublic boolean includeNs()
true
.true
if this tool requires Ns, false
otherwisepublic boolean emitEmptyLoci()
true
.
NOTE: Typically, this should only be used when intervals are specified.
NOTE: If MappedReadFilter is removed, then emitting empty loci will fail.
NOTE: If there is no available sequence dictionary and this is set to true, there should be a failure. Please
consider requiring reads and/or references for all tools that wish to set this to true
.true
if this tool requires uncovered loci information to be emitted, false
otherwiseprotected int defaultMaxDepthPerSample()
maxDepthPerSample
parameter, if none is provided on the command line.
Default implementation returns 0 (no downsampling by default).public java.util.List<ReadFilter> getDefaultReadFilters()
WellformedReadFilter
and ReadFilterLibrary.MappedReadFilter
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
protected final LIBSDownsamplingInfo getDownsamplingInfo()
maxDepthPerSample
as target coverage.protected final void onStartup()
public void traverse()
getDownsamplingInfo()
and including deletions only if includeDeletions()
returns true
.public abstract void apply(AlignmentContext alignmentContext, ReferenceContext referenceContext, FeatureContext featureContext)
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).protected final void onShutdown()
onShutdown
in class GATKTool
protected void validateEmitEmptyLociParameters()