Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt at fixing markdup memory issues #179

Merged
merged 5 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#### Bug fixes
* Fixing HISAT2 Index Building for large reference genomes [#153](https://github.com/nf-core/rnaseq/issues/153)
* Fixing HISAT2 BAM sorting using more memory than available on the system
* Fixing MarkDuplicates memory consumption issues following [#179](https://github.com/nf-core/rnaseq/pull/179)


#### Dependency Updates
Expand Down
6 changes: 6 additions & 0 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ process {
withName: trim_galore {
time = { check_max( 8.h * task.attempt, 'time' ) }
}
withName:markDuplicates {
// Actually the -Xmx value should be kept lower,
// and is set through the markdup_java_options
cpus = { check_max( 8, 'cpus' ) }
memory = { check_max( 8.GB * task.attempt, 'memory' ) }
}
withName: makeHISATindex {
cpus = { check_max( 10, 'cpus' ) }
memory = { check_max( 200.GB * task.attempt, 'memory' ) }
Expand Down
11 changes: 3 additions & 8 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ process preseq {
* STEP 6 Mark duplicates
*/
process markDuplicates {
label 'low_memory'
tag "${bam.baseName - '.sorted'}"
publishDir "${params.outdir}/markDuplicates", mode: 'copy',
saveAs: {filename -> filename.indexOf("_metrics.txt") > 0 ? "metrics/$filename" : "$filename"}
Expand All @@ -869,14 +868,10 @@ process markDuplicates {
file "${bam.baseName}.markDups.bam.bai"

script:
if( !task.memory ){
log.info "[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this."
avail_mem = 3
} else {
avail_mem = task.memory.toGiga()
}
markdup_java_options = (task.memory.toGiga() > 8) ? ${params.markdup_java_options} : "\"-Xms" + (task.memory.toGiga() / 2 )+"g "+ "-Xmx" + (task.memory.toGiga() - 1)+ "g\""

"""
picard -Xmx${avail_mem}g MarkDuplicates \\
picard ${markdup_java_options} MarkDuplicates \\
INPUT=$bam \\
OUTPUT=${bam.baseName}.markDups.bam \\
METRICS_FILE=${bam.baseName}.markDups_metrics.txt \\
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ params {
fcExtraAttributes = 'gene_name'
fcGroupFeatures = 'gene_id'
fcGroupFeaturesType = 'gene_biotype'
markdup_java_options = '"-Xms4000m -Xmx7g"' //Established values for markDuplicate memory consumption, see issue PR #689 (in Sarek) for details
splicesites = false
saveReference = false
saveTrimmed = false
Expand Down