-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Genotyping code for the Gnarly Pipeline (gnomAD v3) #4947
Changes from 5 commits
a5b245f
76f1681
ae1cd9b
c6eb337
b1e1ce1
44d2b35
6e97901
5f62f35
d75a69b
db83c09
4ef5198
3a991d9
fbd8916
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,12 @@ | |
import org.broadinstitute.hellbender.cmdline.CommandLineProgram; | ||
import org.broadinstitute.hellbender.exceptions.GATKException; | ||
import org.broadinstitute.hellbender.exceptions.UserException; | ||
import org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBOptions; | ||
import org.broadinstitute.hellbender.utils.SimpleInterval; | ||
import org.broadinstitute.hellbender.utils.Utils; | ||
import org.broadinstitute.hellbender.utils.config.ConfigFactory; | ||
import org.broadinstitute.hellbender.utils.config.GATKConfig; | ||
import org.broadinstitute.hellbender.utils.variant.GATKVCFConstants; | ||
|
||
import java.io.File; | ||
import java.lang.reflect.Field; | ||
|
@@ -205,7 +207,8 @@ private void initializeFeatureSources( final int featureQueryLookahead, final Co | |
// Only create a data source for Feature arguments that were actually specified | ||
if ( featureInput != null ) { | ||
final Class<? extends Feature> featureType = getFeatureTypeForFeatureInputField(featureArgument.getKey()); | ||
addToFeatureSources(featureQueryLookahead, featureInput, featureType, cloudPrefetchBuffer, cloudIndexPrefetchBuffer, reference); | ||
addToFeatureSources(featureQueryLookahead, featureInput, featureType, cloudPrefetchBuffer, cloudIndexPrefetchBuffer, | ||
toolInstance instanceof VariantWalker ? ((VariantWalker) toolInstance).getGenomicsDBOptions() : null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could probably avoid this ugly Could be done in a separate PR if you don't want to do it here. |
||
} | ||
} | ||
} | ||
|
@@ -217,6 +220,13 @@ public void dumpAllFeatureCacheStats() { | |
} | ||
} | ||
|
||
void addToFeatureSources(final int featureQueryLookahead, final FeatureInput<? extends Feature> featureInput, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add javadoc for this overload (can copy from below) |
||
final Class<? extends Feature> featureType, final int cloudPrefetchBuffer, | ||
final int cloudIndexPrefetchBuffer, final Path reference) { | ||
// Create a new FeatureDataSource for this file, and add it to our query pool | ||
featureSources.put(featureInput, new FeatureDataSource<>(featureInput, featureQueryLookahead, featureType, cloudPrefetchBuffer, cloudIndexPrefetchBuffer, new GenomicsDBOptions(reference))); | ||
} | ||
|
||
/** | ||
* Add the feature data source to the given feature input. | ||
* | ||
|
@@ -225,13 +235,16 @@ public void dumpAllFeatureCacheStats() { | |
* @param featureType class of features | ||
* @param cloudPrefetchBuffer MB size of caching/prefetching wrapper for the data, if on Google Cloud (0 to disable). | ||
* @param cloudIndexPrefetchBuffer MB size of caching/prefetching wrapper for the index, if on Google Cloud (0 to disable). | ||
* @param genomicsDBOptions options and info for reading from a GenomicsDB | ||
* | ||
* Note: package-visible to enable access from the core walker classes | ||
* (but not actual tools, so it's not protected). | ||
*/ | ||
void addToFeatureSources(final int featureQueryLookahead, final FeatureInput<? extends Feature> featureInput, final Class<? extends Feature> featureType, final int cloudPrefetchBuffer, final int cloudIndexPrefetchBuffer, final Path reference) { | ||
void addToFeatureSources(final int featureQueryLookahead, final FeatureInput<? extends Feature> featureInput, | ||
final Class<? extends Feature> featureType, final int cloudPrefetchBuffer, | ||
final int cloudIndexPrefetchBuffer, final GenomicsDBOptions genomicsDBOptions) { | ||
// Create a new FeatureDataSource for this file, and add it to our query pool | ||
featureSources.put(featureInput, new FeatureDataSource<>(featureInput, featureQueryLookahead, featureType, cloudPrefetchBuffer, cloudIndexPrefetchBuffer, reference)); | ||
featureSources.put(featureInput, new FeatureDataSource<>(featureInput, featureQueryLookahead, featureType, cloudPrefetchBuffer, cloudIndexPrefetchBuffer, genomicsDBOptions)); | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; | ||
import org.broadinstitute.hellbender.exceptions.GATKException; | ||
import org.broadinstitute.hellbender.exceptions.UserException; | ||
import org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBOptions; | ||
import org.broadinstitute.hellbender.tools.walkers.annotator.Annotation; | ||
import org.broadinstitute.hellbender.transformers.ReadTransformer; | ||
import org.broadinstitute.hellbender.utils.IntervalUtils; | ||
|
@@ -413,6 +414,14 @@ protected List<SimpleInterval> transformTraversalIntervals(final List<SimpleInte | |
return getIntervals; | ||
} | ||
|
||
/** | ||
* | ||
* @return By default, not every GATK tool can read from a GenomicsDB -- child classes can override | ||
*/ | ||
protected GenomicsDBOptions getGenomicsDBOptions() { | ||
throw new IllegalArgumentException("This tool does not take a GenomicsDB as a feature input."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you have this return either |
||
} | ||
|
||
/** | ||
* Initialize our source of reference data (or set it to null if no reference argument was provided). | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javadoc