Skip to content

Commit

Permalink
fix #204
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Tarasov committed Apr 24, 2016
1 parent 6ce358f commit 00eb211
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,17 @@ testIndexUsage() {
}

testIssue193() {
rm -f output_193.txt
./build/sambamba depth base test/issue_193.bam > output_193.txt 2>/dev/null
diff -q output_193.txt test/issue_193_expected_output.txt
assertEquals 0 $?
}

testIssue204() {
rm -f output_204.txt
./build/sambamba index test/issue_204.bam
./build/sambamba depth region test/issue_204.bam -L 2:166868600-166868813 -T 15 -T 20 -T 25 -m > output_204.txt 2>/dev/null
diff -q output_204.txt test/issue_204_expected_output.txt
}

. shunit2-2.0.3/src/shell/shunit2
6 changes: 3 additions & 3 deletions sambamba/depth.d
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,10 @@ abstract class PerRegionPrinter : ColumnPrinter {
if (read.mate_overlap != MateOverlapStatus.past)
continue;
processCurrentBase(read, id);
} else {
if (read.current_base_quality >= min_base_quality)
cov_per_sample[getSampleId(read)] += 1;
}

if (read.current_base_quality >= min_base_quality)
cov_per_sample[getSampleId(read)] += 1;
}

foreach (pair; overlapping_mate_positions) {
Expand Down
Binary file added test/issue_204.bam
Binary file not shown.
2 changes: 2 additions & 0 deletions test/issue_204_expected_output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# chrom chromStart chromEnd readCount meanCoverage percentage15 percentage20 percentage25 sampleName
2 166868599 166868813 29 17.8084 89.7196 29.9065 0 12878

0 comments on commit 00eb211

Please sign in to comment.