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
bdc6999e
Commit
bdc6999e
authored
Jan 16, 2015
by
Peter van 't Hof
Browse files
Added bwa aln to mapping pipeline
parent
43955884
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/bwa/BwaSampe.scala
View file @
bdc6999e
...
...
@@ -3,12 +3,12 @@ package nl.lumc.sasc.biopet.extensions.bwa
import
java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Output
,
Input
}
import
org.broadinstitute.gatk.utils.commandline.
{
Output
,
Input
}
/**
* Created by pjvan_thof on 1/16/15.
*/
class
BwaSampe
(
val
root
:
Configurable
)
extends
Bwa
{
class
BwaSampe
(
val
root
:
Configurable
)
extends
Bwa
{
@Input
(
doc
=
"Fastq file R1"
,
required
=
true
)
var
fastqR1
:
File
=
_
...
...
public/mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
View file @
bdc6999e
...
...
@@ -20,7 +20,7 @@ import java.io.File
import
java.util.Date
import
nl.lumc.sasc.biopet.core.
{
BiopetQScript
,
PipelineCommand
}
import
nl.lumc.sasc.biopet.extensions.
{
Star
,
Stampy
,
Bowtie
}
import
nl.lumc.sasc.biopet.extensions.bwa.BwaMem
import
nl.lumc.sasc.biopet.extensions.bwa.
{
BwaSamse
,
BwaSampe
,
BwaAln
,
BwaMem
}
import
nl.lumc.sasc.biopet.tools.FastqSplitter
import
nl.lumc.sasc.biopet.extensions.picard.
{
MarkDuplicates
,
SortSam
,
MergeSamFiles
,
AddOrReplaceReadGroups
}
import
nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
...
...
@@ -183,7 +183,8 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
val
outputBam
=
new
File
(
chunkDir
+
outputName
+
".bam"
)
bamFiles
:+=
outputBam
aligner
match
{
case
"bwa"
=>
addBwa
(
R1
,
R2
,
outputBam
,
deps
)
case
"bwa"
=>
addBwaMem
(
R1
,
R2
,
outputBam
,
deps
)
case
"bwa-aln"
=>
addBwaAln
(
R1
,
R2
,
outputBam
,
deps
)
case
"bowtie"
=>
addBowtie
(
R1
,
R2
,
outputBam
,
deps
)
case
"stampy"
=>
addStampy
(
R1
,
R2
,
outputBam
,
deps
)
case
"star"
=>
addStar
(
R1
,
R2
,
outputBam
,
deps
)
...
...
@@ -213,13 +214,53 @@ class Mapping(val root: Configurable) extends QScript with BiopetQScript {
outputFiles
+=
(
"finalBamFile"
->
bamFile
)
}
def
addBwa
(
R1
:
File
,
R2
:
File
,
output
:
File
,
deps
:
List
[
File
])
:
File
=
{
def
addBwaAln
(
R1
:
File
,
R2
:
File
,
output
:
File
,
deps
:
List
[
File
])
:
File
=
{
val
bwaAlnR1
=
new
BwaAln
(
this
)
bwaAlnR1
.
fastq
=
R1
bwaAlnR1
.
deps
=
deps
bwaAlnR1
.
output
=
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".R1.sai"
)
add
(
bwaAlnR1
)
val
samFile
:
File
=
if
(
paired
)
{
val
bwaAlnR2
=
new
BwaMem
(
this
)
bwaAlnR2
.
deps
=
deps
bwaAlnR2
.
output
=
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".R2.sai"
)
add
(
bwaAlnR2
)
val
bwaSampe
=
new
BwaSampe
(
this
)
bwaSampe
.
fastqR1
=
R1
bwaSampe
.
fastqR2
=
R2
bwaSampe
.
saiR1
=
bwaAlnR1
.
output
bwaSampe
.
saiR2
=
bwaAlnR2
.
output
bwaSampe
.
r
=
getReadGroup
bwaSampe
.
output
=
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".sam"
)
add
(
bwaSampe
)
bwaSampe
.
output
}
else
{
val
bwaSamse
=
new
BwaSamse
(
this
)
bwaSamse
.
fastq
=
R1
bwaSamse
.
sai
=
bwaAlnR1
.
output
bwaSamse
.
r
=
getReadGroup
bwaSamse
.
output
=
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".sam"
)
add
(
bwaSamse
)
bwaSamse
.
output
}
val
sortSam
=
SortSam
(
this
,
samFile
,
output
)
if
(
chunking
||
!
skipMarkduplicates
)
sortSam
.
isIntermediate
=
true
add
(
sortSam
)
return
sortSam
.
output
}
def
addBwaMem
(
R1
:
File
,
R2
:
File
,
output
:
File
,
deps
:
List
[
File
])
:
File
=
{
val
bwaCommand
=
new
BwaMem
(
this
)
bwaCommand
.
R1
=
R1
if
(
paired
)
bwaCommand
.
R2
=
R2
bwaCommand
.
deps
=
deps
bwaCommand
.
R
=
getReadGroup
bwaCommand
.
output
=
this
.
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".sam"
)
bwaCommand
.
output
=
swapExt
(
output
.
getParent
,
output
,
".bam"
,
".sam"
)
add
(
bwaCommand
,
isIntermediate
=
true
)
val
sortSam
=
SortSam
(
this
,
bwaCommand
.
output
,
output
)
if
(
chunking
||
!
skipMarkduplicates
)
sortSam
.
isIntermediate
=
true
...
...
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