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
38b152be
Commit
38b152be
authored
Dec 06, 2016
by
Peter van 't Hof
Browse files
Fixing BIOPET-491
parent
21fa48ed
Changes
6
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/summary/Summarizable.scala
View file @
38b152be
...
...
@@ -42,4 +42,6 @@ trait Summarizable {
def
resolveSummaryConflict
(
v1
:
Any
,
v2
:
Any
,
key
:
String
)
:
Any
=
{
throw
new
IllegalStateException
(
"Merge can not have same key by default"
)
}
def
summaryDeps
:
List
[
File
]
=
Nil
}
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala
View file @
38b152be
...
...
@@ -56,13 +56,16 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
def
init
()
:
Unit
=
{
for
(
q
<-
qscript
.
summaryQScripts
)
deps
:+=
q
.
summaryFile
for
((
_
,
l
)
<-
qscript
.
summarizables
;
s
<-
l
)
s
match
{
case
f
:
QFunction
if
qscript.functions.contains
(
f
)
=>
try
{
deps
:+=
f
.
firstOutput
}
catch
{
case
e
:
NullPointerException
=>
logger
.
warn
(
"Queue values are not init"
)
for
((
_
,
l
)
<-
qscript
.
summarizables
;
s
<-
l
)
{
deps
:::=
s
.
summaryDeps
s
match
{
case
f
:
QFunction
if
qscript.functions.contains
(
f
)
=>
try
{
deps
:+=
f
.
firstOutput
}
catch
{
case
e
:
NullPointerException
=>
logger
.
warn
(
"Queue values are not init"
)
}
case
_
=>
}
case
_
=>
}
jobOutputFile
=
new
File
(
out
.
getParentFile
,
".%s.%s.out"
.
format
(
out
.
getName
,
analysisName
))
...
...
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Sickle.scala
View file @
38b152be
...
...
@@ -84,6 +84,8 @@ class Sickle(val root: Configurable) extends BiopetCommandLineFunction with Summ
(
if
(
outputAsStsout
)
""
else
" > "
+
required
(
outputStats
))
}
override
def
summaryDeps
=
outputStats
::
super
.
summaryDeps
/** returns stats map for summary */
def
summaryStats
:
Map
[
String
,
Any
]
=
{
// regex for single run
...
...
biopet-tools-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/FastqSync.scala
View file @
38b152be
...
...
@@ -94,6 +94,8 @@ class FastqSync(val root: Configurable) extends ToolCommandFunction with Summari
)
}
override
def
summaryDeps
=
outputStats
::
super
.
summaryDeps
override
def
resolveSummaryConflict
(
v1
:
Any
,
v2
:
Any
,
key
:
String
)
:
Any
=
{
(
v1
,
v2
)
match
{
case
(
v1
:
Int
,
v2
:
Int
)
=>
v1
+
v2
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
View file @
38b152be
...
...
@@ -14,12 +14,12 @@
*/
package
nl.lumc.sasc.biopet.pipelines.flexiprep
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.core.
{
BiopetFifoPipe
,
PipelineCommand
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.
{
Gzip
,
Zcat
}
import
nl.lumc.sasc.biopet.core.summary.
{
Summarizable
,
SummaryQScript
}
import
nl.lumc.sasc.biopet.core.
{
BiopetFifoPipe
,
PipelineCommand
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.
{
Gzip
,
Zcat
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.IoUtils._
import
nl.lumc.sasc.biopet.extensions.tools.
{
FastqSync
,
SeqStat
,
ValidateFastq
}
import
nl.lumc.sasc.biopet.extensions.tools.
{
FastqSync
,
SeqStat
,
ValidateFastq
}
import
nl.lumc.sasc.biopet.utils.Logging
import
org.broadinstitute.gatk.queue.QScript
...
...
@@ -206,8 +206,8 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
fqSync
.
outputFastq2
=
new
File
(
outDir
,
fastqR2Qc
.
get
.
getName
)
fqSync
.
outputStats
=
new
File
(
outDir
,
s
"${sampleId.getOrElse("
x
")}-${libId.getOrElse("
x
")}.sync.stats"
)
val
pipe
=
new
BiopetFifoPipe
(
this
,
fqSync
::
Nil
)
{
override
def
configNamespace
=
"qc
-
cmd"
val
pipe
=
new
BiopetFifoPipe
(
this
,
fqSync
::
Nil
)
with
Summarizable
{
override
def
configNamespace
=
"qc
_
cmd"
override
def
beforeGraph
()
:
Unit
=
{
fqSync
.
beforeGraph
()
...
...
@@ -223,11 +223,20 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
commands
.
foreach
(
addPipeJob
)
super
.
beforeCmd
()
}
/** Must return files to store into summary */
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
()
/** Must returns stats to store into summary */
def
summaryStats
:
Any
=
Map
()
override
def
summaryDeps
=
qcCmdR1
.
summaryDeps
:::
qcCmdR2
.
summaryDeps
:::
super
.
summaryDeps
}
pipe
.
deps
::=
fastqcR1
.
output
pipe
.
deps
::=
fastqcR2
.
output
pipe
.
isIntermediate
=
!
keepQcFastqFiles
addSummarizable
(
pipe
,
"qc_cmd"
)
add
(
pipe
)
addSummarizable
(
fqSync
,
"fastq_sync"
)
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/QcCommand.scala
View file @
38b152be
...
...
@@ -65,6 +65,8 @@ class QcCommand(val root: Configurable, val fastqc: Fastqc) extends BiopetComman
def
summaryStats
=
Map
()
override
def
summaryDeps
=
trim
.
map
(
_
.
summaryDeps
).
toList
.
flatten
:::
super
.
summaryDeps
override
def
addToQscriptSummary
(
qscript
:
SummaryQScript
,
name
:
String
)
:
Unit
=
{
clip
match
{
case
Some
(
job
)
=>
qscript
.
addSummarizable
(
job
,
s
"clipping_$read"
)
...
...
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