Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
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
biowdl
tasks
Commits
1f117c45
Commit
1f117c45
authored
6 years ago
by
Cats
Browse files
Options
Downloads
Patches
Plain Diff
simplify and containerize bwa
parent
2b093b83
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
bwa.wdl
+17
-36
17 additions, 36 deletions
bwa.wdl
with
17 additions
and
36 deletions
bwa.wdl
+
17
−
36
View file @
1f117c45
...
...
@@ -4,8 +4,8 @@ import "common.wdl" as common
task Mem {
input {
String? preCommand
F
astqPair inputFastq
File read1
F
ile? read2
BwaIndex bwaIndex
String outputPath
String? readgroup
...
...
@@ -15,45 +15,23 @@ task Mem {
Int threads = 2
Int memory = 8
Int picardMemory = 4
String dockerTag = "43ec6124f9f4f875515f9548733b8b4e5fed9aa6-0"
}
String picardPrefix = if defined(picardJar)
then "java -Xmx" + picardMemory + "G -jar " + picardJar
else "picard -Xmx" + picardMemory + "G"
# Post alt script from bwa
String altCommand = if defined(bwaIndex.altIndex)
then "| bwa-postalt " + bwaIndex.altIndex
else ""
# setNmMdAndUqTags is only required if alt sequences are added
String setNmMdAndUqTagsCommand = picardPrefix + " SetNmMdAndUqTags INPUT=/dev/stdin OUTPUT=" +
outputPath + " CREATE_INDEX=true" + " R=" + bwaIndex.fastaFile
String sortSamCommand = picardPrefix + " SortSam INPUT=/dev/stdin SORT_ORDER=coordinate " +
if defined(bwaIndex.altIndex)
then " OUTPUT=/dev/stdout "
else " OUTPUT=" + outputPath + " CREATE_INDEX=true "
String picardCommand = if defined(bwaIndex.altIndex)
then sortSamCommand + " | " + setNmMdAndUqTagsCommand
else sortSamCommand
String readgroupArg = if defined(readgroup)
then "-R '" + readgroup + "'"
else ""
command {
set -e -o pipefail
mkdir -p $(dirname ~{outputPath})
~{preCommand}
bwa mem
~{"-t " + threads} \
~{
readgroupArg
} \
bwa mem \
~{"-t " + threads} \
~{
"-R '" + readgroup}~{true="'" false="" defined(readgroup)
} \
~{bwaIndex.fastaFile} \
~{inputFastq.R1} \
~{inputFastq.R2} \
~{altCommand} \
| ~{picardCommand}
~{read1} \
~{read2} \
| picard -Xmx~{picardMemory}G SortSam \
INPUT=/dev/stdin \
OUTPUT=~{outputPath} \
SORT_ORDER=coordinate \
CREATE_INDEX=true
}
output {
...
...
@@ -66,6 +44,10 @@ task Mem {
runtime{
cpu: threads
memory: memory + picardMemory + picardMemory
# A mulled container is needed to have both picard and bwa in one container.
# This container contains: picard (2.18.7-SNAPSHOT), bwa (0.7.17-r1188)
docker: "quay.io/biocontainers/mulled-v2-002f51ea92721407ef440b921fb5940f424be842" +
dockerTag
}
}
...
...
@@ -118,5 +100,4 @@ task Index {
struct BwaIndex {
File fastaFile
Array[File] indexFiles
File? altIndex
}
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