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
bbaa6236
Commit
bbaa6236
authored
10 years ago
by
bow
Browse files
Options
Downloads
Patches
Plain Diff
Add per-library RNA metrics job when the sample contains more than 1 library
parent
77e40ed5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala
+31
-16
31 additions, 16 deletions
...scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala
with
31 additions
and
16 deletions
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala
+
31
−
16
View file @
bbaa6236
...
...
@@ -279,6 +279,24 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
job
}
/** General function to create CollectRnaSeqMetrics job, for per-sample and per-library runs */
protected
def
makeCollectRnaSeqMetricsJob
(
alnFile
:
File
,
outMetrics
:
File
,
outChart
:
Option
[
File
]
=
None
)
:
CollectRnaSeqMetrics
=
{
val
job
=
new
CollectRnaSeqMetrics
(
qscript
)
job
.
input
=
alnFile
job
.
output
=
outMetrics
job
.
refFlat
=
annotationRefFlat
job
.
chartOutput
=
outChart
job
.
assumeSorted
=
true
job
.
strandSpecificity
=
strandProtocol
match
{
case
NonSpecific
=>
Option
(
StrandSpecificity
.
NONE
.
toString
)
case
Dutp
=>
Option
(
StrandSpecificity
.
SECOND_READ_TRANSCRIPTION_STRAND
.
toString
)
case
_
=>
throw
new
IllegalStateException
}
job
.
ribosomalIntervals
=
ribosomalRefFlat
job
}
/** Steps to run before biopetScript */
def
init
()
:
Unit
=
{
// TODO: validate that exons are flattened or not (depending on another option flag?)
...
...
@@ -338,7 +356,6 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
/** Summary files of the sample */
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
(
"alignment"
->
alnFile
,
"metrics"
->
collectRnaSeqMetricsJob
.
output
)
++
Map
(
"gene_fragments_count"
->
geneFragmentsCount
,
"exon_fragments_count"
->
exonFragmentsCount
,
...
...
@@ -621,21 +638,8 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
}
/** Picard CollectRnaSeqMetrics job */
private
def
collectRnaSeqMetricsJob
:
CollectRnaSeqMetrics
=
{
val
job
=
new
CollectRnaSeqMetrics
(
qscript
)
job
.
input
=
alnFile
job
.
output
=
createFile
(
".rna_metrics"
)
job
.
refFlat
=
annotationRefFlat
job
.
chartOutput
=
Option
(
createFile
(
".coverage_bias.pdf"
))
job
.
assumeSorted
=
true
job
.
strandSpecificity
=
strandProtocol
match
{
case
NonSpecific
=>
Option
(
StrandSpecificity
.
NONE
.
toString
)
case
Dutp
=>
Option
(
StrandSpecificity
.
SECOND_READ_TRANSCRIPTION_STRAND
.
toString
)
case
_
=>
throw
new
IllegalStateException
}
job
.
ribosomalIntervals
=
ribosomalRefFlat
job
}
private
lazy
val
collectRnaSeqMetricsJob
:
CollectRnaSeqMetrics
=
makeCollectRnaSeqMetricsJob
(
alnFile
,
createFile
(
".rna_metrics"
),
Option
(
createFile
(
".coverage_bias.pdf"
)))
private
def
wipeJob
:
Option
[
WipeReads
]
=
removeRibosomalReads
.
option
{
...
...
@@ -732,6 +736,12 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
/** Alignment results of this library ~ can only be accessed after addJobs is run! */
def
alnFile
:
File
=
mappingJob
.
outputFiles
(
"finalBamFile"
)
/** Library-level RNA-seq metrics job, only when we have more than 1 library in the sample */
def
collectRnaSeqMetricsJob
:
Option
[
CollectRnaSeqMetrics
]
=
(
Sample
.
this
.
libraries
.
size
>
1
)
.
option
{
makeCollectRnaSeqMetricsJob
(
alnFile
,
createFile
(
".rna_metrics"
),
Option
(
createFile
(
".coverage_bias.pdf"
)))
}
/** Per-library mapping job */
def
mappingJob
:
Mapping
=
{
val
job
=
new
Mapping
(
qscript
)
...
...
@@ -748,6 +758,11 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
def
addJobs
()
:
Unit
=
{
// create per-library alignment file
addAll
(
mappingJob
.
functions
)
// create RNA metrics job, if defined
collectRnaSeqMetricsJob
match
{
case
Some
(
j
)
=>
add
(
j
);
addSummarizable
(
j
,
"rna_metrics"
)
case
None
=>
;
}
qscript
.
addSummaryQScript
(
mappingJob
)
}
...
...
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