public abstract class VariantWalkerBase extends WalkerBase
GATKTool.traverse()
method to process variants, initializeDrivingVariants()
,
getHeaderForVariants()
,
getSequenceDictionaryForDrivingVariants()
,
getSpliteratorForDrivingVariants()
, and may optionally implement GATKTool.onTraversalStart()
,
GATKTool.onTraversalSuccess()
and/or GATKTool.closeTool()
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DRIVING_VARIANTS_LOOKAHEAD_BASES
Default value to control the size of the cache for our driving variants input(s)
(specifically, the number of additional bases worth of overlapping records to cache for
queries on the driving variants).
|
protected GenomicsDBOptions |
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 |
---|
VariantWalkerBase() |
Modifier and Type | Method and Description |
---|---|
htsjdk.samtools.SAMSequenceDictionary |
getBestAvailableSequenceDictionary()
Overriding the superclass method to preferentially
choose the sequence dictionary from the driving source of variants.
|
protected int |
getDrivingVariantCacheLookAheadBases()
When performing a query on the driving variants input(s), the number of additional bases beyond the end
of the query for which overlapping variants should be pre-fetched and cached.
|
protected GenomicsDBOptions |
getGenomicsDBOptions()
Get the GenomicsDB read settings for the current tool
|
abstract htsjdk.variant.vcf.VCFHeader |
getHeaderForVariants()
Return the VCFHeader to be used for the driving variants for this tool.
|
java.lang.String |
getProgressMeterRecordLabel() |
protected abstract htsjdk.samtools.SAMSequenceDictionary |
getSequenceDictionaryForDrivingVariants()
Return the primary sequence dictionary to be used for the driving variants for this tool.
|
protected abstract java.util.Spliterator<htsjdk.variant.variantcontext.VariantContext> |
getSpliteratorForDrivingVariants()
Return a spliterator to be used to iterate over the elements of the driving variants.
|
protected java.util.stream.Stream<htsjdk.variant.variantcontext.VariantContext> |
getTransformedVariantStream(CountingVariantFilter filter)
Returns a stream over the variants, which are:
1.
|
protected java.util.stream.Stream<htsjdk.variant.variantcontext.VariantContext> |
getTransformedVariantStream(java.util.Spliterator<htsjdk.variant.variantcontext.VariantContext> source,
VariantTransformer preTransformer,
CountingVariantFilter filter,
VariantTransformer postTransformer)
Returns a stream over the variants returned by source, which are:
1.
|
protected abstract 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.
|
VariantTransformer |
makePostVariantFilterTransformer()
Returns the post-filter variant transformer (simple or composite) that will be applied to the variants after filtering.
|
VariantTransformer |
makePreVariantFilterTransformer()
Returns the pre-filter variant transformer (simple or composite) that will be applied to the variants before filtering.
|
protected CountingVariantFilter |
makeVariantFilter()
Returns the variant filter (simple or composite) that will be applied to the variants before calling
#apply . |
boolean |
requiresFeatures()
Does this tool require features? Traversals types and/or tools that do should override to return true.
|
directlyAccessEngineFeatureManager, directlyAccessEngineReadsDataSource, directlyAccessEngineReferenceDataSource
addFeatureInputsAfterInitialization, closeTool, createSAMWriter, createVCFWriter, createVCFWriter, createVCFWriter, doWork, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultReadFilters, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolName, getTransformedReadStream, getTraversalIntervals, hasFeatures, hasReads, hasReference, hasUserSuppliedIntervals, initializeProgressMeter, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeVariantAnnotations, onShutdown, onStartup, onTraversalStart, onTraversalSuccess, requiresIntervals, requiresReads, requiresReference, transformTraversalIntervals, traverse, 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 DEFAULT_DRIVING_VARIANTS_LOOKAHEAD_BASES
protected GenomicsDBOptions genomicsDBOptions
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 GenomicsDBOptions getGenomicsDBOptions()
GATKTool
getGenomicsDBOptions
in class GATKTool
public htsjdk.samtools.SAMSequenceDictionary getBestAvailableSequenceDictionary()
getBestAvailableSequenceDictionary
in class GATKTool
null
if no one dictionary is the best one.protected abstract void initializeDrivingVariants()
public abstract htsjdk.variant.vcf.VCFHeader getHeaderForVariants()
initializeDrivingVariants()
protected abstract htsjdk.samtools.SAMSequenceDictionary getSequenceDictionaryForDrivingVariants()
initializeDrivingVariants()
protected abstract java.util.Spliterator<htsjdk.variant.variantcontext.VariantContext> getSpliteratorForDrivingVariants()
protected int getDrivingVariantCacheLookAheadBases()
DEFAULT_DRIVING_VARIANTS_LOOKAHEAD_BASES
Subclasses can customize this value by overriding this method.public VariantTransformer makePreVariantFilterTransformer()
VariantTransformer.identity()
.
Default implementation of GATKTool.traverse()
calls this method once before iterating over the variants and reuses
the transformer object to avoid object allocation.
Subclasses can extend to provide own transformers (i.e. override and call super).
Multiple transformers can be composed by using VariantTransformer
composition methods.public VariantTransformer makePostVariantFilterTransformer()
VariantTransformer.identity()
.
Default implementation of GATKTool.traverse()
calls this method once before iterating over the variants and reuses
the transformer object to avoid object allocation.
Subclasses can extend to provide own transformers (i.e. override and call super).
Multiple transformers can be composed by using VariantTransformer
composition methods.protected java.util.stream.Stream<htsjdk.variant.variantcontext.VariantContext> getTransformedVariantStream(CountingVariantFilter filter)
makePreVariantFilterTransformer()
.
2. Filtered with filter
.
3. Transformed with makePostVariantFilterTransformer()
.protected java.util.stream.Stream<htsjdk.variant.variantcontext.VariantContext> getTransformedVariantStream(java.util.Spliterator<htsjdk.variant.variantcontext.VariantContext> source, VariantTransformer preTransformer, CountingVariantFilter filter, VariantTransformer postTransformer)
protected CountingVariantFilter makeVariantFilter()
#apply
.
The default implementation filters nothing.
Default implementation of GATKTool.traverse()
calls this method once before iterating
over the reads and reuses the filter object to avoid object allocation. Nevertheless, keeping state in filter objects is strongly discouraged.
Subclasses can extend to provide own filters (ie override and call super).
Multiple filters can be composed by using VariantFilter
composition methods.