nf-core_modules/modules/cellranger/count/main.nf
Edmund Miller e2ba70ed9a
Add Cell Ranger mkfastq, mkgtf, and count (#979)
* feat(cellranger): Add initial count module

Co-authored-by: Gisela Gabernet <gisela.gabernet@gmail.com>

* feat(cellranger): Add mkgtf module

* test(cellranger): Fix count test with mkgtf

* fix(cellranger): Generalize gtf attribute filters

* chore: Add .gitignore for cellranger tar

* build(cellranger): Update dockerfile

https://joshtronic.com/2021/09/12/fixed-repository-debian-security-buster-updates-changed-suite-from-stable-to-oldstable/

* Apply suggestions from code review

Co-authored-by: Gisela Gabernet <gisela.gabernet@gmail.com>

* Apply suggestions from code review

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* Update modules/cellranger/mkgtf/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

* style: Capitalize README

* test(cellranger): Update pytest_modules

* feat(cellranger): Add initial mkfastq module

* ci: Update pytest modules

* refactor(cellranger): Update modules to new syntax

* docs(cellranger): Update meta files

There is some terrible copy-pasting going on.

* fix(cellranger): Add args

Co-authored-by: Gisela Gabernet <gisela.gabernet@gmail.com>
Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
2021-12-02 14:27:20 +00:00

49 lines
1.4 KiB
Text

process CELLRANGER_COUNT {
tag "$meta.gem"
label 'process_high'
if (params.enable_conda) {
exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers."
}
container "nfcore/cellranger:6.0.2"
input:
tuple val(meta), path(reads)
path reference
output:
path("sample-${meta.gem}/outs/*"), emit: outs
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
def sample_arg = meta.samples.unique().join(",")
def reference_name = reference.name
"""
cellranger \\
count \\
--id='sample-${meta.gem}' \\
--fastqs=. \\
--transcriptome=$reference_name \\
--sample=$sample_arg \\
--localcores=$task.cpus \\
--localmem=${task.memory.toGiga()} \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' )
END_VERSIONS
"""
stub:
"""
mkdir -p "sample-${meta.gem}/outs/"
touch sample-${meta.gem}/outs/fake_file.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cellranger: \$(echo \$( cellranger --version 2>&1) | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*\$/\\1/' )
END_VERSIONS
"""
}