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
3e7b0797
Commit
3e7b0797
authored
4 years ago
by
Ruben Vorderman
Browse files
Options
Downloads
Patches
Plain Diff
Use more sort threads for alignment if more alignment threads are used
parent
fdab6172
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bwa.wdl
+24
-10
24 additions, 10 deletions
bwa.wdl
with
24 additions
and
10 deletions
bwa.wdl
+
24
−
10
View file @
3e7b0797
...
...
@@ -29,16 +29,23 @@ task Mem {
String? readgroup
Int threads = 4
Int sortThreads
= 1
Int
?
sortThreads
Int sortMemoryPerThreadGb = 2
Int compressionLevel = 1
# BWA needs slightly more memory than the size of the index files (~10%). Add a margin for safety here.
Int memoryGb = 1 + ceil(size(bwaIndex.indexFiles, "G") * 1.2) + sortMemoryPerThreadGb * sortThreads
Int? memoryGb
Int timeMinutes = 1 + ceil(size([read1, read2], "G") * 200 / threads)
# This container contains: samtools (1.10), bwa (0.7.17-r1188)
String dockerImage = "quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:eabfac3657eda5818bae4090db989e3d41b01542-0"
}
# Samtools sort may block the pipe while it is writing data to disk.
# This can lead to cpu underutilization.
# 1 thread if threads is 1. For 2-4 threads 2 sort threads. 3 sort threads for 5-8 threads.
Int estimatedSortThreads = if threads == 1 then 1 else 1 + ceil(threads / 4.0)
Int totalSortThreads = select_first([sortThreads, estimatedSortThreads])
# BWA needs slightly more memory than the size of the index files (~10%). Add a margin for safety here.
Int estimatedMemoryGb = 1 + ceil(size(bwaIndex.indexFiles, "G") * 1.2) + sortMemoryPerThreadGb * totalSortThreads
command {
set -e -o pipefail
mkdir -p "$(dirname ~{outputPath})"
...
...
@@ -49,7 +56,7 @@ task Mem {
~{read1} \
~{read2} \
| samtools sort \
~{"-@ " +
s
ortThreads} \
~{"-@ " +
totalS
ortThreads} \
-m ~{sortMemoryPerThreadGb}G \
-l ~{compressionLevel} \
- \
...
...
@@ -62,7 +69,7 @@ task Mem {
runtime {
cpu: threads
memory: "~{
memoryGb
}G"
memory: "~{
select_first([memoryGb, estimatedMemoryGb])
}G"
time_minutes: timeMinutes
docker: dockerImage
}
...
...
@@ -95,16 +102,23 @@ task Kit {
Boolean sixtyFour = false
Int threads = 4
Int sortThreads
= 1
Int
?
sortThreads
Int sortMemoryPerThreadGb = 2
Int compressionLevel = 1
# BWA needs slightly more memory than the size of the index files (~10%). Add a margin for safety here.
Int memoryGb = 1 + ceil(size(bwaIndex.indexFiles, "G") * 1.2) + sortMemoryPerThreadGb * sortThreads
Int? memoryGb
Int timeMinutes = 1 + ceil(size([read1, read2], "G") * 220 / threads)
# Contains bwa 0.7.17 bwakit 0.7.17.dev1 and samtools 1.10
String dockerImage = "quay.io/biocontainers/mulled-v2-ad317f19f5881324e963f6a6d464d696a2825ab6:c59b7a73c87a9fe81737d5d628e10a3b5807f453-0"
}
# Samtools sort may block the pipe while it is writing data to disk.
# This can lead to cpu underutilization.
# 1 thread if threads is 1. For 2-4 threads 2 sort threads. 3 sort threads for 5-8 threads.
Int estimatedSortThreads = if threads == 1 then 1 else 1 + ceil(threads / 4.0)
Int totalSortThreads = select_first([sortThreads, estimatedSortThreads])
# BWA needs slightly more memory than the size of the index files (~10%). Add a margin for safety here.
Int estimatedMemoryGb = 1 + ceil(size(bwaIndex.indexFiles, "G") * 1.2) + sortMemoryPerThreadGb * totalSortThreads
command {
set -e
mkdir -p "$(dirname ~{outputPrefix})"
...
...
@@ -119,7 +133,7 @@ task Kit {
-p ~{outputPrefix}.hla \
~{bwaIndex.fastaFile}~{true=".64.alt" false=".alt" sixtyFour} | \
samtools sort \
~{"-@ " +
s
ortThreads} \
~{"-@ " +
totalS
ortThreads} \
-m ~{sortMemoryPerThreadGb}G \
-l ~{compressionLevel} \
- \
...
...
@@ -134,7 +148,7 @@ task Kit {
# One extra thread for bwa-postalt + samtools is not needed.
# These only use 5-10% of compute power and not always simultaneously.
cpu: threads
memory: "~{
memoryGb
}G"
memory: "~{
select_first([memoryGb, estimatedMemoryGb])
}G"
time_minutes: timeMinutes
docker: dockerImage
}
...
...
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