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

feat(cellranger count and multi): Add create-bam option to cellranger count and multi pipelines #387

Merged
merged 8 commits into from
Nov 22, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Add --create-bam parameter to cellranger count and multi pipelines ([#384](https://github.com/nf-core/scrnaseq/issues/384))

## v2.7.1 - 2024-08-13

Expand Down
27 changes: 20 additions & 7 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ if(params.aligner == "cellranger") {
path: "${params.outdir}/${params.aligner}/count",
mode: params.publish_dir_mode
]
ext.args = {"--chemistry ${meta.chemistry} --create-bam true " + (meta.expected_cells ? "--expect-cells ${meta.expected_cells}" : '')}
time = { 240.h * task.attempt }
ext.args = {"--chemistry ${meta.chemistry} --create-bam ${params.save_align_intermeds}" + " " + (meta.expected_cells ? "--expect-cells ${meta.expected_cells}" : '')}
time = { check_max( 240.h * task.attempt, 'time' ) }
kopichris marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down Expand Up @@ -185,11 +185,24 @@ if (params.aligner == "star") {
enabled: params.save_reference
]
}
withName: STAR_ALIGN {
publishDir = [
path: { "${params.outdir}/${params.aligner}/${meta.id}" },
mode: params.publish_dir_mode
]

if(params.save_align_intermeds) {
withName: 'STAR_ALIGN' {
publishDir = [
path: { "${params.outdir}/${params.aligner}/${meta.id}" },
mode: params.publish_dir_mode
]
}
}
else {
withName: 'STAR_ALIGN' {
publishDir = [
path: { "${params.outdir}/${params.aligner}/${meta.id}" },
mode: params.publish_dir_mode,
pattern: '*',
saveAs: { it.endsWith('.bam') ? null : it }
]
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ params {
aligner = 'alevin'
input = null
save_reference = false
save_align_intermeds = true
protocol = 'auto'

// reference files
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
"description": "Specify this parameter to save the indices created (STAR, Kallisto, Salmon) to the results.",
"fa_icon": "fas fa-bookmark"
},
"save_align_intermeds": {
"type": "boolean",
"description": "Specify this parameter to save the intermediate alignment files (STAR, CellRanger) to the results.",
"fa_icon": "fas fa-bookmark"
},
"igenomes_base": {
"type": "string",
"format": "directory-path",
Expand Down Expand Up @@ -551,3 +556,4 @@
}
]
}

2 changes: 1 addition & 1 deletion workflows/scrnaseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ workflow SCRNASEQ {
// add cellranger options that are currently handled by pipeline, coming from samplesheet
// the module parses them from the 'gex' options
if (meta.feature_type.toString() == 'gex') {
parsed_meta.options['create-bam'] = true // force bam creation -- param required by cellranger multi
parsed_meta.options['create-bam'] = params.save_align_intermeds // force bam creation -- param required by cellranger multi
if (meta.expected_cells) { parsed_meta.options['expected-cells'] = meta.expected_cells }
}

Expand Down
Loading