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
dcdcb3b5
Commit
dcdcb3b5
authored
Mar 01, 2016
by
Sander Bollen
Browse files
do not put header in resulting map agian
parent
06b90a21
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictor.scala
View file @
dcdcb3b5
...
...
@@ -271,7 +271,7 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
def
parseStatsFile
(
file
:
File
)
:
Map
[
String
,
Any
]
=
{
val
contents
=
Source
.
fromFile
(
file
).
getLines
().
toList
val
headers
=
getHeadersFromStatsFile
(
contents
)
headers
.
foldLeft
(
Map
.
empty
[
String
,
Any
])((
acc
,
x
)
=>
acc
+
(
x
->
getBlockFromStatsFile
(
contents
,
x
)))
headers
.
foldLeft
(
Map
.
empty
[
String
,
Any
])((
acc
,
x
)
=>
acc
+
(
x
.
replace
(
" "
,
"_"
)
->
getBlockFromStatsFile
(
contents
,
x
)))
}
def
getBlockFromStatsFile
(
contents
:
List
[
String
],
header
:
String
)
:
Map
[
String
,
Any
]
=
{
...
...
@@ -281,17 +281,17 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
val
stripped
=
x
.
stripPrefix
(
"["
).
stripSuffix
(
"]"
)
if
(
stripped
==
header
)
{
inBlock
=
true
}
else
{
if
(
inBlock
)
{
val
key
=
stripped
.
split
(
'\t'
).
head
.
replace
(
" "
,
"_"
)
val
value
=
stripped
.
split
(
'\t'
).
last
theMap
++=
Map
(
key
->
value
)
}
}
if
(
stripped
==
""
)
{
inBlock
=
false
}
if
(
inBlock
)
{
val
key
=
stripped
.
split
(
'\t'
).
head
.
replace
(
" "
,
"_"
)
val
value
=
stripped
.
split
(
'\t'
).
last
theMap
++=
Map
(
key
->
value
)
}
}
theMap
}
...
...
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