Skip to content

Commit

Permalink
fix: memory blowup
Browse files Browse the repository at this point in the history
  • Loading branch information
shihabdider committed Jan 7, 2025
1 parent 51c4e9f commit a778eff
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ process {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 4.GB * task.attempt, 'memory' ) }
}
withName: 'BWAMEM1_MEM|BWAMEM2_MEM' {
withName: 'BWAMEM2_MEM|BWAMEM2_MEM' {
cpus = { check_max( 24 * task.attempt, 'cpus' ) }
memory = { check_max( 30.GB * task.attempt, 'memory' ) }
memory = { check_max( 72.GB * task.attempt, 'memory' ) }
}
withName: 'PARABRICKS_FQ2BAM' {
cpus = { check_max( 24 * task.attempt, 'cpus' ) }
Expand Down
10 changes: 10 additions & 0 deletions conf/modules/aligner.config
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ process {
withName: 'MERGE_BAM' {
ext.prefix = { "${meta.id}.sorted" }
}


withName: 'CRAM_TO_BAM_FINAL' {
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/alignment/final/${meta.id}/" },
pattern: "*{bam,bai}",
]
}
}

8 changes: 4 additions & 4 deletions conf/modules/recalibrate.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ process {
withName: 'GATK4_APPLYBQSR|GATK4_APPLYBQSR_SPARK' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.recal" : "${meta.id}_${intervals.simpleName}.recal" }
publishDir = [
enabled: !params.save_output_as_bam,
enabled: params.save_mapped,
mode: params.publish_dir_mode,
path: { "${params.outdir}/alignment/" },
pattern: "*cram",
Expand All @@ -30,7 +30,7 @@ process {
ext.prefix = { "${meta.id}.recal" }

publishDir = [
enabled: !params.save_output_as_bam,
enabled: params.save_mapped,
mode: params.publish_dir_mode,
path: { "${params.outdir}/alignment/recalibrated/${meta.id}/" },
pattern: "*cram"
Expand All @@ -39,7 +39,7 @@ process {

withName: 'MSKILABORG_NFJABBA:NFJABBA:(BAM_APPLYBQSR|BAM_APPLYBQSR_SPARK):CRAM_MERGE_INDEX_SAMTOOLS:INDEX_CRAM' {
publishDir = [
enabled: !params.save_output_as_bam,
enabled: params.save_mapped,
mode: params.publish_dir_mode,
path: { "${params.outdir}/alignment/recalibrated/${meta.id}/" },
pattern: "*{recal.cram,recal.cram.crai}"
Expand All @@ -50,7 +50,7 @@ process {
ext.prefix = { "${meta.id}.recal" }

publishDir = [
enabled: params.save_output_as_bam,
enabled: params.save_mapped,
mode: params.publish_dir_mode,
path: { "${params.outdir}/alignment/recalibrated/${meta.id}/" },
pattern: "*{recal.bam,recal.bam.bai}"
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/bwamem2/index/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ params {
fq2bam_mark_duplicates = true // Whether fq2bam should mark duplicates, set false if not using fq2bam
fq2bam_low_memory = false // Set to true if using fq2bam with gpus that have <24GB memory
optical_duplicate_pixel_distance = 2500 // For computing optical duplicates, 2500 for NovaSeqX+
save_mapped = true // Mapped BAMs are saved
save_mapped = false // Mapped BAMs are saved
save_output_as_bam = true // Output files from alignment are saved as bam by default and not as cram files
seq_center = null // No sequencing center to be written in read group CN field by aligner
seq_platform = null // Default platform written in read group PL field by aligner, null by default.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_runs/full_test/params.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bwa": "/gpfs/commons/home/sdider/DB/GATK/bwa/",
"outdir": "./results",
"pon_dryclean": "/gpfs/commons/home/tdey/data/dryclean/MONSTER_PON_RAW/MONSTER_PON_RAW_SORTED/fixed.detergent.rds",
"tools": "fusions",
"tools": "bamqc",
"field_dryclean": "reads",
"genome": "GATK.GRCh37",
"email": "[email protected]"
Expand Down
8 changes: 8 additions & 0 deletions workflows/nfcasereports.nf
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ inputs = inputs

ch_items.meta = ch_items.meta - ch_items.meta.subMap('lane') + [num_lanes: num_lanes.toInteger(), read_group: read_group.toString(), size: 1]

} else if (ch_items.fastq_2) {
ch_items.meta = ch_items.meta + [id: ch_items.meta.sample.toString()]
def CN = params.seq_center ? "CN:${params.seq_center}\\t" : ''

def flowcell = flowcellLaneFromFastq(ch_items.fastq_1)
def read_group = "\"@RG\\tID:${flowcell}.${ch_items.meta.sample}\\t${CN}PU:${ch_items.meta.sample}\\tSM:${ch_items.meta.patient}_${ch_items.meta.sample}\\tLB:${ch_items.meta.sample}\\tDS:${params.fasta}\\tPL:${params.seq_platform}\""

ch_items.meta = ch_items.meta + [num_lanes: num_lanes.toInteger(), read_group: read_group.toString(), size: 1]
} else if (ch_items.meta.lane && ch_items.bam) {
ch_items.meta = ch_items.meta + [id: "${ch_items.meta.sample}-${ch_items.meta.lane}".toString()]
def CN = params.seq_center ? "CN:${params.seq_center}\\t" : ''
Expand Down

0 comments on commit a778eff

Please sign in to comment.