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
6075c248
Commit
6075c248
authored
Feb 16, 2015
by
Peter van 't Hof
Browse files
Added qscripts to final output file
parent
ebe2bb5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala
View file @
6075c248
package
nl.lumc.sasc.biopet.core.summary
import
java.io.
{
FileInputStream
,
PrintWriter
,
File
}
import
java.io.
{
FileInputStream
,
PrintWriter
,
File
}
import
java.security.MessageDigest
import
nl.lumc.sasc.biopet.core.config.Configurable
...
...
@@ -40,24 +40,27 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
}
def
run
()
:
Unit
=
{
val
writer
=
new
PrintWriter
(
out
)
val
bla
=
for
(((
name
,
sampleId
,
libraryId
),
summarizable
s
)
<-
summaryQScript
.
summarizables
;
summarizable
<-
summarizables
)
yield
{
val
map
=
(
for
(
((
name
,
sampleId
,
libraryId
),
summarizables
)
<-
summaryQScript
.
summarizables
;
summarizable
<-
summarizables
)
yield
{
val
map
=
Map
(
name
->
parseSummarizable
(
summarizable
))
(
sampleId
match
{
case
Some
(
sampleId
)
=>
Map
(
"samples"
->
Map
(
sampleId
->
(
libraryId
match
{
case
Some
(
libraryId
)
=>
Map
(
"libraries"
->
Map
(
libraryId
->
map
))
case
_
=>
map
case
_
=>
map
})))
case
_
=>
map
},
(
v1
:
Any
,
v2
:
Any
,
key
:
String
)
=>
summarizable
.
resolveSummaryConflict
(
v1
,
v2
,
key
))
}
bla
.
foldRight
(
Map
[
String
,
Any
]())((
a
,
b
)
=>
ConfigUtils
.
mergeMaps
(
a
.
_1
,
b
,
a
.
_2
))
},
(
v1
:
Any
,
v2
:
Any
,
key
:
String
)
=>
summarizable
.
resolveSummaryConflict
(
v1
,
v2
,
key
))
}).
foldRight
(
Map
[
String
,
Any
]())((
a
,
b
)
=>
ConfigUtils
.
mergeMaps
(
a
.
_1
,
b
,
a
.
_2
))
//TODO: QScript merging
val
combinedMap
=
(
for
(
qscript
<-
summaryQScript
.
summaryQScripts
)
yield
{
ConfigUtils
.
fileToConfigMap
(
qscript
.
summaryFile
)
}).
foldRight
(
map
)((
a
,
b
)
=>
ConfigUtils
.
mergeMaps
(
a
,
b
))
val
writer
=
new
PrintWriter
(
out
)
writer
.
println
(
ConfigUtils
.
mapToJson
(
combinedMap
).
spaces2
)
writer
.
close
()
}
...
...
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