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
944b9af0
Commit
944b9af0
authored
Feb 03, 2015
by
Peter van 't Hof
Browse files
Added addMultisampleJobs method
parent
ebe731f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
View file @
944b9af0
...
...
@@ -26,7 +26,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Argument }
*/
trait
MultiSampleQScript
extends
BiopetQScript
{
@Argument
(
doc
=
"Only Sample"
,
shortName
=
"sample"
,
required
=
false
)
val
onlySample
:
List
[
String
]
=
Nil
private
val
onlySample
s
:
List
[
String
]
=
Nil
require
(
Config
.
global
.
map
.
contains
(
"samples"
),
"No Samples found in config"
)
...
...
@@ -94,7 +94,7 @@ trait MultiSampleQScript extends BiopetQScript {
protected
def
addJobs
()
/** function add all libraries in one call */
protected
final
def
addLib
s
Jobs
()
:
Unit
=
{
protected
final
def
add
Per
LibJobs
()
:
Unit
=
{
for
((
libraryId
,
library
)
<-
libraries
)
{
library
.
addAndTrackJobs
()
}
...
...
@@ -128,14 +128,21 @@ trait MultiSampleQScript extends BiopetQScript {
protected
def
sampleIds
:
Set
[
String
]
=
ConfigUtils
.
any2map
(
Config
.
global
.
map
(
"samples"
)).
keySet
/** Runs addAndTrackJobs method for each sample */
final
def
addSamplesJobs
()
{
if
(
onlySample
.
isEmpty
)
samples
.
foreach
{
case
(
sampleId
,
sample
)
=>
sample
.
addAndTrackJobs
()
}
else
onlySample
.
foreach
(
sampleId
=>
samples
.
get
(
sampleId
)
match
{
final
def
addPerSampleJobs
()
{
if
(
onlySamples
.
isEmpty
)
{
samples
.
foreach
{
case
(
sampleId
,
sample
)
=>
sample
.
addAndTrackJobs
()
}
addMultiSampleJobs
()
}
else
onlySamples
.
foreach
(
sampleId
=>
samples
.
get
(
sampleId
)
match
{
case
Some
(
sample
)
=>
sample
.
addAndTrackJobs
()
case
None
=>
logger
.
warn
(
"sampleId '"
+
sampleId
+
"' not found"
)
})
}
/**
* Method where the multisample jobs should be added, this will be executed only when running the -sample argument is not given
*/
def
addMultiSampleJobs
()
/** Stores sample state */
private
var
currentSample
:
Option
[
String
]
=
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