Skip to content

Commit 27599cd

Browse files
committed
Support reference bundles.
1 parent 59e8dae commit 27599cd

File tree

7 files changed

+221
-90
lines changed

7 files changed

+221
-90
lines changed

src/main/java/org/broadinstitute/hellbender/cmdline/StandardArgumentDefinitions.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ private StandardArgumentDefinitions(){}
5656
public static final String INTERVALS_SHORT_NAME = "L";
5757
public static final String COMPARISON_SHORT_NAME = "comp";
5858
public static final String READ_INDEX_SHORT_NAME = READ_INDEX_LONG_NAME;
59-
public static final String PRIMARY_INPUT_LONG_NAME = "primary";
60-
public static final String PRIMARY_INPUT_SHORT_NAME = "PI";
61-
public static final String SECONDARY_INPUT_LONG_NAME = "secondaryI";
62-
public static final String SECONDARY_INPUT_SHORT_NAME = "SI";
59+
public static final String PRIMARY_RESOURCE_LONG_NAME = "primary-resource";
60+
public static final String PRIMARY_RESOURCE_SHORT_NAME = "PR";
61+
public static final String SECONDARY_RESOURCE_LONG_NAME = "secondary-resource";
62+
public static final String SECONDARY_RESOURCE_SHORT_NAME = "SR";
6363
public static final String LENIENT_SHORT_NAME = "LE";
6464
public static final String READ_VALIDATION_STRINGENCY_SHORT_NAME = "VS";
6565
public static final String SAMPLE_ALIAS_SHORT_NAME = "ALIAS";

src/main/java/org/broadinstitute/hellbender/engine/FeatureInput.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public final class FeatureInput<T extends Feature> extends GATKPath implements S
5454
private transient Class<FeatureCodec<T, ?>> featureCodecClass;
5555

5656
/**
57-
* retain any containing bundle in case we need to extract other resources from it
57+
* retain the parent (enclosing) bundle from which this feature input is derived, in case we need to extract
58+
* other resources from it
5859
*/
5960
private Bundle parentBundle;
6061

@@ -148,7 +149,7 @@ public FeatureInput(
148149
final Bundle featureBundle,
149150
final String name) {
150151
super(primaryResourcePath);
151-
// retain the containing bundle for later so we can interrogate it for other resources, like the index
152+
// retain the enclosing bundle for later, so we can interrogate it for other resources such as the index
152153
this.parentBundle = featureBundle;
153154
if (name != null) {
154155
if (primaryResourcePath.getTag() != null) {

src/main/java/org/broadinstitute/hellbender/engine/MultiVariantWalker.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ protected void initializeDrivingVariants() {
8686
final List<Bundle> bundles = BundleJSON.toBundleList(IOUtils.getStringFromPath(gatkPath), GATKPath::new);
8787
for (final Bundle bundle : bundles) {
8888
if (bundle.getPrimaryContentType().equals(BundleResourceType.CT_VARIANT_CONTEXTS)) {
89-
// use the bundle primary resource as the FeatureInput URI, and tear off and attach the
90-
// individual bundle the bundle to the FI as the parent bundle so downstream code can
91-
// extract other resources from it on demand
92-
// note that if the original value from the user has a tag, we can't use it unless there
93-
// is only one input, since FIs have to be unique
89+
// use the bundle primary resource as the FeatureInput URI, and tear off and attach
90+
// the enclosing bundle as the parent bundle for the FI so downstream code can extract
91+
// other resources from it on demand. note that if the original value from the user has
92+
// a tag, we can't propagate it unless there is only one input, since FIs have to be
93+
// unique
9494
final FeatureInput<VariantContext> bundleFI = new FeatureInput<>(
9595
new GATKPath(bundle.getPrimaryResource().getIOPath().get().getURIString()),
9696
bundle,
97-
bundles.size() > 1 ? gatkPath.getTag() : "drivingVariants"
97+
bundles.size() > 1 ?
98+
gatkPath.getTag() :
99+
"drivingVariants"
98100
);
99101
if (drivingVariantsFeatureInputs.contains(bundleFI)) {
100102
throw new UserException.BadInput("Feature inputs must be unique: " + gatkPath);

0 commit comments

Comments
 (0)