Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
03d1f4f9
Commit
03d1f4f9
authored
9 years ago
by
Wai Yi Leung
Browse files
Options
Downloads
Patches
Plain Diff
Adding tests for seqstat
parent
8ec0e2da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/SeqStatTest.scala
+20
-3
20 additions, 3 deletions
...rc/test/scala/nl/lumc/sasc/biopet/tools/SeqStatTest.scala
with
20 additions
and
3 deletions
public/biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/SeqStatTest.scala
+
20
−
3
View file @
03d1f4f9
...
...
@@ -18,12 +18,12 @@ package nl.lumc.sasc.biopet.tools
import
java.io.File
import
java.nio.file.Paths
import
htsjdk.samtools.fastq.
{
FastqReader
,
FastqRecord
}
import
org.mockito.Mockito.
{
inOrder
=>
inOrd
,
when
}
import
htsjdk.samtools.fastq.
{
FastqReader
,
FastqRecord
}
import
org.mockito.Mockito.
{
inOrder
=>
inOrd
,
when
}
import
org.scalatest.Matchers
import
org.scalatest.mock.MockitoSugar
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
DataProvider
,
Test
}
import
org.testng.annotations.
{
DataProvider
,
Test
}
import
scala.collection.JavaConverters._
...
...
@@ -109,6 +109,23 @@ class SeqStatTest extends TestNGSuite with MockitoSugar with Matchers {
}
@Test
(
dataProvider
=
"mockReaderProvider"
,
groups
=
Array
(
"check_readstats"
),
singleThreaded
=
true
,
dependsOnGroups
=
Array
(
"report"
))
def
testReadStatsObject
(
fqMock
:
FastqReader
)
=
{
when
(
fqMock
.
getFile
)
thenReturn
new
File
(
"/tmp/test.fq"
)
when
(
fqMock
.
iterator
)
thenReturn
recordsOver
(
"1"
,
"2"
,
"3"
,
"4"
,
"5"
)
val
seqstat
=
SeqStat
// the histogram should store the lenght==0 value also, for example sequence length 5 is size 6.
// please note that we already loaded the dataset twice in seqstat. (seqstat.Seqstat is called 2 times in previous steps)
seqstat
.
readStats
.
lengths
(
5
)
shouldBe
10
seqstat
.
readStats
.
lengths
.
length
shouldBe
6
seqstat
.
readStats
.
nucs
.
sum
shouldBe
50
seqstat
.
readStats
.
withN
shouldBe
10
}
@Test
def
testArgsMinimum
()
=
{
val
args
=
Array
(
"-i"
,
resourcePath
(
"/paired01a.fq"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment