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
25aaee6e
Commit
25aaee6e
authored
Apr 08, 2015
by
bow
Browse files
Try to convert numeric values appropriately in Picard metrics parsing
parent
4abb761f
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/CollectAlignmentSummaryMetrics.scala
View file @
25aaee6e
...
...
@@ -70,7 +70,7 @@ class CollectAlignmentSummaryMetrics(val root: Configurable) extends Picard with
case
None
=>
Map
()
case
Some
((
header
,
content
))
=>
(
for
(
category
<-
0
until
content
.
size
)
yield
{
content
(
category
)(
0
)
->
(
content
(
category
)(
0
)
.
toString
->
(
for
(
i
<-
1
until
header
.
size
if
i
<
content
(
category
).
size
)
yield
{
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/MarkDuplicates.scala
View file @
25aaee6e
...
...
@@ -103,7 +103,7 @@ class MarkDuplicates(val root: Configurable) extends Picard with Summarizable {
case
None
=>
Map
()
case
Some
((
header
,
content
))
=>
(
for
(
category
<-
0
until
content
.
size
)
yield
{
content
(
category
)(
0
)
->
(
content
(
category
)(
0
)
.
toString
->
(
for
(
i
<-
1
until
header
.
size
if
i
<
content
(
category
).
size
)
yield
{
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/Picard.scala
View file @
25aaee6e
...
...
@@ -21,6 +21,7 @@ import scala.io.Source
import
org.broadinstitute.gatk.utils.commandline.Argument
import
nl.lumc.sasc.biopet.core.BiopetJavaCommandLineFunction
import
nl.lumc.sasc.biopet.utils.tryToParseNumber
/**
* General picard extension
...
...
@@ -80,7 +81,7 @@ object Picard {
* @param file input metrics file
* @return (header, content)
*/
def
getMetrics
(
file
:
File
)
:
Option
[(
Array
[
String
]
,
List
[
Array
[
String
]])]
=
def
getMetrics
(
file
:
File
)
:
Option
[(
Array
[
String
]
,
List
[
Array
[
Any
]])]
=
if
(
file
.
exists
)
{
val
lines
=
Source
.
fromFile
(
file
).
getLines
().
toArray
...
...
@@ -88,9 +89,10 @@ object Picard {
val
end
=
lines
.
indexOf
(
""
,
start
)
val
header
=
lines
(
start
).
split
(
"\t"
)
val
content
=
(
for
(
i
<-
(
start
+
1
)
until
end
)
yield
lines
(
i
).
split
(
"\t"
)).
toList
val
content
=
(
for
(
i
<-
(
start
+
1
)
until
end
)
yield
lines
(
i
).
split
(
"\t"
))
.
map
(
row
=>
row
.
map
(
col
=>
tryToParseNumber
(
col
).
getOrElse
(
col
)))
Option
((
header
,
content
))
Option
((
header
,
content
.
toList
))
}
else
{
None
}
...
...
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