Allow walkers to enforce the ordering in which ReadFilters are applied (so that they're now done in the order specified in the walker). Useful if you have a computationally expensive filter (like adaptor clipping) that should only be applied to reads passing all other filters.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5600 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2011-04-08 03:34:50 +00:00
parent 53db7b8faa
commit 4f17004590
1 changed files with 7 additions and 3 deletions

View File

@ -445,10 +445,14 @@ public class WalkerManager extends PluginManager<Walker> {
* @return An array of types extending from SamRecordFilter. Will never be null.
*/
public static Collection<Class<? extends SamRecordFilter>> getReadFilterTypes(Class<?> walkerClass) {
Set<Class<? extends SamRecordFilter>> filterTypes = new HashSet<Class<? extends SamRecordFilter>>();
List<Class<? extends SamRecordFilter>> filterTypes = new ArrayList<Class<? extends SamRecordFilter>>();
while(walkerClass != null) {
if(walkerClass.isAnnotationPresent(ReadFilters.class))
filterTypes.addAll(Arrays.asList(walkerClass.getAnnotation(ReadFilters.class).value()));
if(walkerClass.isAnnotationPresent(ReadFilters.class)) {
for ( Class c : walkerClass.getAnnotation(ReadFilters.class).value() ) {
if( !filterTypes.contains(c) )
filterTypes.add(c);
}
}
walkerClass = walkerClass.getSuperclass();
}
return filterTypes;