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
0e2beeb1
Commit
0e2beeb1
authored
May 31, 2016
by
Peter van 't Hof
Browse files
Fixed tests
parent
175de69a
Changes
2
Hide whitespace changes
Inline
Side-by-side
gwas-test/src/test/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTestTest.scala
View file @
0e2beeb1
...
...
@@ -18,6 +18,7 @@ import java.io.File
import
java.nio.file.Paths
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.utils.Logging
import
nl.lumc.sasc.biopet.utils.config.Config
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
...
...
@@ -39,6 +40,7 @@ class GwasTestTest extends TestNGSuite with Matchers {
@Test
def
testFromVcf
:
Unit
=
{
Logging
.
errors
.
clear
()
val
pipeline
=
initPipeline
(
GwasTestTest
.
config
++
Map
(
"input_vcf"
->
GwasTestTest
.
vcfFile
.
toString
)
...
...
@@ -46,34 +48,6 @@ class GwasTestTest extends TestNGSuite with Matchers {
pipeline
.
script
()
}
@Test
def
testFromGens
:
Unit
=
{
val
pipeline
=
initPipeline
(
GwasTestTest
.
config
++
Map
(
"input_gens"
->
List
(
Map
(
"genotypes"
->
GwasTestTest
.
vcfFile
,
"contig"
->
"chrQ"
))
)
)
pipeline
.
script
()
}
@Test
def
testWrongContig
:
Unit
=
{
val
pipeline
=
initPipeline
(
GwasTestTest
.
config
++
Map
(
"input_gens"
->
List
(
Map
(
"genotypes"
->
GwasTestTest
.
vcfFile
,
"contig"
->
"chrBla"
))
)
)
intercept
[
IllegalStateException
]
{
pipeline
.
script
()
}
}
@Test
def
testFromSpecs
:
Unit
=
{
val
pipeline
=
initPipeline
(
GwasTestTest
.
config
++
Map
(
"imute_specs_file"
->
GwasTestTest
.
resourcePath
(
"/specs/files.specs"
))
)
pipeline
.
script
()
}
@Test
def
testEmpty
:
Unit
=
{
val
pipeline
=
initPipeline
(
GwasTestTest
.
config
)
...
...
@@ -101,8 +75,8 @@ object GwasTestTest {
}
val
config
=
Map
(
"reference_fasta"
->
GwasTestTest
.
reference
.
toString
,
"phenotype_file"
->
GwasTestTest
.
phenotypeFile
.
toString
,
"reference_fasta"
->
reference
.
toString
,
"phenotype_file"
->
phenotypeFile
.
toString
,
"output_dir"
->
outputDir
,
"snptest"
->
Map
(
"exe"
->
"test"
),
"md5sum"
->
Map
(
"exe"
->
"test"
),
...
...
gwas-test/src/test/scala/nl/lumc/sasc/biopet/pipelines/gwastest/impute/Impute2VcfTest.scala
0 → 100644
View file @
0e2beeb1
package
nl.lumc.sasc.biopet.pipelines.gwastest.impute
import
java.io.File
import
java.nio.file.Paths
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.utils.config.Config
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
/**
* Created by pjvan_thof on 31-5-16.
*/
class
Impute2VcfTest
extends
TestNGSuite
with
Matchers
{
def
initPipeline
(
map
:
Map
[
String
,
Any
])
:
Impute2Vcf
=
{
new
Impute2Vcf
{
override
def
configNamespace
=
"impute2vcf"
override
def
globalConfig
=
new
Config
(
map
)
qSettings
=
new
QSettings
qSettings
.
runName
=
"test"
}
}
@Test
def
testFromGens
:
Unit
=
{
val
pipeline
=
initPipeline
(
Impute2VcfTest
.
config
++
Map
(
"input_gens"
->
List
(
Map
(
"genotypes"
->
Impute2VcfTest
.
vcfFile
,
"contig"
->
"chrQ"
))
)
)
pipeline
.
script
()
}
@Test
def
testWrongContig
:
Unit
=
{
val
pipeline
=
initPipeline
(
Impute2VcfTest
.
config
++
Map
(
"input_gens"
->
List
(
Map
(
"genotypes"
->
Impute2VcfTest
.
vcfFile
,
"contig"
->
"chrBla"
))
)
)
intercept
[
IllegalStateException
]
{
pipeline
.
script
()
}
}
@Test
def
testFromSpecs
:
Unit
=
{
val
pipeline
=
initPipeline
(
Impute2VcfTest
.
config
++
Map
(
"imute_specs_file"
->
Impute2VcfTest
.
resourcePath
(
"/specs/files.specs"
))
)
pipeline
.
script
()
}
@Test
def
testEmpty
:
Unit
=
{
val
pipeline
=
initPipeline
(
Impute2VcfTest
.
config
)
intercept
[
IllegalArgumentException
]
{
pipeline
.
script
()
}
}
}
object
Impute2VcfTest
{
val
vcfFile
=
File
.
createTempFile
(
"gwas."
,
".vcf"
)
Files
.
touch
(
vcfFile
)
vcfFile
.
deleteOnExit
()
val
phenotypeFile
=
File
.
createTempFile
(
"gwas."
,
".txt"
)
phenotypeFile
.
deleteOnExit
()
val
outputDir
=
Files
.
createTempDir
()
outputDir
.
deleteOnExit
()
val
reference
=
new
File
(
resourcePath
(
"/fake_chrQ.fa"
))
private
def
resourcePath
(
p
:
String
)
:
String
=
{
Paths
.
get
(
getClass
.
getResource
(
p
).
toURI
).
toString
}
val
config
=
Map
(
"reference_fasta"
->
reference
.
toString
,
"phenotype_file"
->
phenotypeFile
.
toString
,
"output_dir"
->
outputDir
,
"md5sum"
->
Map
(
"exe"
->
"test"
),
"gatk_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