Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
f4a5bd7a
Commit
f4a5bd7a
authored
Mar 02, 2017
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding separated outputDirs
parent
717a50df
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
231 additions
and
125 deletions
+231
-125
basty/src/test/scala/nl/lumc/sasc/biopet/pipelines/basty/BastyTest.scala
...scala/nl/lumc/sasc/biopet/pipelines/basty/BastyTest.scala
+24
-14
carp/src/test/scala/nl/lumc/sasc/biopet/pipelines/carp/CarpTest.scala
...t/scala/nl/lumc/sasc/biopet/pipelines/carp/CarpTest.scala
+12
-7
flexiprep/src/test/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepTest.scala
.../lumc/sasc/biopet/pipelines/flexiprep/FlexiprepTest.scala
+20
-9
gears/src/test/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingleTest.scala
...nl/lumc/sasc/biopet/pipelines/gears/GearsSingleTest.scala
+20
-10
gears/src/test/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsTest.scala
...scala/nl/lumc/sasc/biopet/pipelines/gears/GearsTest.scala
+23
-10
gentrap/src/test/scala/nl/lumc/sasc/biopet/pipelines/gentrap/GentrapTest.scala
...a/nl/lumc/sasc/biopet/pipelines/gentrap/GentrapTest.scala
+26
-18
sage/src/test/scala/nl/lumc/sasc/biopet/pipelines/sage/SageTest.scala
...t/scala/nl/lumc/sasc/biopet/pipelines/sage/SageTest.scala
+21
-11
shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala
...lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala
+36
-18
shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTest.scala
...scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTest.scala
+24
-12
shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
...sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
+25
-16
No files found.
basty/src/test/scala/nl/lumc/sasc/biopet/pipelines/basty/BastyTest.scala
View file @
f4a5bd7a
...
...
@@ -14,19 +14,20 @@
*/
package
nl.lumc.sasc.biopet.pipelines.basty
import
java.io.
{
File
,
FileOutputStream
}
import
java.io.
{
File
,
FileOutputStream
}
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.extensions.
{
Raxml
,
RunGubbins
}
import
nl.lumc.sasc.biopet.extensions.gatk.
{
BaseRecalibrator
,
IndelRealigner
,
PrintReads
,
RealignerTargetCreator
}
import
nl.lumc.sasc.biopet.extensions.
{
Raxml
,
RunGubbins
}
import
nl.lumc.sasc.biopet.extensions.gatk.
{
BaseRecalibrator
,
IndelRealigner
,
PrintReads
,
RealignerTargetCreator
}
import
nl.lumc.sasc.biopet.extensions.picard.MarkDuplicates
import
nl.lumc.sasc.biopet.extensions.tools.
{
BastyGenerateFasta
,
VcfStats
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
import
nl.lumc.sasc.biopet.extensions.tools.
{
BastyGenerateFasta
,
VcfStats
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
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.
{
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
/**
* Created by pjvanthof on 27/09/16.
...
...
@@ -61,10 +62,14 @@ class BastyTest extends TestNGSuite with Matchers {
def
annotation
=
false
def
bootRuns
:
Option
[
Int
]
=
None
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"bastyOptions"
)
def
testBasty
(
f
:
String
,
sample1
:
Boolean
,
sample2
:
Boolean
)
:
Unit
=
{
val
outputDir
=
BastyTest
.
outputDir
dirs
:+=
outputDir
val
map
=
{
var
m
:
Map
[
String
,
Any
]
=
BastyTest
.
config
var
m
:
Map
[
String
,
Any
]
=
BastyTest
.
config
(
outputDir
)
if
(
sample1
)
m
=
ConfigUtils
.
mergeMaps
(
BastyTest
.
sample1
,
m
)
if
(
sample2
)
m
=
ConfigUtils
.
mergeMaps
(
BastyTest
.
sample2
,
m
)
if
(
dbsnp
)
m
=
ConfigUtils
.
mergeMaps
(
Map
(
"dbsnp_vcf"
->
"test.vcf.gz"
),
m
)
...
...
@@ -133,21 +138,26 @@ class BastyTest extends TestNGSuite with Matchers {
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
RunGubbins
])
shouldBe
2
}
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
object
BastyTest
{
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
def
inputTouch
(
name
:
String
)
:
String
=
{
val
file
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
name
)
val
file
=
new
File
(
inputDir
,
name
)
Files
.
touch
(
file
)
file
.
getAbsolutePath
}
private
def
copyFile
(
name
:
String
)
:
Unit
=
{
val
is
=
getClass
.
getResourceAsStream
(
"/"
+
name
)
val
os
=
new
FileOutputStream
(
new
File
(
out
putDir
,
name
))
val
os
=
new
FileOutputStream
(
new
File
(
in
putDir
,
name
))
org
.
apache
.
commons
.
io
.
IOUtils
.
copy
(
is
,
os
)
os
.
close
()
}
...
...
@@ -156,14 +166,14 @@ object BastyTest {
copyFile
(
"ref.dict"
)
copyFile
(
"ref.fa.fai"
)
val
config
=
Map
(
def
config
(
outputDir
:
File
)
=
Map
(
"skip_write_dependencies"
->
true
,
"name_prefix"
->
"test"
,
"cache"
->
true
,
"dir"
->
"test"
,
"vep_script"
->
"test"
,
"output_dir"
->
outputDir
,
"reference_fasta"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"reference_fasta"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"gatk_jar"
->
"test"
,
"samtools"
->
Map
(
"exe"
->
"test"
),
"bcftools"
->
Map
(
"exe"
->
"test"
),
...
...
carp/src/test/scala/nl/lumc/sasc/biopet/pipelines/carp/CarpTest.scala
View file @
f4a5bd7a
...
...
@@ -50,10 +50,14 @@ class CarpTest extends TestNGSuite with Matchers {
for
(
s1
<-
bool
;
s2
<-
bool
;
s3
<-
bool
;
t
<-
bool
;
c
<-
bool
)
yield
Array
(
""
,
s1
,
s2
,
s3
,
t
,
c
)
}
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"carpOptions"
)
def
testCarp
(
f
:
String
,
sample1
:
Boolean
,
sample2
:
Boolean
,
sample3
:
Boolean
,
threatment
:
Boolean
,
control
:
Boolean
)
:
Unit
=
{
val
outputDir
=
CarpTest
.
outputDir
dirs
:+=
outputDir
val
map
=
{
var
m
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
CarpTest
.
outputDir
var
m
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
outputDir
),
CarpTest
.
executables
)
if
(
sample1
)
m
=
ConfigUtils
.
mergeMaps
(
CarpTest
.
sample1
,
m
)
...
...
@@ -92,22 +96,23 @@ class CarpTest extends TestNGSuite with Matchers {
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
FileUtils
.
deleteDirectory
(
CarpTest
.
outputDir
)
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
object
CarpTest
{
val
outputDir
=
Files
.
createTempDir
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
def
inputTouch
(
name
:
String
)
:
String
=
{
val
file
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
name
)
val
file
=
new
File
(
inputDir
,
name
)
Files
.
touch
(
file
)
file
.
getAbsolutePath
}
private
def
copyFile
(
name
:
String
)
:
Unit
=
{
val
is
=
getClass
.
getResourceAsStream
(
"/"
+
name
)
val
os
=
new
FileOutputStream
(
new
File
(
out
putDir
,
name
))
val
os
=
new
FileOutputStream
(
new
File
(
in
putDir
,
name
))
org
.
apache
.
commons
.
io
.
IOUtils
.
copy
(
is
,
os
)
os
.
close
()
}
...
...
@@ -118,7 +123,7 @@ object CarpTest {
val
executables
=
Map
(
"skip_write_dependencies"
->
true
,
"reference_fasta"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"reference_fasta"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"fastqc"
->
Map
(
"exe"
->
"test"
),
"seqtk"
->
Map
(
"exe"
->
"test"
),
"sickle"
->
Map
(
"exe"
->
"test"
),
...
...
flexiprep/src/test/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepTest.scala
View file @
f4a5bd7a
...
...
@@ -59,10 +59,14 @@ class FlexiprepTest extends TestNGSuite with Matchers {
)
yield
Array
(
""
,
pair
,
skipTrim
,
skipClip
,
zip
,
abortOnCorruptFastq
)
}
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"flexiprepOptions"
)
def
testFlexiprep
(
f
:
String
,
paired
:
Boolean
,
skipTrim
:
Boolean
,
skipClip
:
Boolean
,
zipped
:
Boolean
,
abortOnCorruptFastq
:
Boolean
)
=
{
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
FlexiprepTest
.
outputDir
,
val
outputDir
=
FlexiprepTest
.
outputDir
dirs
:+=
outputDir
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
outputDir
,
"skip_trim"
->
skipTrim
,
"skip_clip"
->
skipClip
,
"abort_on_corrupt_fastq"
->
abortOnCorruptFastq
...
...
@@ -85,8 +89,10 @@ class FlexiprepTest extends TestNGSuite with Matchers {
@Test
def
testNoSample
:
Unit
=
{
val
outputDir
=
FlexiprepTest
.
outputDir
dirs
:+=
outputDir
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
FlexiprepTest
.
outputDir
"output_dir"
->
outputDir
),
Map
(
FlexiprepTest
.
executables
.
toSeq
:
_
*
))
val
flexiprep
:
Flexiprep
=
initPipeline
(
map
)
...
...
@@ -97,22 +103,27 @@ class FlexiprepTest extends TestNGSuite with Matchers {
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
FileUtils
.
deleteDirectory
(
FlexiprepTest
.
outputDir
)
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
object
FlexiprepTest
{
val
outputDir
=
Files
.
createTempDir
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
val
r1
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R1.fq"
)
val
r1
=
new
File
(
inputDir
,
"R1.fq"
)
Files
.
touch
(
r1
)
val
r2
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R2.fq"
)
r1
.
deleteOnExit
()
val
r2
=
new
File
(
inputDir
,
"R2.fq"
)
Files
.
touch
(
r2
)
val
r1Zipped
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R1.fq.gz"
)
r2
.
deleteOnExit
()
val
r1Zipped
=
new
File
(
inputDir
,
"R1.fq.gz"
)
Files
.
touch
(
r1Zipped
)
val
r2Zipped
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R2.fq.gz"
)
r1Zipped
.
deleteOnExit
()
val
r2Zipped
=
new
File
(
inputDir
,
"R2.fq.gz"
)
Files
.
touch
(
r2Zipped
)
r2Zipped
.
deleteOnExit
()
val
executables
=
Map
(
"skip_write_dependencies"
->
true
,
...
...
gears/src/test/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingleTest.scala
View file @
f4a5bd7a
...
...
@@ -18,13 +18,14 @@ import java.io.File
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
nl.lumc.sasc.biopet.extensions.centrifuge.
{
Centrifuge
,
CentrifugeKreport
}
import
nl.lumc.sasc.biopet.extensions.kraken.
{
Kraken
,
KrakenReport
}
import
nl.lumc.sasc.biopet.extensions.centrifuge.
{
Centrifuge
,
CentrifugeKreport
}
import
nl.lumc.sasc.biopet.extensions.kraken.
{
Kraken
,
KrakenReport
}
import
nl.lumc.sasc.biopet.extensions.picard.SamToFastq
import
nl.lumc.sasc.biopet.extensions.samtools.SamtoolsView
import
nl.lumc.sasc.biopet.extensions.tools.KrakenReportToJson
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.apache.commons.io.FileUtils
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
...
...
@@ -60,15 +61,19 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
def
inputMode
:
Option
[
String
]
=
Some
(
"fastq"
)
private
var
dirs
:
List
[
File
]
=
Nil
@Test
def
testGears
()
:
Unit
=
{
val
outputDir
=
TestGearsSingle
.
outputDir
dirs
:+=
outputDir
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"gears_use_qiime_rtax"
->
qiimeRtax
,
"gears_use_centrifuge"
->
centrifuge
,
"gears_use_qiime_closed"
->
qiimeClosed
,
"gears_use_qiime_open"
->
qiimeOpen
,
"gears_use_seq_count"
->
seqCount
,
"output_dir"
->
TestGearsSingle
.
outputDir
"output_dir"
->
outputDir
)
++
kraken
.
map
(
"gears_use_kraken"
->
_
)
++
downsample
.
map
(
"downsample"
->
_
),
...
...
@@ -134,6 +139,11 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
pipesJobs
.
count
(
_
.
isInstanceOf
[
CentrifugeKreport
])
shouldBe
(
if
(
centrifuge
)
2
else
0
)
}
}
@AfterClass
def
removeDirs
:
Unit
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
class
GearsSingleNoInputTest
extends
TestGearsSingle
{
...
...
@@ -219,17 +229,17 @@ class GearsSingleQiimeOpenDownsampleTest extends TestGearsSingle {
}
object
TestGearsSingle
{
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
val
r1
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R1.fq"
)
val
r1
=
new
File
(
inputDir
,
"R1.fq"
)
Files
.
touch
(
r1
)
r1
.
deleteOnExit
()
val
r2
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R2.fq"
)
val
r2
=
new
File
(
inputDir
,
"R2.fq"
)
Files
.
touch
(
r2
)
r2
.
deleteOnExit
()
val
bam
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"bamfile.bam"
)
val
bam
=
new
File
(
inputDir
,
"bamfile.bam"
)
Files
.
touch
(
bam
)
bam
.
deleteOnExit
()
...
...
gears/src/test/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsTest.scala
View file @
f4a5bd7a
...
...
@@ -17,12 +17,13 @@ package nl.lumc.sasc.biopet.pipelines.gears
import
java.io.File
import
com.google.common.io.Files
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.apache.commons.io.FileUtils
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
/**
* Created by pjvanthof on 04/02/16.
...
...
@@ -55,10 +56,14 @@ abstract class GearsTest extends TestNGSuite with Matchers {
)
yield
Array
(
""
,
s1
,
s2
)
}
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"gearsOptions"
)
def
testGears
(
dummy
:
String
,
sample1
:
Boolean
,
sample2
:
Boolean
)
:
Unit
=
{
val
outputDir
=
GearsTest
.
outputDir
dirs
:+=
outputDir
val
map
=
{
var
m
:
Map
[
String
,
Any
]
=
GearsTest
.
config
var
m
:
Map
[
String
,
Any
]
=
GearsTest
.
config
(
outputDir
)
if
(
sample1
)
m
=
ConfigUtils
.
mergeMaps
(
GearsTest
.
sample1
,
m
)
if
(
sample2
)
m
=
ConfigUtils
.
mergeMaps
(
GearsTest
.
sample2
,
m
)
ConfigUtils
.
mergeMaps
(
Map
(
...
...
@@ -82,6 +87,11 @@ abstract class GearsTest extends TestNGSuite with Matchers {
}
}
@AfterClass
def
removeDirs
:
Unit
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
class
GearsDefaultTest
extends
GearsTest
...
...
@@ -101,18 +111,21 @@ class GearsLibraryTest extends GearsTest {
}
object
GearsTest
{
val
outputDir
=
Files
.
createTempDir
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
outputDir
.
deleteOnExit
()
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
val
r1
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R1.fq"
)
val
r1
=
new
File
(
inputDir
,
"R1.fq"
)
Files
.
touch
(
r1
)
val
r2
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"R2.fq"
)
r1
.
deleteOnExit
()
val
r2
=
new
File
(
inputDir
,
"R2.fq"
)
Files
.
touch
(
r2
)
val
bam
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
"bamfile.bam"
)
r2
.
deleteOnExit
()
val
bam
=
new
File
(
inputDir
,
"bamfile.bam"
)
Files
.
touch
(
bam
)
bam
.
deleteOnExit
()
val
config
=
Map
(
def
config
(
outputDir
:
File
)
=
Map
(
"skip_write_dependencies"
->
true
,
"output_dir"
->
outputDir
,
"kraken"
->
Map
(
"exe"
->
"test"
,
"db"
->
"test"
),
...
...
gentrap/src/test/scala/nl/lumc/sasc/biopet/pipelines/gentrap/GentrapTest.scala
View file @
f4a5bd7a
...
...
@@ -14,21 +14,22 @@
*/
package
nl.lumc.sasc.biopet.pipelines.gentrap
import
java.io.
{
File
,
FileOutputStream
}
import
java.io.
{
File
,
FileOutputStream
}
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.core.
{
BiopetFifoPipe
,
BiopetPipe
}
import
nl.lumc.sasc.biopet.core.
{
BiopetFifoPipe
,
BiopetPipe
}
import
nl.lumc.sasc.biopet.extensions._
import
nl.lumc.sasc.biopet.extensions.gmap.Gsnap
import
nl.lumc.sasc.biopet.extensions.hisat.Hisat2
import
nl.lumc.sasc.biopet.extensions.tools.
{
BaseCounter
,
WipeReads
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
import
nl.lumc.sasc.biopet.extensions.tools.
{
BaseCounter
,
WipeReads
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
import
nl.lumc.sasc.biopet.utils.config.Config
import
nl.lumc.sasc.biopet.utils.camelize
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.
{
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
abstract
class
GentrapTestAbstract
(
val
expressionMeasures
:
List
[
String
])
extends
TestNGSuite
with
Matchers
{
...
...
@@ -58,11 +59,14 @@ abstract class GentrapTestAbstract(val expressionMeasures: List[String]) extends
}
yield
Array
(
strandProtocol
)
}
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"expMeasuresstrandProtocol"
)
def
testGentrap
(
strandProtocol
:
String
)
=
{
val
outputDir
=
GentrapTest
.
outputDir
dirs
:+=
outputDir
val
settings
=
Map
(
"output_dir"
->
GentrapTest
.
outputDir
,
"output_dir"
->
outputDir
,
"gsnap"
->
Map
(
"db"
->
"test"
,
"dir"
->
"test"
),
"expression_measures"
->
expressionMeasures
,
"strand_protocol"
->
strandProtocol
...
...
@@ -145,6 +149,10 @@ abstract class GentrapTestAbstract(val expressionMeasures: List[String]) extends
}
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
class
GentrapFragmentsPerGeneTest
extends
GentrapTestAbstract
(
List
(
"fragments_per_gene"
))
...
...
@@ -166,18 +174,18 @@ class GentrapCallVariantsTest extends GentrapTestAbstract(List("fragments_per_ge
}
object
GentrapTest
{
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
def
inputTouch
(
name
:
String
)
:
String
=
{
val
file
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
name
)
val
file
=
new
File
(
inputDir
,
name
)
Files
.
touch
(
file
)
file
.
getAbsolutePath
}
private
def
copyFile
(
name
:
String
)
:
Unit
=
{
val
is
=
getClass
.
getResourceAsStream
(
"/"
+
name
)
val
os
=
new
FileOutputStream
(
new
File
(
out
putDir
,
name
))
val
os
=
new
FileOutputStream
(
new
File
(
in
putDir
,
name
))
org
.
apache
.
commons
.
io
.
IOUtils
.
copy
(
is
,
os
)
os
.
close
()
}
...
...
@@ -188,12 +196,12 @@ object GentrapTest {
val
executables
:
Map
[
String
,
Any
]
=
Map
(
"skip_write_dependencies"
->
true
,
"reference_fasta"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"refFlat"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"annotation_gtf"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"annotation_bed"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"annotation_refflat"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"ribosome_refflat"
->
(
out
putDir
+
File
.
separator
+
"ref.fa"
),
"reference_fasta"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"refFlat"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"annotation_gtf"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"annotation_bed"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"annotation_refflat"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"ribosome_refflat"
->
(
in
putDir
+
File
.
separator
+
"ref.fa"
),
"varscan_jar"
->
"test"
,
"rscript"
->
Map
(
"exe"
->
"test"
),
"igvtools"
->
Map
(
"exe"
->
"test"
,
"igvtools_jar"
->
"test"
),
...
...
sage/src/test/scala/nl/lumc/sasc/biopet/pipelines/sage/SageTest.scala
View file @
f4a5bd7a
...
...
@@ -14,15 +14,16 @@
*/
package
nl.lumc.sasc.biopet.pipelines.sage
import
java.io.
{
File
,
FileOutputStream
}
import
java.io.
{
File
,
FileOutputStream
}
import
com.google.common.io.Files
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.apache.commons.io.FileUtils
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
/**
* Created by pjvanthof on 28/09/16.
...
...
@@ -53,10 +54,14 @@ class SageTest extends TestNGSuite with Matchers {
def
tagsLibrary
=
false
def
libraryCounts
:
Option
[
Boolean
]
=
None
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"sageOptions"
)
def
testSage
(
f
:
String
,
sample1
:
Boolean
,
sample2
:
Boolean
)
:
Unit
=
{
val
outputDir
=
SageTest
.
outputDir
dirs
:+=
outputDir
val
map
=
{
var
m
:
Map
[
String
,
Any
]
=
SageTest
.
config
var
m
:
Map
[
String
,
Any
]
=
SageTest
.
config
(
outputDir
)
if
(
sample1
)
m
=
ConfigUtils
.
mergeMaps
(
SageTest
.
sample1
,
m
)
if
(
sample2
)
m
=
ConfigUtils
.
mergeMaps
(
SageTest
.
sample2
,
m
)
ConfigUtils
.
mergeMaps
(
...
...
@@ -99,6 +104,11 @@ class SageTest extends TestNGSuite with Matchers {
}
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
class
SageNoBedTest
extends
SageTest
{
...
...
@@ -121,11 +131,11 @@ class SageLibraryCountsTest extends SageTest {
}
object
SageTest
{
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
new
File
(
outputDir
,
"input"
).
mkdirs
()
def
outputDir
=
Files
.
createTempDir
()
val
intputDir
=
Files
.
createTempDir
()
def
inputTouch
(
name
:
String
)
:
String
=
{
val
file
=
new
File
(
outputDir
,
"input"
+
File
.
separator
+
name
)
val
file
=
new
File
(
intputDir
,
name
)
Files
.
touch
(
file
)
file
.
getAbsolutePath
}
...
...
@@ -134,7 +144,7 @@ object SageTest {
private
def
copyFile
(
name
:
String
)
:
Unit
=
{
val
is
=
getClass
.
getResourceAsStream
(
"/"
+
name
)
val
os
=
new
FileOutputStream
(
new
File
(
ou
tputDir
,
name
))
val
os
=
new
FileOutputStream
(
new
File
(
in
tputDir
,
name
))
org
.
apache
.
commons
.
io
.
IOUtils
.
copy
(
is
,
os
)
os
.
close
()
}
...
...
@@ -143,9 +153,9 @@ object SageTest {
copyFile
(
"ref.dict"
)
copyFile
(
"ref.fa.fai"
)
val
config
:
Map
[
String
,
Any
]
=
Map
(
def
config
(
outputDir
:
File
)
:
Map
[
String
,
Any
]
=
Map
(
"skip_write_dependencies"
->
true
,
"reference_fasta"
->
(
ou
tputDir
+
File
.
separator
+
"ref.fa"
),
"reference_fasta"
->
(
in
tputDir
+
File
.
separator
+
"ref.fa"
),
"output_dir"
->
outputDir
.
getAbsolutePath
,
"fastqc"
->
Map
(
"exe"
->
"test"
),
"seqtk"
->
Map
(
"exe"
->
"test"
),
...
...
shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCallingTest.scala
View file @
f4a5bd7a
...
...
@@ -14,20 +14,21 @@
*/
package
nl.lumc.sasc.biopet.pipelines.shiva
import
java.io.
{
File
,
FileOutputStream
}
import
java.io.
{
File
,
FileOutputStream
}
import
java.nio.file.Paths
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.extensions.breakdancer.
{
BreakdancerCaller
,
BreakdancerConfig
,
BreakdancerVCF
}
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.
{
PindelCaller
,
PindelConfig
,
PindelVCF
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
import
nl.lumc.sasc.biopet.extensions.pindel.
{
PindelCaller
,
PindelConfig
,
PindelVCF
}
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
Logging
}
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.
{
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
DataProvider
,
Test
}
import
scala.collection.mutable.ListBuffer
...
...
@@ -37,15 +38,17 @@ import scala.collection.mutable.ListBuffer
* Created by pjvan_thof on 3/2/15.
*/
class
ShivaSvCallingTest
extends
TestNGSuite
with
Matchers
{
def
initPipeline
(
map
:
Map
[
String
,
Any
])
:
ShivaSvCalling
=
{