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
610e9327
Commit
610e9327
authored
Mar 08, 2016
by
Wai Yi Leung
Browse files
Merge branch 'fix-sv_unit_tests' into 'develop'
Fixed sv unit testing Fixes #291 See merge request !345
parents
34dca7bc
23e05373
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala
View file @
610e9327
...
...
@@ -22,14 +22,13 @@ import com.google.common.io.Files
import
nl.lumc.sasc.biopet.extensions.breakdancer.
{
BreakdancerCaller
,
BreakdancerConfig
,
BreakdancerVCF
}
import
nl.lumc.sasc.biopet.extensions.clever.CleverCaller
import
nl.lumc.sasc.biopet.extensions.delly.DellyCaller
import
nl.lumc.sasc.biopet.extensions.pindel.
{
Pindel
VCF
,
PindelConfig
,
Pindel
Caller
}
import
nl.lumc.sasc.biopet.extensions.pindel.
{
Pindel
Caller
,
PindelConfig
,
Pindel
VCF
}
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
nl.lumc.sasc.biopet.utils.config.Config
import
org.apache.commons.io.FileUtils
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
import
org.testng.annotations.
{
DataProvider
,
Test
}
import
scala.collection.mutable.ListBuffer
...
...
@@ -106,7 +105,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
PindelVCF
])
shouldBe
(
if
(
pindel
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
CleverCaller
])
shouldBe
(
if
(
clever
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
DellyCaller
])
shouldBe
(
if
(
delly
)
(
bams
*
4
)
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
DellyCaller
])
shouldBe
(
if
(
delly
)
bams
*
4
else
0
)
}
}
...
...
@@ -114,12 +113,12 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
@DataProvider
(
name
=
"dellyOptions"
)
def
dellyOptions
=
{
val
bool
=
Array
(
true
,
false
)
(
for
(
for
(
del
<-
bool
;
dup
<-
bool
;
inv
<-
bool
;
tra
<-
bool
)
yield
Array
(
1
,
del
,
dup
,
inv
,
tra
)
).
toArray
)
yield
Array
(
1
,
del
,
dup
,
inv
,
tra
)
}
@Test
(
dataProvider
=
"dellyOptions"
)
...
...
@@ -130,7 +129,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
)
val
pipeline
=
initPipeline
(
map
)
pipeline
.
inputBams
=
Map
(
"bam"
->
Shiva
Variantc
allingTest
.
inputTouch
(
"bam"
+
".bam"
))
pipeline
.
inputBams
=
Map
(
"bam"
->
Shiva
SvC
allingTest
.
inputTouch
(
"bam"
+
".bam"
))
if
(!
del
&&
!
dup
&&
!
inv
&&
!
tra
)
intercept
[
IllegalArgumentException
]
{
pipeline
.
init
()
...
...
@@ -150,7 +149,7 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
val
map
=
Map
(
"sv_callers"
->
List
(
"this is not a caller"
))
val
pipeline
=
initPipeline
(
map
)
pipeline
.
inputBams
=
Map
(
"bam"
->
Shiva
Variantc
allingTest
.
inputTouch
(
"bam"
+
".bam"
))
pipeline
.
inputBams
=
Map
(
"bam"
->
Shiva
SvC
allingTest
.
inputTouch
(
"bam"
+
".bam"
))
intercept
[
IllegalArgumentException
]
{
pipeline
.
init
()
...
...
@@ -176,16 +175,13 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
assert
(
summaryCallers
.
contains
(
"clever"
))
assert
(
summaryCallers
.
contains
(
"breakdancer"
))
}
@AfterClass
def
removeTempOutputDir
()
=
{
FileUtils
.
deleteDirectory
(
ShivaSvCallingTest
.
outputDir
)
}
}
object
ShivaSvCallingTest
{
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
inputTouch
(
name
:
String
)
:
File
=
{
private
def
inputTouch
(
name
:
String
)
:
File
=
{
val
file
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
name
).
getAbsoluteFile
Files
.
touch
(
file
)
file
...
...
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
View file @
610e9327
...
...
@@ -96,16 +96,13 @@ class ShivaVariantcallingTest extends TestNGSuite with Matchers {
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
VcfFilter
])
shouldBe
(
if
(
raw
)
bams
else
0
)
}
}
@AfterClass
def
removeTempOutputDir
()
=
{
FileUtils
.
deleteDirectory
(
ShivaVariantcallingTest
.
outputDir
)
}
}
object
ShivaVariantcallingTest
{
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
inputTouch
(
name
:
String
)
:
File
=
{
private
def
inputTouch
(
name
:
String
)
:
File
=
{
val
file
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
name
).
getAbsoluteFile
Files
.
touch
(
file
)
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