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 */
private void genericEngineSetup() {
Reads sourceInfo = extractSourceInfoFromArguments(argCollection);
engine.setMaxReads(argCollection.maximumEngineIterations);
engine.setMaximumIterations(argCollection.maximumEngineIterations);
engine.initialize();
}

View File

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

View File

@ -200,7 +200,7 @@ public class TraverseDuplicates extends TraversalEngine {
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)));
break;
}

View File

@ -64,7 +64,7 @@ public class TraverseLoci extends TraversalEngine {
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));
break;
}

View File

@ -80,7 +80,7 @@ public class TraverseLocusWindows extends TraversalEngine {
leftmostIndex = read.getAlignmentStart();
if ( read.getAlignmentEnd() > rightmostIndex )
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));
done = true;
}