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
7bea0e95
Commit
7bea0e95
authored
Jan 05, 2016
by
Sander Bollen
Browse files
manwe wrapper fixes
parent
f632d128
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/ManweActivateAfterAnnotImport.scala
View file @
7bea0e95
package
nl.lumc.sasc.biopet.pipelines.toucan
import
java.io.File
import
nl.lumc.sasc.biopet.extensions.manwe.
{
ManweAnnotateVcf
,
ManweSamplesActivate
,
ManweSamplesImport
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
...
...
@@ -24,13 +26,39 @@ class ManweActivateAfterAnnotImport(root: Configurable,
override
def
beforeCmd
:
Unit
=
{
super
.
beforeCmd
if
(
imported
.
output
.
exists
())
{
val
reader
=
Source
.
fromFile
(
imported
.
output
)
this
.
uri
=
reader
.
getLines
().
toList
.
head
.
split
(
' '
).
last
reader
.
close
()
this
.
uri
=
getUri
}
def
getUriFromFile
(
f
:
File
)
:
String
=
{
val
r
=
if
(
f
.
exists
())
{
val
reader
=
Source
.
fromFile
(
f
)
val
it
=
reader
.
getLines
()
if
(
it
.
isEmpty
)
{
throw
new
IllegalArgumentException
(
"Empty manwe stderr file"
)
}
it
.
filter
(
_
.
contains
(
"Added sample"
)).
toList
.
head
.
split
(
" "
).
last
}
else
{
this
.
uri
=
""
""
}
r
}
def
getUri
:
String
=
{
val
err
:
Option
[
File
]
=
Some
(
imported
.
jobOutputFile
)
uri
=
err
match
{
case
None
=>
""
case
Some
(
s
)
=>
s
match
{
case
null
=>
""
case
other
=>
getUriFromFile
(
other
)
}
case
_
=>
""
}
uri
}
override
def
subCommand
=
{
required
(
"samples"
)
+
required
(
"activate"
)
+
getUri
}
}
public/toucan/src/main/scala/nl/lumc/sasc/biopet/pipelines/toucan/ManweDownloadAfterAnnotate.scala
View file @
7bea0e95
...
...
@@ -22,13 +22,39 @@ class ManweDownloadAfterAnnotate(root: Configurable,
override
def
beforeCmd
:
Unit
=
{
super
.
beforeCmd
if
(
annotate
.
output
.
exists
())
{
val
reader
=
Source
.
fromFile
(
annotate
.
output
)
this
.
uri
=
reader
.
getLines
().
toList
.
head
.
split
(
' '
).
last
reader
.
close
()
this
.
uri
=
getUri
}
def
getUriFromFile
(
f
:
File
)
:
String
=
{
val
r
=
if
(
f
.
exists
())
{
val
reader
=
Source
.
fromFile
(
f
)
val
it
=
reader
.
getLines
()
if
(
it
.
isEmpty
)
{
throw
new
IllegalArgumentException
(
"Empty manwe stderr file"
)
}
it
.
filter
(
_
.
contains
(
"Annotated VCF file"
)).
toList
.
head
.
split
(
" "
).
last
}
else
{
this
.
uri
=
""
""
}
r
}
def
getUri
:
String
=
{
val
err
:
Option
[
File
]
=
Some
(
annotate
.
jobOutputFile
)
uri
=
err
match
{
case
None
=>
""
case
Some
(
s
)
=>
s
match
{
case
null
=>
""
case
other
=>
getUriFromFile
(
other
)
}
case
_
=>
""
}
uri
}
override
def
subCommand
=
{
required
(
"data-sources"
)
+
required
(
"download"
)
+
getUri
}
}
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