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
31982c15
Commit
31982c15
authored
Feb 22, 2016
by
Wai Yi Leung
Browse files
Adding pindel tests
parent
9ce0cde0
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/pindel/PindelConfig.scala
View file @
31982c15
...
...
@@ -19,7 +19,7 @@ import java.io.{ PrintWriter, File }
import
htsjdk.samtools.SamReaderFactory
import
nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import
nl.lumc.sasc.biopet.utils.ToolCommand
import
nl.lumc.sasc.biopet.utils.
{
BamUtils
,
ToolCommand
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Argument
,
Input
,
Output
}
...
...
@@ -71,7 +71,7 @@ object PindelConfig extends ToolCommand {
val
input
:
File
=
commandArgs
.
inputbam
val
output
:
File
=
commandArgs
.
output
.
getOrElse
(
new
File
(
input
.
getAbsoluteFile
+
".pindel.cfg"
))
val
insertsize
:
Int
=
commandArgs
.
insertsize
.
getOrElse
(
0
)
val
insertsize
:
Int
=
commandArgs
.
insertsize
.
getOrElse
(
BamUtils
.
sampleBamInsertSize
(
input
)
)
val
bamReader
=
SamReaderFactory
.
makeDefault
().
open
(
input
)
val
writer
=
new
PrintWriter
(
output
)
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/svcallers/Pindel.scala
View file @
31982c15
...
...
@@ -19,7 +19,6 @@ import java.text.SimpleDateFormat
import
java.util.Calendar
import
nl.lumc.sasc.biopet.extensions.pindel._
import
nl.lumc.sasc.biopet.utils.BamUtils
import
nl.lumc.sasc.biopet.utils.config.Configurable
/// Pindel is actually a mini pipeline executing binaries from the pindel package
...
...
@@ -42,9 +41,6 @@ class Pindel(val root: Configurable) extends SvCaller {
val
config_file
:
File
=
new
File
(
pindelDir
,
sample
+
".pindel.cfg"
)
val
cfg
=
new
PindelConfig
(
this
)
cfg
.
input
=
bamFile
val
insertSize
:
Int
=
BamUtils
.
sampleBamInsertSize
(
bamFile
)
cfg
.
insertsize
=
insertSize
cfg
.
sampleName
=
sample
cfg
.
output
=
config_file
add
(
cfg
)
...
...
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaS
c
CallingTest.scala
→
public/shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaS
v
CallingTest.scala
View file @
31982c15
...
...
@@ -19,14 +19,12 @@ import java.io.{ File, FileOutputStream }
import
java.nio.file.Paths
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.extensions.breakdancer.
{
Breakdancer
VCF
,
BreakdancerConfig
,
Breakdancer
Caller
}
import
nl.lumc.sasc.biopet.extensions.breakdancer.
{
Breakdancer
Caller
,
BreakdancerConfig
,
Breakdancer
VCF
}
import
nl.lumc.sasc.biopet.extensions.clever.CleverCaller
import
nl.lumc.sasc.biopet.extensions.delly.DellyCaller
import
nl.lumc.sasc.biopet.utils.config.Config
import
nl.lumc.sasc.biopet.extensions.Freebayes
import
nl.lumc.sasc.biopet.extensions.gatk.CombineVariants
import
nl.lumc.sasc.biopet.extensions.tools.VcfFilter
import
nl.lumc.sasc.biopet.extensions.pindel.
{
PindelVCF
,
PindelConfig
,
PindelCaller
}
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
...
...
@@ -57,25 +55,28 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
bams
<-
0
to
3
;
delly
<-
bool
;
clever
<-
bool
;
breakdancer
<-
bool
)
yield
Array
(
bams
,
delly
,
clever
,
breakdancer
)).
toArray
breakdancer
<-
bool
;
pindel
<-
bool
)
yield
Array
(
bams
,
delly
,
clever
,
breakdancer
,
pindel
)).
toArray
}
@Test
(
dataProvider
=
"shivaSvCallingOptions"
)
def
testShivaSvCalling
(
bams
:
Int
,
delly
:
Boolean
,
clever
:
Boolean
,
breakdancer
:
Boolean
)
=
{
breakdancer
:
Boolean
,
pindel
:
Boolean
)
=
{
val
callers
:
ListBuffer
[
String
]
=
ListBuffer
()
if
(
delly
)
callers
.
append
(
"delly"
)
if
(
clever
)
callers
.
append
(
"clever"
)
if
(
breakdancer
)
callers
.
append
(
"breakdancer"
)
if
(
pindel
)
callers
.
append
(
"pindel"
)
val
map
=
Map
(
"sv_callers"
->
callers
.
toList
)
val
pipeline
=
initPipeline
(
map
)
pipeline
.
inputBams
=
(
for
(
n
<-
1
to
bams
)
yield
n
.
toString
->
ShivaSvCallingTest
.
inputTouch
(
"bam_"
+
n
+
".bam"
)).
toMap
val
illegalArgumentException
=
pipeline
.
inputBams
.
isEmpty
||
(!
delly
&&
!
clever
&&
!
breakdancer
)
val
illegalArgumentException
=
pipeline
.
inputBams
.
isEmpty
||
(!
delly
&&
!
clever
&&
!
breakdancer
&&
!
pindel
)
if
(
illegalArgumentException
)
intercept
[
IllegalArgumentException
]
{
pipeline
.
init
()
...
...
@@ -93,10 +94,17 @@ class ShivaSvCallingTest extends TestNGSuite with Matchers {
else
assert
(!
summaryCallers
.
contains
(
"clever"
))
if
(
breakdancer
)
assert
(
summaryCallers
.
contains
(
"breakdancer"
))
else
assert
(!
summaryCallers
.
contains
(
"breakdancer"
))
if
(
pindel
)
assert
(
summaryCallers
.
contains
(
"pindel"
))
else
assert
(!
summaryCallers
.
contains
(
"pindel"
))
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BreakdancerCaller
])
shouldBe
(
if
(
breakdancer
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BreakdancerConfig
])
shouldBe
(
if
(
breakdancer
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BreakdancerCaller
])
shouldBe
(
if
(
breakdancer
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BreakdancerVCF
])
shouldBe
(
if
(
breakdancer
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
PindelConfig
])
shouldBe
(
if
(
pindel
)
bams
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
PindelCaller
])
shouldBe
(
if
(
pindel
)
bams
else
0
)
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
)
...
...
@@ -208,6 +216,9 @@ object ShivaSvCallingTest {
"tabix"
->
Map
(
"exe"
->
"test"
),
"breakdancerconfig"
->
Map
(
"exe"
->
"test"
),
"breakdancercaller"
->
Map
(
"exe"
->
"test"
),
"pindelconfig"
->
Map
(
"exe"
->
"test"
),
"pindelcaller"
->
Map
(
"exe"
->
"test"
),
"pindelvcf"
->
Map
(
"exe"
->
"test"
),
"clever"
->
Map
(
"exe"
->
"test"
),
"delly"
->
Map
(
"exe"
->
"test"
),
"varscan_jar"
->
"test"
...
...
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