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
5d39aa90
Commit
5d39aa90
authored
Oct 12, 2016
by
Sander Bollen
Browse files
use Option[File] for output dir in stead of String
parent
ceb905da
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Cnmops.scala
View file @
5d39aa90
...
...
@@ -43,28 +43,34 @@ class Cnmops(val root: Configurable) extends RscriptCommandLineFunction {
// output files, computed automatically from output directory
@Output
(
doc
=
"Output CNV file"
)
lazy
val
outputCnv
:
File
=
{
require
(!
outputDir
.
isEmpty
,
"Unexpected error when trying to set cn.MOPS CNV output"
)
new
File
(
outputDir
,
"cnv.txt"
)
outputDir
match
{
case
Some
(
dir
)
if
dir
.
exists
=>
new
File
(
dir
,
"cnv.txt"
)
case
_
=>
throw
new
IllegalArgumentException
(
"Unexpected error when trying to set cn.MOPS CNV output"
)
}
}
@Output
(
doc
=
"Output CNR file"
)
lazy
val
outputCnr
:
File
=
{
require
(!
outputDir
.
isEmpty
,
"Unexpected error when trying to set cn.MOPS CNR output"
)
new
File
(
outputDir
,
"cnr.txt"
)
outputDir
match
{
case
Some
(
dir
)
if
dir
.
exists
=>
new
File
(
dir
,
"cnr.txt"
)
case
_
=>
throw
new
IllegalArgumentException
(
"Unexpected error when trying to set cn.MOPS CNR output"
)
}
}
@Output
(
doc
=
"Raw output"
)
lazy
val
rawOutput
:
File
=
{
require
(!
outputDir
.
isEmpty
,
"Unexpected error when trying to set cn.MOPS raw output"
)
new
File
(
outputDir
,
"rawoutput.txt"
)
outputDir
match
{
case
Some
(
dir
)
if
dir
.
exists
=>
new
File
(
dir
,
"rawoutput.txt"
)
case
_
=>
throw
new
IllegalArgumentException
(
"Unexpected error when trying to set cn.MOPS raw output"
)
}
}
/** write all output files to this directory [./] */
var
outputDir
:
String
=
_
var
outputDir
:
Option
[
File
]
=
None
override
def
beforeGraph
=
{
super
.
beforeGraph
require
(
!
outputDir
.
is
Empty
,
"Outputdir for cn.MOPS should not be empty"
)
require
(
outputDir
.
is
Defined
,
"Outputdir for cn.MOPS should not be empty"
)
require
(
input
.
length
>=
2
,
"Please supply at least 2 BAM files for cn.MOPS"
)
}
...
...
kopisu/src/main/scala/nl/lumc/sasc/biopet/pipelines/kopisu/methods/CnmopsMethod.scala
View file @
5d39aa90
...
...
@@ -27,7 +27,7 @@ class CnmopsMethod(val root: Configurable) extends CnvMethod {
case
(
sampleName
,
bamFile
)
=>
Some
(
bamFile
)
case
_
=>
None
}.
toList
cnmops
.
outputDir
=
new
File
(
outputDir
,
contig
.
getSequenceName
)
.
getAbsolutePath
cnmops
.
outputDir
=
Some
(
new
File
(
outputDir
,
contig
.
getSequenceName
)
)
cnmops
.
beforeGraph
cnmops
}).
toList
...
...
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