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
31be1177
Commit
31be1177
authored
Jan 18, 2017
by
Sander Bollen
Committed by
GitHub
Jan 18, 2017
Browse files
Merge pull request #5 from biopet/fix-BIOPET-519
Fix BIOPET-519
parents
24ac7790
3f119436
Changes
7
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/MultiSampleQScriptTest.scala
View file @
31be1177
...
...
@@ -18,9 +18,9 @@ import java.io.File
import
nl.lumc.sasc.biopet.core.MultiSampleQScript.Gender
import
nl.lumc.sasc.biopet.core.extensions.Md5sum
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
import
nl.lumc.sasc.biopet.utils.config.Config
import
org.broadinstitute.gatk.queue.
{
QScript
,
QSettings
}
import
org.broadinstitute.gatk.queue.
{
QScript
,
QSettings
}
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
...
...
biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/PipelineStatusTest.scala
View file @
31be1177
package
nl.lumc.sasc.biopet.core
import
java.io.
{
File
,
PrintWriter
}
import
java.io.
{
File
,
PrintWriter
}
import
com.google.common.io.Files
import
org.scalatest.Matchers
...
...
@@ -11,8 +11,8 @@ import nl.lumc.sasc.biopet.utils.IoUtils._
import
org.apache.commons.io.FileUtils
/**
* Created by pjvan_thof on 10-1-17.
*/
* Created by pjvan_thof on 10-1-17.
*/
class
PipelineStatusTest
extends
TestNGSuite
with
Matchers
{
@Test
def
testDefault
()
:
Unit
=
{
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/vcfstats/VcfStats.scala
View file @
31be1177
...
...
@@ -14,7 +14,7 @@
*/
package
nl.lumc.sasc.biopet.tools.vcfstats
import
java.io.
{
File
,
FileOutputStream
,
PrintWriter
}
import
java.io.
{
File
,
FileOutputStream
,
IOException
,
PrintWriter
}
import
htsjdk.samtools.util.Interval
import
htsjdk.variant.variantcontext.
{
Genotype
,
VariantContext
}
...
...
@@ -557,11 +557,17 @@ object VcfStats extends ToolCommand {
val
command
:
String
=
"Rscript "
+
file
+
" "
+
args
.
mkString
(
" "
)
logger
.
info
(
"Starting: "
+
command
)
val
process
=
Process
(
command
).
run
(
ProcessLogger
(
x
=>
logger
.
debug
(
x
),
x
=>
logger
.
debug
(
x
)))
if
(
process
.
exitValue
()
==
0
)
logger
.
info
(
"Done: "
+
command
)
else
{
logger
.
warn
(
"Failed: "
+
command
)
if
(!
logger
.
isDebugEnabled
)
logger
.
warn
(
"Use -l debug for more info"
)
try
{
val
process
=
Process
(
command
).
run
(
ProcessLogger
(
x
=>
logger
.
debug
(
x
),
x
=>
logger
.
debug
(
x
)))
if
(
process
.
exitValue
()
==
0
)
logger
.
info
(
"Done: "
+
command
)
else
{
logger
.
warn
(
"Failed: "
+
command
)
if
(!
logger
.
isDebugEnabled
)
logger
.
warn
(
"Use -l debug for more info"
)
}
}
catch
{
case
e
:
IOException
=>
logger
.
warn
(
"Failed: "
+
command
)
logger
.
debug
(
e
)
}
}
}
biopet-tools/src/test/scala/nl/lumc/sasc/biopet/tools/VcfStatsTest.scala
View file @
31be1177
...
...
@@ -103,7 +103,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testMergeStatsMap
=
{
def
testMergeStatsMap
()
=
{
val
m1
:
mutable.Map
[
Any
,
Int
]
=
mutable
.
Map
(
"a"
->
1
)
val
m2
:
mutable.Map
[
Any
,
Int
]
=
mutable
.
Map
(
"b"
->
2
)
...
...
@@ -124,7 +124,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testMergeNestedStatsMap
=
{
def
testMergeNestedStatsMap
()
=
{
val
m1
:
mutable.Map
[
String
,
mutable.Map
[
String
,
mutable.Map
[
Any
,
Int
]]]
=
mutable
.
Map
(
"test"
->
mutable
.
Map
(
"nested"
->
mutable
.
Map
(
"a"
->
1
)))
val
m2
:
Map
[
String
,
Map
[
String
,
Map
[
Any
,
Int
]]]
=
Map
(
"test"
->
...
...
@@ -152,7 +152,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testValueOfTsv
=
{
def
testValueOfTsv
()
=
{
val
i
=
new
File
(
resourcePath
(
"/sample.tsv"
))
valueFromTsv
(
i
,
"Sample_ID_1"
,
"library"
)
should
be
(
Some
(
"Lib_ID_1"
))
...
...
@@ -163,7 +163,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testMain
=
{
def
testMain
()
=
{
val
tmp
=
Files
.
createTempDirectory
(
"vcfStats"
)
val
vcf
=
resourcePath
(
"/chrQ.vcf.gz"
)
val
ref
=
resourcePath
(
"/fake_chrQ.fa"
)
...
...
@@ -229,7 +229,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testSortAnyAny
=
{
def
testSortAnyAny
()
=
{
//stub
val
one
:
Any
=
1
val
two
:
Any
=
2
...
...
@@ -245,7 +245,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testCheckGeneral
=
{
def
testCheckGeneral
()
=
{
val
record
=
new
VCFFileReader
(
new
File
(
resourcePath
(
"/chrQ.vcf.gz"
))).
iterator
().
next
()
val
blah
=
checkGeneral
(
record
,
List
())
...
...
@@ -253,7 +253,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
blah
.
get
(
"chrQ"
)
should
not
be
empty
blah
.
get
(
"total"
)
should
not
be
empty
val
chrq
=
blah
.
get
(
"chrQ"
)
.
get
val
chrq
=
blah
(
"chrQ"
)
chrq
.
get
(
"SampleDistribution-NonInformative"
)
shouldEqual
Some
(
Map
(
0
->
1
))
chrq
.
get
(
"SampleDistribution-Called"
)
shouldEqual
Some
(
Map
(
3
->
1
))
chrq
.
get
(
"SampleDistribution-Mixed"
)
shouldEqual
Some
(
Map
(
0
->
1
))
...
...
@@ -269,7 +269,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
chrq
.
get
(
"SampleDistribution-Variant"
)
shouldEqual
Some
(
Map
(
2
->
1
))
chrq
.
get
(
"general"
)
should
not
be
empty
val
general
=
chrq
.
get
(
"general"
)
.
get
val
general
=
chrq
(
"general"
)
general
.
get
(
"PolymorphicInSamples"
)
shouldEqual
Some
(
1
)
general
.
get
(
"ComplexIndel"
)
shouldEqual
Some
(
0
)
...
...
@@ -291,7 +291,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
general
.
get
(
"Symbolic"
)
shouldEqual
Some
(
0
)
general
.
get
(
"SimpleInsertion"
)
shouldEqual
Some
(
1
)
val
total
=
blah
.
get
(
"total"
)
.
get
val
total
=
blah
(
"total"
)
total
.
get
(
"SampleDistribution-NonInformative"
)
shouldEqual
Some
(
Map
(
0
->
1
))
total
.
get
(
"SampleDistribution-Called"
)
shouldEqual
Some
(
Map
(
3
->
1
))
total
.
get
(
"SampleDistribution-Mixed"
)
shouldEqual
Some
(
Map
(
0
->
1
))
...
...
@@ -307,7 +307,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
total
.
get
(
"SampleDistribution-Variant"
)
shouldEqual
Some
(
Map
(
2
->
1
))
chrq
.
get
(
"general"
)
should
not
be
empty
val
totGeneral
=
total
.
get
(
"general"
)
.
get
val
totGeneral
=
total
(
"general"
)
totGeneral
.
get
(
"PolymorphicInSamples"
)
shouldEqual
Some
(
1
)
totGeneral
.
get
(
"ComplexIndel"
)
shouldEqual
Some
(
0
)
...
...
@@ -331,7 +331,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
}
@Test
def
testCheckGenotype
=
{
def
testCheckGenotype
()
=
{
val
record
=
new
VCFFileReader
(
new
File
(
resourcePath
(
"/chrQ.vcf.gz"
))).
iterator
().
next
()
val
genotype
=
record
.
getGenotype
(
0
)
...
...
@@ -341,7 +341,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
blah
.
get
(
"chrQ"
)
should
not
be
empty
blah
.
get
(
"total"
)
should
not
be
empty
val
chrq
=
blah
.
get
(
"chrQ"
)
.
get
val
chrq
=
blah
(
"chrQ"
)
chrq
.
get
(
"GQ"
)
shouldEqual
Some
(
Map
(
99
->
1
))
chrq
.
get
(
"AD"
)
shouldEqual
Some
(
Map
(
24
->
1
,
21
->
1
))
chrq
.
get
(
"AD-used"
)
shouldEqual
Some
(
Map
(
24
->
1
,
21
->
1
))
...
...
@@ -350,7 +350,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
chrq
.
get
(
"AD-ref"
)
shouldEqual
Some
(
Map
(
24
->
1
))
chrq
.
get
(
"general"
)
should
not
be
empty
val
general
=
chrq
.
get
(
"general"
)
.
get
val
general
=
chrq
(
"general"
)
general
.
get
(
"Hom"
)
shouldEqual
Some
(
0
)
general
.
get
(
"NoCall"
)
shouldEqual
Some
(
0
)
general
.
get
(
"Variant"
)
shouldEqual
Some
(
1
)
...
...
@@ -365,7 +365,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
general
.
get
(
"Het"
)
shouldEqual
Some
(
1
)
general
.
get
(
"HetNonRef"
)
shouldEqual
Some
(
0
)
val
total
=
blah
.
get
(
"total"
)
.
get
val
total
=
blah
(
"total"
)
total
.
get
(
"GQ"
)
shouldEqual
Some
(
Map
(
99
->
1
))
total
.
get
(
"AD"
)
shouldEqual
Some
(
Map
(
24
->
1
,
21
->
1
))
total
.
get
(
"AD-used"
)
shouldEqual
Some
(
Map
(
24
->
1
,
21
->
1
))
...
...
@@ -374,7 +374,7 @@ class VcfStatsTest extends TestNGSuite with Matchers {
total
.
get
(
"AD-ref"
)
shouldEqual
Some
(
Map
(
24
->
1
))
total
.
get
(
"general"
)
should
not
be
empty
val
totGeneral
=
total
.
get
(
"general"
)
.
get
val
totGeneral
=
total
(
"general"
)
totGeneral
.
get
(
"Hom"
)
shouldEqual
Some
(
0
)
totGeneral
.
get
(
"NoCall"
)
shouldEqual
Some
(
0
)
totGeneral
.
get
(
"Variant"
)
shouldEqual
Some
(
1
)
...
...
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/IoUtils.scala
View file @
31be1177
...
...
@@ -14,9 +14,10 @@
*/
package
nl.lumc.sasc.biopet.utils
import
java.io.
{
File
,
FileInputStream
,
FileOutputStream
,
InputStream
}
import
java.io.
_
import
scala.io.Source
import
scala.sys.process.Process
/**
* This object contains generic io methods
...
...
@@ -83,4 +84,13 @@ object IoUtils {
reader
.
close
()
lines
}
def
executableExist
(
exe
:
String
)
:
Boolean
=
{
try
{
val
process
=
Process
(
Seq
(
exe
)).
run
()
true
}
catch
{
case
e
:
IOException
=>
false
}
}
}
shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTest.scala
View file @
31be1177
...
...
@@ -204,6 +204,7 @@ object ShivaTest {
"fastqc"
->
Map
(
"exe"
->
"test"
),
"input_alleles"
->
"test"
,
"variantcallers"
->
"raw"
,
"rscript"
->
Map
(
"exe"
->
"test"
),
"fastqc"
->
Map
(
"exe"
->
"test"
),
"seqtk"
->
Map
(
"exe"
->
"test"
),
"sickle"
->
Map
(
"exe"
->
"test"
),
...
...
tinycap/src/test/scala/nl/lumc/sasc/biopet/pipelines/tinycap/TinyCapTest.scala
View file @
31be1177
...
...
@@ -129,6 +129,7 @@ object TinyCapTest {
"annotation_refflat"
->
annotationRefflat
,
"md5sum"
->
Map
(
"exe"
->
"test"
),
"rscript"
->
Map
(
"exe"
->
"test"
),
"fastqc"
->
Map
(
"exe"
->
"test"
),
"seqtk"
->
Map
(
"exe"
->
"test"
),
"sickle"
->
Map
(
"exe"
->
"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