Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
027a6ff3
Commit
027a6ff3
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Separated multisample functions to an other class
parent
c22acb87
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
+43
-0
43 additions, 0 deletions
...n/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
with
43 additions
and
0 deletions
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
0 → 100644
+
43
−
0
View file @
027a6ff3
package
nl.lumc.sasc.biopet.core
import
java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
trait
MultiSampleQScript
extends
BiopetQScript
{
var
samples
:
Map
[
String
,
Any
]
=
Map
()
final
def
runSamplesJobs
:
Map
[
String
,
Map
[
String
,
File
]]
=
{
var
output
:
Map
[
String
,
Map
[
String
,
File
]]
=
Map
()
samples
=
config
(
"samples"
)
if
(
globalConfig
.
contains
(
"samples"
))
for
((
key
,
value
)
<-
samples
)
{
var
sample
=
Configurable
.
any2map
(
value
)
if
(!
sample
.
contains
(
"ID"
))
sample
+=
(
"ID"
->
key
)
if
(
sample
(
"ID"
)
==
key
)
{
var
files
:
Map
[
String
,
List
[
File
]]
=
runSingleSampleJobs
(
sample
)
}
else
logger
.
warn
(
"Key is not the same as ID on value for sample"
)
}
else
logger
.
warn
(
"No Samples found in config"
)
return
output
}
def
runSingleSampleJobs
(
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
List
[
File
]]
def
runSingleSampleJobs
(
sample
:
String
)
:
Map
[
String
,
List
[
File
]]
={
return
runSingleSampleJobs
(
Configurable
.
any2map
(
samples
(
sample
)))
}
final
def
runRunsJobs
(
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
Map
[
String
,
File
]]
=
{
var
output
:
Map
[
String
,
Map
[
String
,
File
]]
=
Map
()
val
sampleID
=
sampleConfig
(
"ID"
)
if
(
sampleConfig
.
contains
(
"runs"
))
{
val
runs
=
Configurable
.
any2map
(
sampleConfig
(
"runs"
))
for
((
key
,
value
)
<-
runs
)
{
var
run
=
Configurable
.
any2map
(
value
)
if
(!
run
.
contains
(
"ID"
))
run
+=
(
"ID"
->
key
)
if
(
run
(
"ID"
)
==
key
)
{
output
+=
key
->
runSingleRunJobs
(
run
,
sampleConfig
)
}
else
logger
.
warn
(
"Key is not the same as ID on value for run of sample: "
+
sampleID
)
}
}
else
logger
.
warn
(
"No runs found in config for sample: "
+
sampleID
)
return
output
}
def
runSingleRunJobs
(
runConfig
:
Map
[
String
,
Any
],
sampleConfig
:
Map
[
String
,
Any
])
:
Map
[
String
,
File
]
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment