Cleanup: GATKEngine no longer needs to be lazy loaded, b/c the plugin directory no longer exists.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1287 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-07-21 18:50:51 +00:00
parent b43925c01e
commit 1843684cd2
3 changed files with 3 additions and 35 deletions

View File

@ -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

View File

@ -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;

View File

@ -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<File> samFiles = new ArrayList<File>();
@ -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.