Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mirrors
biopet.biopet
Commits
dcdcb3b5
Commit
dcdcb3b5
authored
Mar 01, 2016
by
Sander Bollen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not put header in resulting map agian
parent
06b90a21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictor.scala
.../lumc/sasc/biopet/extensions/VariantEffectPredictor.scala
+8
-8
No files found.
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
Markdown
is supported
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