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
b2da50cb
Commit
b2da50cb
authored
Feb 05, 2015
by
Wai Yi Leung
Browse files
Making the output files Option[File], and use Some() to verify whether it was set or not
parent
92fd93df
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/igvtools/IGVToolsCount.scala
View file @
b2da50cb
...
...
@@ -20,10 +20,10 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
var
genomeChromSizes
:
File
=
_
@Output
protected
var
tdf
:
File
=
_
protected
var
tdf
:
Option
[
File
]
=
_
@Output
protected
var
wig
:
File
=
_
protected
var
wig
:
Option
[
File
]
=
_
var
maxZoom
:
Option
[
Int
]
=
config
(
"maxZoom"
)
var
windowSize
:
Option
[
Int
]
=
config
(
"windowSize"
)
...
...
@@ -46,8 +46,8 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
super
.
afterGraph
if
(!
input
.
exists
())
throw
new
FileNotFoundException
(
"Input bam is required for IGVToolsCount"
)
this
.
tdf
=
new
File
(
input
.
getAbsolutePath
+
".tdf"
)
this
.
wig
=
new
File
(
input
.
getAbsolutePath
.
stripSuffix
(
".bam"
)
+
".wig"
)
this
.
tdf
=
Some
(
new
File
(
input
.
getAbsolutePath
+
".tdf"
)
)
this
.
wig
=
Some
(
new
File
(
input
.
getAbsolutePath
.
stripSuffix
(
".bam"
)
+
".wig"
)
)
}
def
cmdLine
=
{
...
...
@@ -72,14 +72,14 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
/**
* This part should never fail, these values are set within this wrapper
*
*
*/
private
def
outputArg
:
String
=
{
(
tdf
.
isInstanceOf
[
File
],
wig
.
isInstanceOf
[
File
]
)
match
{
case
(
false
,
false
)
=>
throw
new
IllegalArgumentException
(
"Either TDF or WIG should be supplied"
);
case
(
true
,
fals
e
)
=>
tdf
.
getAbsolutePath
;
case
(
false
,
true
)
=>
wig
.
getAbsolutePath
;
case
(
true
,
true
)
=>
tdf
.
getAbsolutePath
+
","
+
wig
.
getAbsolutePath
;
(
tdf
,
wig
)
match
{
case
(
None
,
None
)
=>
throw
new
IllegalArgumentException
(
"Either TDF or WIG should be supplied"
);
case
(
Some
(
a
),
Non
e
)
=>
a
.
getAbsolutePath
;
case
(
None
,
Some
(
b
))
=>
b
.
getAbsolutePath
;
case
(
Some
(
a
),
Some
(
b
))
=>
a
.
getAbsolutePath
+
","
+
b
.
getAbsolutePath
;
}
}
}
...
...
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