diff --git a/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java b/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java index f885102e1..195043379 100644 --- a/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java +++ b/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java @@ -2,8 +2,6 @@ package org.broadinstitute.sting.gatk; import org.broadinstitute.sting.utils.cmdLine.CommandLineProgram; import org.broadinstitute.sting.utils.cmdLine.ArgumentFactory; -import org.broadinstitute.sting.utils.cmdLine.ArgumentCollection; -import org.broadinstitute.sting.utils.cmdLine.Argument; import org.broadinstitute.sting.utils.StingException; import org.broadinstitute.sting.utils.xReadLines; import org.broadinstitute.sting.gatk.walkers.Walker; @@ -47,10 +45,9 @@ import net.sf.samtools.SAMFileReader; public abstract class CommandLineExecutable extends CommandLineProgram { /** - * Get an instance of the GATK engine. - * @return The GATK engine that will power the requested traversal. + * The actual engine which performs the analysis. */ - protected abstract GenomeAnalysisEngine getGATKEngine(); + protected GenomeAnalysisEngine GATKEngine = new GenomeAnalysisEngine(); // get the analysis name protected abstract String getAnalysisName(); @@ -71,7 +68,6 @@ public abstract class CommandLineExecutable extends CommandLineProgram { * @return the return code to exit the program with */ protected int execute() { - GenomeAnalysisEngine GATKEngine = getGATKEngine(); GATKArgumentCollection arguments = getArgumentCollection(); Walker mWalker = GATKEngine.getWalkerByName(getAnalysisName()); @@ -108,7 +104,7 @@ public abstract class CommandLineExecutable extends CommandLineProgram { protected Class[] getArgumentSources() { // No walker info? No plugins. if (getAnalysisName() == null) return new Class[] {}; - return new Class[] { getGATKEngine().getWalkerByName(getAnalysisName()).getClass() }; + return new Class[] { GATKEngine.getWalkerByName(getAnalysisName()).getClass() }; } @Override diff --git a/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java b/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java index e665e0f0d..c61461fc2 100755 --- a/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java +++ b/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java @@ -5,8 +5,6 @@ import org.broadinstitute.sting.utils.cmdLine.*; import java.util.List; import java.util.ArrayList; -import net.sf.samtools.SAMFileReader; - /** * * User: aaron @@ -61,19 +59,6 @@ public class CommandLineGATK extends CommandLineExecutable { return header; } - /** - * Lazy load the GATK engine. This current CANNOT happen until after the command-line arguments are populated. - * TODO: Make this chain of events more explicit. Perhaps an abstract initialize method after clp arguments are parsed? - * @return The GATK engine that will power the requested traversal. - */ - @Override - protected GenomeAnalysisEngine getGATKEngine() { - if( GATKEngine == null ) - GATKEngine = new GenomeAnalysisEngine(); - return GATKEngine; - } - - @Override protected String getAnalysisName() { return analysisName; diff --git a/java/src/org/broadinstitute/sting/playground/somaticcoverage/SomaticCoverageTool.java b/java/src/org/broadinstitute/sting/playground/somaticcoverage/SomaticCoverageTool.java index e1e1abce6..4e00a57b4 100644 --- a/java/src/org/broadinstitute/sting/playground/somaticcoverage/SomaticCoverageTool.java +++ b/java/src/org/broadinstitute/sting/playground/somaticcoverage/SomaticCoverageTool.java @@ -2,11 +2,9 @@ package org.broadinstitute.sting.playground.somaticcoverage; import org.broadinstitute.sting.gatk.CommandLineExecutable; import org.broadinstitute.sting.gatk.GATKArgumentCollection; -import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.utils.cmdLine.Argument; import java.io.File; -import java.io.IOException; import java.util.List; import java.util.ArrayList; @@ -43,9 +41,6 @@ import java.util.ArrayList; * a executable command line for the Somatic Coverage Walker. */ public class SomaticCoverageTool extends CommandLineExecutable { - // our genome analysis engine - private GenomeAnalysisEngine GATKEngine = null; - // the two sam/bam files, one for cancer, one for normal @Argument(fullName = "bam_file", shortName = "I", doc = "The bam files, one for the tumor one for the normal", required = true) public List samFiles = new ArrayList(); @@ -60,14 +55,6 @@ public class SomaticCoverageTool extends CommandLineExecutable { } } - @Override - protected GenomeAnalysisEngine getGATKEngine() { - if( GATKEngine == null ) - GATKEngine = new GenomeAnalysisEngine(); - return GATKEngine; - } - - /** * a required method, returns the analysis name. This is usually the walker * name with 'Walker' stripped off.