public abstract class VariantLocusWalker extends VariantWalkerBase
changeTraversalModeToByVariant()
, otherwise only loci with
overlapping variants are traversed.
VariantLocusWalker authors must implement the apply(htsjdk.samtools.util.Locatable, java.util.List<htsjdk.variant.variantcontext.VariantContext>, org.broadinstitute.hellbender.engine.ReadsContext, org.broadinstitute.hellbender.engine.ReferenceContext, org.broadinstitute.hellbender.engine.FeatureContext)
method to process each variant, and may optionally implement
GATKTool.onTraversalStart()
, GATKTool.onTraversalSuccess()
and/or GATKTool.closeTool()
.Modifier and Type | Field and Description |
---|---|
java.lang.String |
drivingVariantFile |
DEFAULT_DRIVING_VARIANTS_LOOKAHEAD_BASES, genomicsDBOptions
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 |
---|
VariantLocusWalker() |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(htsjdk.samtools.util.Locatable loc,
java.util.List<htsjdk.variant.variantcontext.VariantContext> variants,
ReadsContext readsContext,
ReferenceContext referenceContext,
FeatureContext featureContext)
Process by locus, with all variants overlapping the current locus, or by individual variant when in by-variants
traversal mode.
|
protected void |
changeTraversalModeToByVariant()
Traverse by variant instead of by grouped by locus.
|
protected FeatureInput<htsjdk.variant.variantcontext.VariantContext> |
getDrivingVariantsFeatureInput()
Returns the feature input for the driving variants file.
|
htsjdk.variant.vcf.VCFHeader |
getHeaderForVariants()
Gets the header associated with our driving source of variants as a VCFHeader.
|
protected htsjdk.samtools.SAMSequenceDictionary |
getSequenceDictionaryForDrivingVariants()
Return the primary sequence dictionary to be used for the driving variants for this tool.
|
protected java.util.Spliterator<htsjdk.variant.variantcontext.VariantContext> |
getSpliteratorForDrivingVariants()
Return a spliterator to be used to iterate over the elements of the driving variants.
|
protected void |
initializeDrivingVariants()
Process the feature inputs that represent the primary driving source(s) of variants for this tool, and
perform any necessary header and sequence dictionary validation.
|
protected void |
onShutdown()
Close all data sources.
|
protected void |
onStartup()
Marked final so that tool authors don't override it.
|
boolean |
requiresReference()
Does this tool require reference data? Traversals types and/or tools that do should override to return true.
|
void |
traverse()
A complete traversal from start to finish.
|
getBestAvailableSequenceDictionary, getDrivingVariantCacheLookAheadBases, getGenomicsDBOptions, getProgressMeterRecordLabel, getTransformedVariantStream, getTransformedVariantStream, makePostVariantFilterTransformer, makePreVariantFilterTransformer, makeVariantFilter, requiresFeatures
directlyAccessEngineFeatureManager, directlyAccessEngineReadsDataSource, directlyAccessEngineReferenceDataSource
addFeatureInputsAfterInitialization, closeTool, createSAMWriter, createSAMWriter, createVCFWriter, createVCFWriter, doWork, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultReadFilters, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolName, getTransformedReadStream, getTraversalIntervals, hasFeatures, hasReads, hasReference, hasUserSuppliedIntervals, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeVariantAnnotations, onTraversalStart, onTraversalSuccess, requiresIntervals, requiresReads, transformTraversalIntervals, useVariantAnnotations
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getSupportInformation, getToolkitName, getToolkitShortName, getToolStatusWarning, getUsage, getVersion, instanceMain, instanceMainPostParseArgs, isBetaFeature, isExperimentalFeature, parseArgs, printLibraryVersions, printSettings, printStartupMessage, runTool, setDefaultHeaders, warnOnToolStatus
@Argument(fullName="variant", shortName="V", doc="A VCF file containing variants", common=false, optional=false) public java.lang.String drivingVariantFile
protected void changeTraversalModeToByVariant()
apply(htsjdk.samtools.util.Locatable, java.util.List<htsjdk.variant.variantcontext.VariantContext>, org.broadinstitute.hellbender.engine.ReadsContext, org.broadinstitute.hellbender.engine.ReferenceContext, org.broadinstitute.hellbender.engine.FeatureContext)
method will be called for each
individual variant in the driving variants input, instead of by locus, with all variants overlapping that locus.
This mehtod must be called in OnTraversalStart();protected htsjdk.samtools.SAMSequenceDictionary getSequenceDictionaryForDrivingVariants()
VariantWalkerBase
VariantWalkerBase.initializeDrivingVariants()
getSequenceDictionaryForDrivingVariants
in class VariantWalkerBase
protected java.util.Spliterator<htsjdk.variant.variantcontext.VariantContext> getSpliteratorForDrivingVariants()
VariantWalkerBase
getSpliteratorForDrivingVariants
in class VariantWalkerBase
protected final void onStartup()
GATKTool.onTraversalStart()
instead.protected void initializeDrivingVariants()
VariantWalkerBase
initializeDrivingVariants
in class VariantWalkerBase
protected final FeatureInput<htsjdk.variant.variantcontext.VariantContext> getDrivingVariantsFeatureInput()
public final htsjdk.variant.vcf.VCFHeader getHeaderForVariants()
getHeaderForVariants
in class VariantWalkerBase
public boolean requiresReference()
GATKTool
requiresReference
in class GATKTool
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.public abstract void apply(htsjdk.samtools.util.Locatable loc, java.util.List<htsjdk.variant.variantcontext.VariantContext> variants, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext)
loc
- the current locus being traversed (in group by locus), or the span of the current variant (in by-variants
traversal)variants
- The current variant(s) being processed. NOTE: When changeTraversalModeToByVariant()
has been called, the apply(htsjdk.samtools.util.Locatable, java.util.List<htsjdk.variant.variantcontext.VariantContext>, org.broadinstitute.hellbender.engine.ReadsContext, org.broadinstitute.hellbender.engine.ReferenceContext, org.broadinstitute.hellbender.engine.FeatureContext)
method will be called for each individual variant in the
driving variants input. Otherwise, this method is called once for every locus that has
overlapping variants, with all variants overlapping that locus.readsContext
- Reads overlapping the current variant. 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 variant. 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 variant's interval
by invoking ReferenceContext.setWindow(int, int)
on this object before calling ReferenceContext.getBases()
featureContext
- Features spanning the current variant. 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()
and/or
GATKTool.closeTool()
instead.onShutdown
in class GATKTool