Skip to content

Commit f843ea0

Browse files
authored
Merge pull request #50 from CenterForMedicalGeneticsGhent/dev
dev
2 parents 99a8fdf + f71f292 commit f843ea0

File tree

21 files changed

+345
-96
lines changed

21 files changed

+345
-96
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ testing/
88
testing*
99
*.pyc
1010
null
11+
s3:
12+
output

CHANGELOG.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## v1.1.2
7+
8+
- Support for bamprocessing with ELPREP
9+
- Improved sample grouping
10+
- Meta value clean up
11+
- bump modules
12+
- fix multiqc report to include all results
13+
- fix duplicate marking with bamsormadup
14+
- drop post alignment sorting, doesn't make sense as we do sort/markdup afterwards
15+
- Add option to use elprep for alignment postprocessing
16+
617
## v1.0.2dev
718

819
- Add `unaligned` denominator to unaligned samples
@@ -18,11 +29,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1829
## v1.0dev - [06/09/2022]
1930

2031
Initial release of CenterForMedicalGeneticsGhent/nf-cmgg-preprocessing, created with the [nf-core](https://nf-co.re/) template.
21-
22-
### `Added`
23-
24-
### `Fixed`
25-
26-
### `Dependencies`
27-
28-
### `Deprecated`

assets/multiqc_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ report_section_order:
1212
export_plots: true
1313
bclconvert:
1414
create_undetermined_barcode_barplots: true
15+
extra_fn_clean_exts:
16+
- ".cram"

conf/modules.config

+26-6
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ process {
119119
meta.readgroup && meta.readgroup.LB ? "--library ${meta.readgroup.LB}" : "",
120120
meta.readgroup && meta.readgroup.PU ? "--platform-unit ${meta.readgroup.PU}" : "",
121121
meta.readgroup && meta.readgroup.PL ? "--platform ${meta.readgroup.PL}" : "",
122-
meta.readgroup && meta.readgroup.CN ? "--sequencing-center ${meta.readgroup.CN}" : "",
123-
"--sort=true"
122+
meta.readgroup && meta.readgroup.CN ? "--sequencing-center ${meta.readgroup.CN}" : ""
124123
].join(" ").trim()}
125124
publishDir = [ enabled: false ]
126125
}
@@ -158,8 +157,8 @@ process {
158157
"--fast-local",
159158
meta.readgroup ? "--rg-id ${meta.readgroup.ID}": "",
160159
meta.readgroup ? "--rg " + meta.readgroup.findResults{ it.value?.trim() ? "$it.key:$it.value" : null }.join(" --rg ") : ""
161-
162160
].join(" ").trim()}
161+
ext.args2 = "--fast"
163162
}
164163

165164
withName: "BWAMEM.*_MEM" {
@@ -171,16 +170,16 @@ process {
171170
"-c 250",
172171
meta.readgroup ? "-R \"@RG\\t" + meta.readgroup.findResults{ it.value?.trim() ? "$it.key:$it.value" : null }.join("\\t") + "\"" : ""
173172
].join(" ").trim()}
173+
ext.args2 = "--fast"
174174
}
175175

176176
withName: DRAGMAP_ALIGN {
177177
ext.args = {[
178178
meta.readgroup ? "--RGSM \"@RG\\t" + meta.readgroup.findResults{ it.value?.trim() ? "$it.key:$it.value" : null }.join("\\t") + "\"" : ""
179-
180179
].join(" ").trim()}
180+
ext.args2 = "--fast"
181181
}
182182

183-
// -so : enable coordinate sorting
184183
// -b- : Don't lock threads to cpu cores, improves performance when scheduling multiple jobs/node
185184
// -sm 10 : Allow 10GB of memory for sorting threads
186185
// -I : ignore IDs that don't match in the paired-end aligner
@@ -192,7 +191,6 @@ process {
192191
cpus = { check_max( 18 , "cpus" ) }
193192
memory = { check_max( 72.GB , "memory" ) }
194193
ext.args = {[
195-
"-so",
196194
"-b-",
197195
"-sm 20",
198196
"-I",
@@ -207,6 +205,27 @@ process {
207205
// BAMPROCESSING
208206
//********************************************************************************//
209207

208+
withName: ELPREP_SFM {
209+
ext.args = {[
210+
"--mark-duplicates",
211+
"--sorting-order coordinate",
212+
"--optical-duplicates-pixel-distance 2500",
213+
"--mark-optical-duplicates ${meta.id}.metrics.txt"
214+
].join(" ").trim()}
215+
publishDir = [
216+
[
217+
path: { "${params.outdir}/${meta.samplename}" },
218+
mode: params.publish_dir_mode,
219+
pattern: "*metrics*",
220+
saveAs: {filename -> filename.replace("metrics", "duplicate_metrics")}
221+
],
222+
]
223+
}
224+
225+
withName: ".*:FASTQ_TO_CRAM:SAMTOOLS_INDEX" {
226+
publishDir = [ enabled: false ]
227+
}
228+
210229
withName: BIOBAMBAM_BAMSORMADUP {
211230
ext.prefix = {"${meta.id}.merged"}
212231
ext.args = {[
@@ -250,6 +269,7 @@ process {
250269

251270
withName: SAMTOOLS_CONVERT {
252271
cpus = { check_max( 9 , "cpus" ) }
272+
memory = { check_max( 36.GB * task.attempt, "memory" ) }
253273
// activate cram compression
254274
ext.args = "-C --output-fmt-option archive --verbosity 5"
255275
}

modules.json

+12-6
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
"nf-core": {
88
"bcl2fastq": {
99
"branch": "master",
10-
"git_sha": "c62b41a07a00fee11ec73e2a0d4a1aec771a742b",
10+
"git_sha": "100f641b272ff7e309bfbb86d0c3f63d7b6c6a9b",
1111
"installed_by": ["bcl_demultiplex"]
1212
},
1313
"bclconvert": {
1414
"branch": "master",
15-
"git_sha": "c62b41a07a00fee11ec73e2a0d4a1aec771a742b",
15+
"git_sha": "100f641b272ff7e309bfbb86d0c3f63d7b6c6a9b",
1616
"installed_by": ["bcl_demultiplex"]
1717
},
1818
"biobambam/bamsormadup": {
1919
"branch": "master",
20-
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
21-
"installed_by": ["modules"]
20+
"git_sha": "ea421dc46ceaad39d637f8793e87193061804868",
21+
"installed_by": ["modules"],
22+
"patch": "modules/nf-core/biobambam/bamsormadup/biobambam-bamsormadup.diff"
2223
},
2324
"bowtie2/align": {
2425
"branch": "master",
@@ -62,7 +63,7 @@
6263
},
6364
"dragmap/align": {
6465
"branch": "master",
65-
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
66+
"git_sha": "5cef12bb8a747ce018bb351871bdfe118bd28dd7",
6667
"installed_by": ["fastq_align_dna"]
6768
},
6869
"dragmap/hashtable": {
@@ -140,6 +141,11 @@
140141
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
141142
"installed_by": ["bam_stats_samtools"]
142143
},
144+
"samtools/index": {
145+
"branch": "master",
146+
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
147+
"installed_by": ["modules"]
148+
},
143149
"samtools/stats": {
144150
"branch": "master",
145151
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
@@ -157,7 +163,7 @@
157163
},
158164
"untar": {
159165
"branch": "master",
160-
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
166+
"git_sha": "cc1f997fab6d8fde5dc0e6e2a310814df5b53ce7",
161167
"installed_by": ["bcl_demultiplex"]
162168
}
163169
}

modules/local/elprep/sfm/main.nf

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
process ELPREP_SFM {
2+
tag "$meta.id"
3+
label 'process_high'
4+
5+
conda "bioconda::elprep=5.1.2"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/elprep:5.1.2--he881be0_0':
8+
'quay.io/biocontainers/elprep:5.1.2--he881be0_0' }"
9+
10+
input:
11+
tuple val(meta), path(bam, stageAs: "input/*")
12+
13+
output:
14+
tuple val(meta), path("output/**.{bam,sam}") ,emit: bam
15+
tuple val(meta), path("*.metrics.txt") ,optional: true, emit: metrics
16+
path "versions.yml" ,emit: versions
17+
18+
when:
19+
task.ext.when == null || task.ext.when
20+
21+
script:
22+
def args = task.ext.args ?: ''
23+
def prefix = task.ext.prefix ?: "${meta.id}"
24+
def suffix = args.contains("--output-type sam") ? "sam" : "bam"
25+
26+
// single end
27+
def single_end_cmd = meta.single_end ? "--single-end" : ""
28+
29+
"""
30+
elprep sfm ./input output/${prefix}.${suffix} \\
31+
${single_end_cmd} \\
32+
--nr-of-threads ${task.cpus} \\
33+
$args
34+
35+
cat <<-END_VERSIONS > versions.yml
36+
"${task.process}":
37+
elprep: \$(elprep 2>&1 | head -n2 | tail -n1 |sed 's/^.*version //;s/ compiled.*\$//')
38+
END_VERSIONS
39+
"""
40+
}

modules/nf-core/bcl2fastq/main.nf

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/bclconvert/main.nf

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/biobambam/bamsormadup/biobambam-bamsormadup.diff

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/biobambam/bamsormadup/main.nf

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/dragmap/align/main.nf

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/samtools/index/main.nf

+48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)