Skip to content

Commit 2d0015e

Browse files
authored
Merge pull request #387 from kopichris/feature/create-bam-parameter
feat(cellranger count and multi): Add create-bam option to cellranger count and multi pipelines
2 parents b5b061e + 750e644 commit 2d0015e

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
- Add `--save_align_intermeds` parameter that publishes BAM files to the output directory (for `starsolo`, `cellranger` and `cellranger multi`) ([#384](https://github.com/nf-core/scrnaseq/issues/384))
89
- Added support for pre-built indexes in `genomes.config` file for `cellranger`, `cellranger-arc`, `simpleaf` and `simpleaf txp2gene` ([#371](https://github.com/nf-core/scrnaseq/issues/371))
910

1011
## v2.7.1 - 2024-08-13

conf/modules.config

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ if(params.aligner == "cellranger") {
8181
path: "${params.outdir}/${params.aligner}/count",
8282
mode: params.publish_dir_mode
8383
]
84-
ext.args = {"--chemistry ${meta.chemistry} --create-bam true " + (meta.expected_cells ? "--expect-cells ${meta.expected_cells}" : '')}
85-
time = { 240.h * task.attempt }
84+
ext.args = {"--chemistry ${meta.chemistry} --create-bam ${params.save_align_intermeds}" + " " + (meta.expected_cells ? "--expect-cells ${meta.expected_cells}" : '')}
85+
time = { 240.h * task.attempt }
8686
}
8787
}
8888
}
@@ -185,11 +185,24 @@ if (params.aligner == "star") {
185185
enabled: params.save_reference
186186
]
187187
}
188-
withName: STAR_ALIGN {
189-
publishDir = [
190-
path: { "${params.outdir}/${params.aligner}/${meta.id}" },
191-
mode: params.publish_dir_mode
192-
]
188+
189+
if(params.save_align_intermeds) {
190+
withName: 'STAR_ALIGN' {
191+
publishDir = [
192+
path: { "${params.outdir}/${params.aligner}/${meta.id}" },
193+
mode: params.publish_dir_mode
194+
]
195+
}
196+
}
197+
else {
198+
withName: 'STAR_ALIGN' {
199+
publishDir = [
200+
path: { "${params.outdir}/${params.aligner}/${meta.id}" },
201+
mode: params.publish_dir_mode,
202+
pattern: '*',
203+
saveAs: { it.endsWith('.bam') ? null : it }
204+
]
205+
}
193206
}
194207
}
195208
}

nextflow.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ params {
1313
aligner = 'alevin'
1414
input = null
1515
save_reference = false
16+
save_align_intermeds = true
1617
protocol = 'auto'
1718

1819
// reference files

nextflow_schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@
142142
"description": "Specify this parameter to save the indices created (STAR, Kallisto, Salmon) to the results.",
143143
"fa_icon": "fas fa-bookmark"
144144
},
145+
"save_align_intermeds": {
146+
"type": "boolean",
147+
"description": "Specify this parameter to save the intermediate alignment files (STAR, CellRanger) to the results.",
148+
"fa_icon": "fas fa-bookmark"
149+
},
145150
"igenomes_base": {
146151
"type": "string",
147152
"format": "directory-path",

workflows/scrnaseq.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ workflow SCRNASEQ {
253253
// add cellranger options that are currently handled by pipeline, coming from samplesheet
254254
// the module parses them from the 'gex' options
255255
if (meta.feature_type.toString() == 'gex') {
256-
parsed_meta.options['create-bam'] = true // force bam creation -- param required by cellranger multi
256+
parsed_meta.options['create-bam'] = params.save_align_intermeds // force bam creation -- param required by cellranger multi
257257
if (meta.expected_cells) { parsed_meta.options['expected-cells'] = meta.expected_cells }
258258
}
259259

0 commit comments

Comments
 (0)