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
03c15ef3
Commit
03c15ef3
authored
Dec 29, 2015
by
Peter van 't Hof
Browse files
Added combine reads for GearsSingle
parent
ca7bba56
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/CombineReads.scala
View file @
03c15ef3
...
...
@@ -2,7 +2,8 @@ package nl.lumc.sasc.biopet.pipelines.gears
import
nl.lumc.sasc.biopet.core.SampleLibraryTag
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.extensions.Flash
import
nl.lumc.sasc.biopet.extensions.
{
Cutadapt
,
Flash
}
import
nl.lumc.sasc.biopet.pipelines.flexiprep.Fastqc
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.queue.QScript
...
...
@@ -15,18 +16,59 @@ class CombineReads(val root: Configurable) extends QScript with SummaryQScript w
@Input
(
doc
=
"R2 reads in FastQ format"
,
shortName
=
"R2"
,
required
=
false
)
var
fastqR2
:
File
=
_
override
def
fixedValues
=
Map
(
"flash"
->
Map
(
"compress"
->
true
))
/** Init for pipeline */
def
init
()
:
Unit
=
{
}
private
lazy
val
flash
=
new
Flash
(
this
)
private
lazy
val
forwardPrimers
:
List
[
String
]
=
config
(
"forward_primers"
)
private
lazy
val
reversePrimers
:
List
[
String
]
=
config
(
"reverse_primers"
)
def
combinedFastq
:
File
=
if
((
forwardPrimers
::
reversePrimers
).
nonEmpty
)
swapExt
(
outputDir
,
flash
.
combinedFastq
,
".fastq.gz"
,
".clip.fastq.gz"
)
else
flash
.
combinedFastq
def
notCombinedR1Fastq
:
File
=
if
((
forwardPrimers
::
reversePrimers
).
nonEmpty
)
swapExt
(
outputDir
,
flash
.
notCombinedR1
,
".fastq.gz"
,
".clip.fastq.gz"
)
else
flash
.
notCombinedR1
def
notCombinedR2Fastq
:
File
=
if
((
forwardPrimers
::
reversePrimers
).
nonEmpty
)
swapExt
(
outputDir
,
flash
.
notCombinedR2
,
".fastq.gz"
,
".clip.fastq.gz"
)
else
flash
.
notCombinedR2
/** Pipeline itself */
def
biopetScript
()
:
Unit
=
{
val
flash
=
new
Flash
(
this
)
flash
.
outputDirectory
=
new
File
(
outputDir
,
"flash"
)
flash
.
fastqR1
=
fastqR1
flash
.
fastqR2
=
fastqR2
flash
.
isIntermediate
=
(
forwardPrimers
:::
reversePrimers
).
nonEmpty
add
(
flash
)
if
((
forwardPrimers
:::
reversePrimers
).
nonEmpty
)
{
val
cutadapt
=
new
Cutadapt
(
this
)
cutadapt
.
fastq_input
=
flash
.
combinedFastq
cutadapt
.
fastq_output
=
this
.
combinedFastq
cutadapt
.
stats_output
=
swapExt
(
outputDir
,
cutadapt
.
fastq_output
,
".fastq.gz"
,
".stats"
)
cutadapt
.
opt_anywhere
++=
(
forwardPrimers
:::
reversePrimers
)
add
(
cutadapt
)
addSummarizable
(
cutadapt
,
"cutadapt"
)
}
val
combinedFastqc
=
Fastqc
(
this
,
this
.
combinedFastq
,
new
File
(
outputDir
,
"combined_fastqc"
))
add
(
combinedFastqc
)
addSummarizable
(
combinedFastqc
,
"fastqc_combined"
)
val
notCombinedR1Fastqc
=
Fastqc
(
this
,
this
.
combinedFastq
,
new
File
(
outputDir
,
"not_combined_R1_fastqc"
))
add
(
notCombinedR1Fastqc
)
addSummarizable
(
notCombinedR1Fastqc
,
"fastqc_not_combined_R1"
)
val
notCombinedR2Fastqc
=
Fastqc
(
this
,
this
.
combinedFastq
,
new
File
(
outputDir
,
"not_combined_R2_fastqc"
))
add
(
notCombinedR2Fastqc
)
addSummarizable
(
notCombinedR2Fastqc
,
"fastqc_not_combined_R2"
)
}
/** Must return a map with used settings for this pipeline */
...
...
public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSingle.scala
View file @
03c15ef3
...
...
@@ -104,12 +104,12 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
lazy
val
combinedFastq
=
{
r2
match
{
case
Some
(
r2
)
=>
val
flash
=
new
Flash
(
this
)
flash
.
outputDir
ectory
=
new
File
(
outputDir
,
"combine_reads
_flash
"
)
flash
.
fastqR1
=
r1
flash
.
fastqR2
=
r2
add
(
flash
)
flash
.
combinedFastq
val
combineReads
=
new
CombineReads
(
this
)
combineReads
.
outputDir
=
new
File
(
outputDir
,
"combine_reads"
)
combineReads
.
fastqR1
=
r1
combineReads
.
fastqR2
=
r2
add
(
combineReads
)
combineReads
.
combinedFastq
case
_
=>
r1
}
}
...
...
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