Skip to content
Snippets Groups Projects
Commit 94a2b3dd authored by bow's avatar bow
Browse files

Add test for different chromosome overlap

parent aa84be3d
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
@HD VN:1.0 SO:coordinate
@SQ SN:chrQ LN:10000
@SQ SN:chrR LN:10000
@RG ID:001 DS:single-end reads SM:WipeReadsTestCase
r02 16 chrQ 50 60 10M * 0 0 TACGTACGTA EEFFGGHHII RG:Z:001
r04 0 chrQ 500 60 10M * 0 0 CGTACGTACG EEFFGGHHII RG:Z:001
r01 0 chrR 50 60 10M * 0 0 TACGTACGTA EEFFGGHHII RG:Z:001
r03 16 chrR 500 60 10M * 0 0 GGGGGAAAAA GGGGGGGGGG RG:Z:001
r05 4 * 0 0 * * 0 0 ATATATATAT HIHIHIHIHI RG:Z:001
...@@ -35,6 +35,7 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -35,6 +35,7 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers {
private val samP: SAMLineParser = { private val samP: SAMLineParser = {
val samh = new SAMFileHeader val samh = new SAMFileHeader
samh.addSequence(new SAMSequenceRecord("chrQ", 10000)) samh.addSequence(new SAMSequenceRecord("chrQ", 10000))
samh.addSequence(new SAMSequenceRecord("chrR", 10000))
samh.addReadGroup(new SAMReadGroupRecord("001")) samh.addReadGroup(new SAMReadGroupRecord("001"))
samh.addReadGroup(new SAMReadGroupRecord("002")) samh.addReadGroup(new SAMReadGroupRecord("002"))
new SAMLineParser(samh) new SAMLineParser(samh)
...@@ -83,6 +84,15 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -83,6 +84,15 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers {
val sBamFile3 = new File(resourcePath("/single03.bam")) val sBamFile3 = new File(resourcePath("/single03.bam"))
val sBamFile4 = new File(resourcePath("/single04.bam")) val sBamFile4 = new File(resourcePath("/single04.bam"))
val sBamFile5 = new File(resourcePath("/single05.bam"))
val sBamRecs5 = makeSams(
"r02\t16\tchrR\t50\t60\t10M\t*\t0\t0\tTACGTACGTA\tEEFFGGHHII\tRG:Z:001",
"r04\t0\tchrQ\t500\t60\t10M\t*\t0\t0\tCGTACGTACG\tEEFFGGHHII\tRG:Z:001",
"r01\t0\tchrR\t50\t60\t10M\t*\t0\t0\tTACGTACGTA\tEEFFGGHHII\tRG:Z:001",
"r03\t16\tchrQ\t500\t60\t10M\t*\t0\t0\tGGGGGAAAAA\tGGGGGGGGGG\tRG:Z:001",
"r05\t4\t*\t0\t0\t*\t*\t0\t0\tATATATATAT\tHIHIHIHIHI\tRG:Z:001"
)
val pBamFile1 = new File(resourcePath("/paired01.bam")) val pBamFile1 = new File(resourcePath("/paired01.bam"))
val pBamRecs1 = makeSams( val pBamRecs1 = makeSams(
"r02\t99\tchrQ\t50\t60\t10M\t=\t90\t50\tTACGTACGTA\tEEFFGGHHII\tRG:Z:001", "r02\t99\tchrQ\t50\t60\t10M\t=\t90\t50\tTACGTACGTA\tEEFFGGHHII\tRG:Z:001",
...@@ -196,6 +206,19 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -196,6 +206,19 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers {
filterNotFunc(sBamRecs1(6)) shouldBe false filterNotFunc(sBamRecs1(6)) shouldBe false
} }
@Test def testSingleBamDifferentChromosomes() = {
val intervals: List[Interval] = List(
new Interval("chrQ", 50, 55),
new Interval("chrR", 500, 505)
)
val filterNotFunc = makeFilterNotFunction(intervals, sBamFile5, bloomSize = bloomSize, bloomFp = bloomFp)
filterNotFunc(sBamRecs5(0)) shouldBe true
filterNotFunc(sBamRecs5(1)) shouldBe false
filterNotFunc(sBamRecs5(2)) shouldBe false
filterNotFunc(sBamRecs5(3)) shouldBe true
filterNotFunc(sBamRecs5(4)) shouldBe false
}
@Test def testSingleBamFilterOutMultiNotSet() = { @Test def testSingleBamFilterOutMultiNotSet() = {
val intervals: List[Interval] = List( val intervals: List[Interval] = List(
new Interval("chrQ", 291, 320), // overlaps r01, second hit, new Interval("chrQ", 291, 320), // overlaps r01, second hit,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment