Oops! Accidentally deactivated the ArgumentFactory, needed by the CleanedReadInjector, while refactoring last night.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1223 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-07-13 16:41:55 +00:00
parent b61f9af4d7
commit 5c321f9630
4 changed files with 16 additions and 12 deletions

View File

@ -133,9 +133,9 @@ public class CommandLineGATK extends CommandLineProgram {
@Override @Override
protected ArgumentFactory getCustomArgumentFactory() { protected ArgumentFactory getCustomArgumentFactory() {
return new ArgumentFactory() { return new ArgumentFactory() {
public Object createArgument( Class type, String repr ) { public Object createArgument( Class type, List<String> repr ) {
if (type == SAMFileReader.class) { if (type == SAMFileReader.class && repr.size() == 1) {
SAMFileReader samFileReader = new SAMFileReader(new File(repr),true); SAMFileReader samFileReader = new SAMFileReader(new File(repr.get(0)),true);
samFileReader.setValidationStringency(argCollection.strictnessLevel); samFileReader.setValidationStringency(argCollection.strictnessLevel);
return samFileReader; return samFileReader;
} }

View File

@ -136,7 +136,8 @@ public class GenomeAnalysisEngine {
logger.info("Strictness is " + argCollection.strictnessLevel); logger.info("Strictness is " + argCollection.strictnessLevel);
// perform validation steps that are common to all the engines // perform validation steps that are common to all the engines
genericEngineSetup(); engine.setMaximumIterations(argCollection.maximumEngineIterations);
engine.initialize();
GenomeLocSortedSet locs = null; GenomeLocSortedSet locs = null;
if (argCollection.intervals != null) { if (argCollection.intervals != null) {
@ -192,13 +193,6 @@ public class GenomeAnalysisEngine {
return microScheduler; return microScheduler;
} }
/** commands that get executed for each engine, regardless of the type */
private void genericEngineSetup() {
engine.setMaximumIterations(argCollection.maximumEngineIterations);
engine.initialize();
}
/** /**
* setup the interval regions, from either the interval file of the genome region string * setup the interval regions, from either the interval file of the genome region string
* *

View File

@ -24,6 +24,8 @@
package org.broadinstitute.sting.utils.cmdLine; package org.broadinstitute.sting.utils.cmdLine;
import java.util.List;
/** /**
* Provides a service whereby the application can provide a mechanism * Provides a service whereby the application can provide a mechanism
* for creating specialty arguments. * for creating specialty arguments.
@ -36,5 +38,5 @@ public abstract class ArgumentFactory {
* @param repr A String representation of the argument. * @param repr A String representation of the argument.
* @return * @return
*/ */
public abstract Object createArgument(Class type, String repr); public abstract Object createArgument(Class type, List<String> repr);
} }

View File

@ -270,6 +270,14 @@ public class ParsingEngine {
return; return;
if( definition.source.clazz.isAssignableFrom(object.getClass()) ) { if( definition.source.clazz.isAssignableFrom(object.getClass()) ) {
if( customArgumentFactory != null ) {
Object instance = customArgumentFactory.createArgument(definition.source.field.getType(), match.values());
if( instance != null ) {
definition.source.setValue( object, instance );
return;
}
}
if( !definition.source.isFlag() ) { if( !definition.source.isFlag() ) {
String[] tokens = match.values().toArray(new String[0]); String[] tokens = match.values().toArray(new String[0]);
FieldParser fieldParser = FieldParser.create(definition.source.field); FieldParser fieldParser = FieldParser.create(definition.source.field);