Make filters used available to the walker via getToolkit().

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2379 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-12-16 21:26:04 +00:00
parent 4e7e0432a2
commit ee47eb4367
2 changed files with 17 additions and 3 deletions

View File

@ -76,7 +76,7 @@ public abstract class CommandLineExecutable extends CommandLineProgram {
protected Object executeGATK() {
Walker<?,?> mWalker = GATKEngine.getWalkerByName(getAnalysisName());
Collection<SamRecordFilter> filters = GATKEngine.getFiltersForWalker(getArgumentCollection(),mWalker);
Collection<SamRecordFilter> 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<SamRecordFilter> filters = GATKEngine.getFiltersForWalker(getArgumentCollection(),walker);
Collection<SamRecordFilter> filters = GATKEngine.createFiltersForWalker(getArgumentCollection(),walker);
for(SamRecordFilter filter: filters)
argumentSources.add(filter.getClass());

View File

@ -87,6 +87,10 @@ public class GenomeAnalysisEngine {
*/
private Collection<Stub<?>> outputs = new ArrayList<Stub<?>>();
/**
* Collection of the filters applied to the walker's input data.
*/
private Collection<SamRecordFilter> 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<SamRecordFilter> getFiltersForWalker(GATKArgumentCollection args, Walker walker) {
protected Collection<SamRecordFilter> createFiltersForWalker(GATKArgumentCollection args, Walker walker) {
Set<SamRecordFilter> filters = new HashSet<SamRecordFilter>();
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<SamRecordFilter> getFilters() {
return this.filters;
}
/**
* Returns data source objects encapsulating all rod data;
* individual rods can be accessed through the returned data source objects.