diff --git a/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java b/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java index 5ce4985dc..36127ebbc 100644 --- a/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java +++ b/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java @@ -76,7 +76,7 @@ public abstract class CommandLineExecutable extends CommandLineProgram { protected Object executeGATK() { Walker mWalker = GATKEngine.getWalkerByName(getAnalysisName()); - Collection filters = GATKEngine.getFiltersForWalker(getArgumentCollection(),mWalker); + Collection filters = GATKEngine.createFiltersForWalker(getArgumentCollection(),mWalker); // load the arguments into the walker / filters. loadArgumentsIntoObject(mWalker); @@ -126,7 +126,7 @@ public abstract class CommandLineExecutable extends CommandLineProgram { Walker walker = GATKEngine.getWalkerByName(getAnalysisName()); argumentSources.add(walker.getClass()); - Collection filters = GATKEngine.getFiltersForWalker(getArgumentCollection(),walker); + Collection filters = GATKEngine.createFiltersForWalker(getArgumentCollection(),walker); for(SamRecordFilter filter: filters) argumentSources.add(filter.getClass()); diff --git a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 80c7c6ec8..8801875cc 100755 --- a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -87,6 +87,10 @@ public class GenomeAnalysisEngine { */ private Collection> outputs = new ArrayList>(); + /** + * Collection of the filters applied to the walker's input data. + */ + private Collection filters; /** * our log, which we want to capture anything from this class @@ -135,6 +139,7 @@ public class GenomeAnalysisEngine { // save our argument parameter this.argCollection = args; + this.filters = filters; // Prepare the data for traversal. initializeDataSources(my_walker, filters, argCollection); @@ -197,10 +202,11 @@ public class GenomeAnalysisEngine { /** * Gets a list of the filters to associate with the given walker. Will NOT initialize the engine with this filters; * the caller must handle that directly. + * @param args Existing argument collection, for compatibility with legacy command-line walkers. * @param walker Walker to use when determining which filters to apply. * @return A collection of available filters. */ - public Collection getFiltersForWalker(GATKArgumentCollection args, Walker walker) { + protected Collection createFiltersForWalker(GATKArgumentCollection args, Walker walker) { Set filters = new HashSet(); filters.addAll(WalkerManager.getReadFilters(walker,filterManager)); if (args.filterZeroMappingQualityReads != null && args.filterZeroMappingQualityReads) @@ -708,6 +714,14 @@ public class GenomeAnalysisEngine { return this.argCollection; } + /** + * Gets the list of filters employed by this walker. + * @return Collection of filters (actual instances) used by this walker. + */ + public Collection getFilters() { + return this.filters; + } + /** * Returns data source objects encapsulating all rod data; * individual rods can be accessed through the returned data source objects.