Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
57478950
Commit
57478950
authored
Oct 13, 2014
by
bow
Browse files
Use TestNGSuite and Matchers in WipeReads test
parent
0ea14304
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/test/scala/nl/lumc/sasc/biopet/core/apps/WipeReadsUnitTest.scala
View file @
57478950
...
...
@@ -9,13 +9,12 @@ import java.io.{ File, IOException }
import
scala.collection.JavaConverters._
import
htsjdk.samtools._
import
org.scalatest.Assertions
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
/* TODO: helper function to create SAMRecord from SAM alignment string
so we can test as if using real SAMRecords
*/
class
WipeReadsUnitTest
extends
Assertions
{
class
WipeReadsUnitTest
extends
TestNGSuite
with
Matchers
{
import
WipeReads._
...
...
@@ -103,13 +102,13 @@ class WipeReadsUnitTest extends Assertions {
@Test
def
testMakeRawIntervalFromBED
()
=
{
val
intervals
:
Vector
[
RawInterval
]
=
makeRawIntervalFromFile
(
BEDFile1
).
toVector
assert
(
intervals
.
length
==
3
)
assert
(
intervals
.
last
.
chrom
==
"chrQ"
)
assert
(
intervals
.
last
.
start
==
2
91
)
assert
(
intervals
.
last
.
end
==
32
0
)
assert
(
intervals
.
head
.
chrom
==
"chrQ"
)
assert
(
intervals
.
head
.
start
==
9
91
)
assert
(
intervals
.
head
.
end
==
100
0
)
intervals
.
length
should
be
(
3
)
intervals
.
head
.
chrom
should
=
==
(
"chrQ"
)
intervals
.
head
.
start
should
be
(
9
91
)
intervals
.
head
.
end
should
be
(
100
0
)
intervals
.
last
.
chrom
should
=
==
(
"chrQ"
)
intervals
.
last
.
start
should
be
(
2
91
)
intervals
.
last
.
end
should
be
(
32
0
)
}
@Test
def
testSingleBAMDefault
()
=
{
...
...
@@ -368,9 +367,9 @@ class WipeReadsUnitTest extends Assertions {
val
exp
=
new
SAMFileReader
(
sBAMFile3
).
asScala
val
obs
=
new
SAMFileReader
(
outBAM
).
asScala
for
((
e
,
o
)
<-
exp
.
zip
(
obs
))
assert
(
e
.
getSAMString
===
o
.
getSAMString
)
assert
(
outBAM
.
exists
)
assert
(
outBAMIndex
.
exists
)
e
.
getSAMString
should
===
(
o
.
getSAMString
)
outBAM
should
be
(
'
exists
)
outBAMIndex
should
be
(
'
exists
)
}
@Test
def
testWriteSingleBAMAndFilteredBAM
()
=
{
...
...
@@ -387,11 +386,11 @@ class WipeReadsUnitTest extends Assertions {
val
exp
=
new
SAMFileReader
(
sBAMFile4
).
asScala
val
obs
=
new
SAMFileReader
(
filteredOutBAM
).
asScala
for
((
e
,
o
)
<-
exp
.
zip
(
obs
))
assert
(
e
.
getSAMString
===
o
.
getSAMString
)
assert
(
outBAM
.
exists
)
assert
(
outBAMIndex
.
exists
)
assert
(
filteredOutBAM
.
exists
)
assert
(
filteredOutBAMIndex
.
exists
)
e
.
getSAMString
should
===
(
o
.
getSAMString
)
outBAM
should
be
(
'
exists
)
outBAMIndex
should
be
(
'
exists
)
filteredOutBAM
should
be
(
'
exists
)
filteredOutBAMIndex
should
be
(
'
exists
)
}
@Test
def
testWritePairBAMDefault
()
=
{
...
...
@@ -404,8 +403,8 @@ class WipeReadsUnitTest extends Assertions {
val
exp
=
new
SAMFileReader
(
pBAMFile3
).
asScala
val
obs
=
new
SAMFileReader
(
outBAM
).
asScala
for
((
e
,
o
)
<-
exp
.
zip
(
obs
))
assert
(
e
.
getSAMString
===
o
.
getSAMString
)
assert
(
outBAM
.
exists
)
assert
(
outBAMIndex
.
exists
)
e
.
getSAMString
should
===
(
o
.
getSAMString
)
outBAM
should
be
(
'
exists
)
outBAMIndex
should
be
(
'
exists
)
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment