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
a386583c
Commit
a386583c
authored
Sep 10, 2015
by
Peter van 't Hof
Browse files
Added -o option
parent
cb3dfee1
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/SummaryToTsv.scala
View file @
a386583c
...
...
@@ -15,7 +15,7 @@
*/
package
nl.lumc.sasc.biopet.tools
import
java.io.File
import
java.io.
{
PrintWriter
,
File
}
import
java.nio.file.Paths
import
nl.lumc.sasc.biopet.core.ToolCommand
...
...
@@ -36,6 +36,9 @@ object SummaryToTsv extends ToolCommand {
opt
[
File
](
's'
,
"summary"
)
required
()
unbounded
()
maxOccurs
1
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
summary
=
x
)
}
opt
[
File
](
'o'
,
"outputFile"
)
unbounded
()
maxOccurs
1
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
outputFile
=
Some
(
x
))
}
opt
[
String
](
'p'
,
"path"
)
required
()
unbounded
()
valueName
"<string>"
action
{
(
x
,
c
)
=>
c
.
copy
(
values
=
c
.
values
:::
x
::
Nil
)
}
text
...
...
@@ -70,10 +73,19 @@ object SummaryToTsv extends ToolCommand {
val
values
=
fetchValues
(
summary
,
paths
,
sample
=
cmdArgs
.
mode
==
"sample"
,
lib
=
cmdArgs
.
mode
==
"lib"
)
println
(
createHeader
(
paths
))
for
(
lineId
<-
values
.
head
.
_2
.
keys
)
{
println
(
createLine
(
paths
,
values
,
lineId
))
cmdArgs
.
outputFile
match
{
case
Some
(
file
)
=>
{
val
writer
=
new
PrintWriter
(
file
)
writer
.
println
(
createHeader
(
paths
))
for
(
lineId
<-
values
.
head
.
_2
.
keys
)
writer
.
println
(
createLine
(
paths
,
values
,
lineId
))
writer
.
close
()
}
case
_
=>
{
println
(
createHeader
(
paths
))
for
(
lineId
<-
values
.
head
.
_2
.
keys
)
println
(
createLine
(
paths
,
values
,
lineId
))
}
}
}
...
...
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