Fix for accumulator exception when running reduce by interval walkers without

intervals.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2935 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2010-03-05 01:04:08 +00:00
parent 366771d5a6
commit 7104a3a96c
3 changed files with 21 additions and 2 deletions

View File

@ -48,7 +48,7 @@ public abstract class Accumulator {
* @return Accumulator suitable for this walker.s
*/
public static Accumulator create( GenomeAnalysisEngine engine, Walker walker ) {
if( walker.isReduceByInterval() )
if( walker.isReduceByInterval() && engine.getIntervals() != null)
return new IntervalAccumulator( walker, engine.getIntervals() );
else
return new StandardAccumulator( walker );

View File

@ -410,5 +410,16 @@ public class DepthOfCoverageWalker extends LocusWalker<DepthOfCoverageWalker.DoC
}
}
@Override
public String toString() {
// This is an executive summary, included mainly so that integration tests will pass.
// TODO: Add a more compelling summary.
return String.format("Summary: total coverage = %d; # of deletions = %d; # of bad mapping quality reads = %d; minimum covered depth =%d",
totalCoverage,
numDeletions,
numBadMQReads,
minDepthCoveredLoci);
}
}
}

View File

@ -45,5 +45,13 @@ public class DepthOfCoverageIntegrationTest extends WalkerTest {
1, // just one output file
Arrays.asList("a332d1539b29dff615b198818a3d4dd1"));
executeTest("testDepthOfCoverage454", spec);
}
}
@Test
public void testDepthOfCoverageNoIntervals() {
WalkerTestSpec spec = new WalkerTestSpec( "-T DepthOfCoverage -R " + validationDataLocation + "human_b36_both.partial.fasta -I " + validationDataLocation + "NA12878.chrom1.SLX.SRP000032.2009_06.bam -o %s",
1, // just one output file
Arrays.asList("7b8fc75dd1995d270831b31c268392a5"));
executeTest("testDepthOfCoverageNoIntervals", spec);
}
}