Skip to content
GitLab
Menu
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
b3adee75
Commit
b3adee75
authored
Mar 02, 2017
by
Peter van 't Hof
Browse files
Fixed Kopisu unit tests
parent
9b7654c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/extensions/PythonCommandLineFunction.scala
View file @
b3adee75
...
...
@@ -14,9 +14,10 @@
*/
package
nl.lumc.sasc.biopet.core.extensions
import
java.io.
{
File
,
FileOutputStream
}
import
java.io.
{
File
,
FileOutputStream
}
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
nl.lumc.sasc.biopet.utils.Logging
import
org.broadinstitute.gatk.utils.commandline.Input
trait
PythonCommandLineFunction
extends
BiopetCommandLineFunction
{
...
...
@@ -50,9 +51,11 @@ trait PythonCommandLineFunction extends BiopetCommandLineFunction {
pythonScript
=
new
File
(
".queue/tmp/"
+
subpackage
+
pythonScriptName
)
if
(!
pythonScript
.
getParentFile
.
exists
)
pythonScript
.
getParentFile
.
mkdirs
val
is
=
getClass
.
getResourceAsStream
(
subpackage
+
pythonScriptName
)
val
os
=
new
FileOutputStream
(
pythonScript
)
org
.
apache
.
commons
.
io
.
IOUtils
.
copy
(
is
,
os
)
os
.
close
()
if
(
is
!=
null
)
{
val
os
=
new
FileOutputStream
(
pythonScript
)
org
.
apache
.
commons
.
io
.
IOUtils
.
copy
(
is
,
os
)
os
.
close
()
}
else
Logging
.
addError
(
s
"Python script not found: $pythonScriptName"
)
}
/** return basic command to prefix the complete command with */
...
...
kopisu/src/test/scala/nl/lumc/sasc/biopet/pipelines/kopisu/KopisuTest.scala
View file @
b3adee75
...
...
@@ -34,10 +34,11 @@ import scala.collection.mutable.ListBuffer
* Created by pjvan_thof on 3/2/15.
*/
class
KopisuTest
extends
TestNGSuite
with
Matchers
{
def
initPipeline
(
map
:
Map
[
String
,
Any
],
outputD
ir
:
File
)
:
Kopisu
=
{
def
initPipeline
(
map
:
Map
[
String
,
Any
],
d
ir
:
File
)
:
Kopisu
=
{
new
Kopisu
()
{
override
def
configNamespace
=
"kopisu"
override
def
globalConfig
=
new
Config
(
ConfigUtils
.
mergeMaps
(
map
,
KopisuTest
.
config
(
outputDir
)))
override
def
globalConfig
=
new
Config
(
ConfigUtils
.
mergeMaps
(
map
,
KopisuTest
.
config
(
dir
)))
outputDir
=
dir
qSettings
=
new
QSettings
qSettings
.
runName
=
"test"
}
...
...
@@ -121,6 +122,9 @@ object KopisuTest {
val
controlDir
=
Files
.
createTempDir
()
Files
.
touch
(
new
File
(
controlDir
,
"test.txt"
))
val
coniferScript
=
File
.
createTempFile
(
"conifer."
,
".py"
)
coniferScript
.
deleteOnExit
()
def
config
(
outputDir
:
File
)
=
Map
(
"skip_write_dependencies"
->
true
,
"name_prefix"
->
"test"
,
...
...
@@ -133,7 +137,7 @@ object KopisuTest {
"tabix"
->
Map
(
"exe"
->
"test"
),
"freec"
->
Map
(
"exe"
->
"test"
,
"chrFiles"
->
"test"
,
"chrLenFile"
->
"test"
),
"controls_dir"
->
controlDir
.
getAbsolutePath
,
"conifer"
->
Map
(
"script"
->
"/usr/bin/test"
),
"conifer"
->
Map
(
"script"
->
coniferScript
.
getAbsolutePath
),
"probe_file"
->
"test"
,
"rscript"
->
Map
(
"exe"
->
"test"
)
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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