Skip to content
GitLab
Menu
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
ddc06b36
Commit
ddc06b36
authored
Apr 25, 2017
by
Peter van 't Hof
Browse files
Adding sample and library to summary when flexiprep is executed
parent
e9a7187e
Changes
1
Hide whitespace changes
Inline
Side-by-side
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala
View file @
ddc06b36
...
...
@@ -16,12 +16,18 @@ package nl.lumc.sasc.biopet.pipelines.gears
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.core.BiopetQScript.InputFile
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.
{
Gzip
,
Zcat
}
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.
{
Gzip
,
Zcat
}
import
nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep
import
nl.lumc.sasc.biopet.utils.Logging
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.
{
SampleId
,
SampleName
}
import
org.broadinstitute.gatk.queue.QScript
import
sun.security.provider.JavaKeyStore.DualFormatJKS
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
/**
* Created by wyleung
...
...
@@ -55,6 +61,13 @@ class GearsSingle(val parent: Configurable) extends QScript with SummaryQScript
if
(
fastqR2
.
nonEmpty
&&
fastqR1
.
size
!=
fastqR2
.
size
)
Logging
.
addError
(
"R1 and R2 has not the same number of files"
)
if
(
sampleId
==
null
||
sampleId
==
None
)
Logging
.
addError
(
"Missing sample ID on GearsSingle module"
)
if
(!
skipFlexiprep
)
{
val
db
=
SummaryDb
.
openSqliteSummary
(
summaryDbFile
)
val
sample
=
Await
.
result
(
db
.
getSamples
(
runId
=
summaryRunId
,
name
=
sampleId
).
map
(
_
.
headOption
),
Duration
.
Inf
)
val
sId
=
sample
.
map
(
_
.
id
).
getOrElse
(
Await
.
result
(
db
.
createSample
(
sampleId
.
getOrElse
(
"noSample"
),
summaryRunId
),
Duration
.
Inf
))
val
library
=
Await
.
result
(
db
.
getLibraries
(
runId
=
summaryRunId
,
name
=
libId
,
sampleId
=
Some
(
sId
)).
map
(
_
.
headOption
),
Duration
.
Inf
)
val
lId
=
library
.
map
(
_
.
id
).
getOrElse
(
Await
.
result
(
db
.
createLibrary
(
libId
.
getOrElse
(
"noLib"
),
summaryRunId
,
sId
),
Duration
.
Inf
))
}
if
(
outputName
==
null
)
{
outputName
=
sampleId
.
getOrElse
(
"noName"
)
+
libId
.
map
(
"-"
+
_
).
getOrElse
(
""
)
}
...
...
Write
Preview
Supports
Markdown
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