a small refactoring, and some documentation cleanup

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1210 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
aaron 2009-07-09 22:03:45 +00:00
parent d86717db93
commit 9cfd89c54f
5 changed files with 11 additions and 29 deletions

View File

@ -168,7 +168,7 @@ public class GenomeAnalysisEngine {
/** commands that get executed for each engine, regardless of the type */ /** commands that get executed for each engine, regardless of the type */
private void genericEngineSetup() { private void genericEngineSetup() {
Reads sourceInfo = extractSourceInfoFromArguments(argCollection); Reads sourceInfo = extractSourceInfoFromArguments(argCollection);
engine.setMaxReads(argCollection.maximumEngineIterations); engine.setMaximumIterations(argCollection.maximumEngineIterations);
engine.initialize(); engine.initialize();
} }

View File

@ -17,7 +17,7 @@ public abstract class TraversalEngine {
private final long N_RECORDS_TO_PRINT = 1000000; private final long N_RECORDS_TO_PRINT = 1000000;
// Maximum number of reads to process before finishing // Maximum number of reads to process before finishing
protected long maxReads = -1; protected long maximumIterations = -1;
// the stored header // the stored header
private SAMFileHeader myHeader = null; private SAMFileHeader myHeader = null;
@ -25,20 +25,14 @@ public abstract class TraversalEngine {
/** our log, which we want to capture anything from this class */ /** our log, which we want to capture anything from this class */
protected static Logger logger = Logger.getLogger(TraversalEngine.class); protected static Logger logger = Logger.getLogger(TraversalEngine.class);
// -------------------------------------------------------------------------------------------------------------- /**
// * set the max number of iterations
// Manipulating the underlying engine parameters * @param maximumIterations the number of iterations
// */
// -------------------------------------------------------------------------------------------------------------- public void setMaximumIterations(final int maximumIterations) {
public void setMaxReads(final int maxReads) { this.maximumIterations = maximumIterations;
this.maxReads = maxReads;
} }
// --------------------------------------------------------------------------------------------------------------
//
// functions for dealing locations (areas of the genome we're traversing over)
//
// --------------------------------------------------------------------------------------------------------------
/** /**
* get the associated SAM header for our run * get the associated SAM header for our run
* *
@ -58,11 +52,6 @@ public abstract class TraversalEngine {
public void setSAMHeader(SAMFileHeader myHeader) { public void setSAMHeader(SAMFileHeader myHeader) {
this.myHeader = myHeader; this.myHeader = myHeader;
} }
// --------------------------------------------------------------------------------------------------------------
//
// printing
//
// --------------------------------------------------------------------------------------------------------------
/** /**
* @param curTime (current runtime, in millisecs) * @param curTime (current runtime, in millisecs)
@ -140,16 +129,9 @@ public abstract class TraversalEngine {
logger.info(String.format(" -> %d reads with indels", TraversalStatistics.nSkippedIndels)); logger.info(String.format(" -> %d reads with indels", TraversalStatistics.nSkippedIndels));
} }
// --------------------------------------------------------------------------------------------------------------
//
// Initialization
//
// --------------------------------------------------------------------------------------------------------------
/** Initialize the traversal engine. After this point traversals can be run over the data */ /** Initialize the traversal engine. After this point traversals can be run over the data */
public void initialize() { public void initialize() {
lastProgressPrintTime = startTime = System.currentTimeMillis(); lastProgressPrintTime = startTime = System.currentTimeMillis();
// Initial the reference ordered data iterators
} }
/** /**

View File

@ -200,7 +200,7 @@ public class TraverseDuplicates extends TraversalEngine {
printProgress("dups", site); printProgress("dups", site);
if (this.maxReads > 0 && TraversalStatistics.nRecords > this.maxReads) { if (this.maximumIterations > 0 && TraversalStatistics.nRecords > this.maximumIterations) {
logger.warn(String.format(("Maximum number of duplicate sets encountered, terminating traversal " + TraversalStatistics.nRecords))); logger.warn(String.format(("Maximum number of duplicate sets encountered, terminating traversal " + TraversalStatistics.nRecords)));
break; break;
} }

View File

@ -64,7 +64,7 @@ public class TraverseLoci extends TraversalEngine {
sum = locusWalker.reduce(x, sum); sum = locusWalker.reduce(x, sum);
} }
if (this.maxReads > 0 && TraversalStatistics.nRecords > this.maxReads) { if (this.maximumIterations > 0 && TraversalStatistics.nRecords > this.maximumIterations) {
logger.warn(String.format("Maximum number of reads encountered, terminating traversal " + TraversalStatistics.nRecords)); logger.warn(String.format("Maximum number of reads encountered, terminating traversal " + TraversalStatistics.nRecords));
break; break;
} }

View File

@ -80,7 +80,7 @@ public class TraverseLocusWindows extends TraversalEngine {
leftmostIndex = read.getAlignmentStart(); leftmostIndex = read.getAlignmentStart();
if ( read.getAlignmentEnd() > rightmostIndex ) if ( read.getAlignmentEnd() > rightmostIndex )
rightmostIndex = read.getAlignmentEnd(); rightmostIndex = read.getAlignmentEnd();
if ( this.maxReads > 0 && TraversalStatistics.nRecords > this.maxReads ) { if ( this.maximumIterations > 0 && TraversalStatistics.nRecords > this.maximumIterations) {
logger.warn(String.format("Maximum number of reads encountered, terminating traversal " + TraversalStatistics.nRecords)); logger.warn(String.format("Maximum number of reads encountered, terminating traversal " + TraversalStatistics.nRecords));
done = true; done = true;
} }