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

added cellranger vdj/mkvdjref modules, with module test for vdj #3033

Merged
merged 49 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b490f73
added cellranger vdj/mkvdjref modules, with module test for vdj
klkeys Mar 14, 2023
3139eae
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 14, 2023
14bece7
fixed linting issues part 1
klkeys Mar 14, 2023
6b4fcba
make that code prettypretty
klkeys Mar 15, 2023
74a06cc
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 15, 2023
7327d9e
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 15, 2023
635ff9f
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 16, 2023
1665492
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 24, 2023
096c685
Merge branch 'nf-core:master' into add_cellranger_vdj
klkeys Mar 27, 2023
de63c32
fixes from review, part 1
klkeys Mar 27, 2023
24f0898
fixes from review, part 2
klkeys Mar 27, 2023
37864a0
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 27, 2023
90336b4
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 28, 2023
85caa77
leave meta.gem alone
klkeys Mar 28, 2023
66b2111
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 28, 2023
8de80a8
updated cellranger vdj module test
klkeys Mar 29, 2023
9753e82
added test for cellranger mkvdjref
klkeys Mar 29, 2023
b3e1dcf
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 29, 2023
f19b1ae
meta.gem --> meta.id, whitespace fix, and pytest update
klkeys Mar 29, 2023
4ba750f
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 29, 2023
b5a06f8
fixed a bunch of small errors in module test, tests execute successfu…
klkeys Mar 30, 2023
6e944dd
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 30, 2023
f22afe8
ax md5sums for empty files
klkeys Mar 30, 2023
7f6d418
fixed md5sum disagreement in cellranger/mkvdjref test
klkeys Mar 30, 2023
9239a92
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 30, 2023
0f00e58
make code prettypretty
klkeys Mar 30, 2023
b7a26c9
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 30, 2023
5c77c5b
clean up cellranger modules, remove nonexistent 'cellranger/gtf' modu…
klkeys Mar 30, 2023
59e08a4
Merge branch 'master' into add_cellranger_vdj
klkeys Mar 30, 2023
a26aadc
Merge branch 'master' into add_cellranger_vdj
klkeys Apr 10, 2023
75aa42f
Merge branch 'master' into add_cellranger_vdj
klkeys Apr 17, 2023
51e621c
Merge branch 'master' into add_cellranger_vdj
klkeys Apr 25, 2023
065a31b
updated files per 3rd party review
klkeys Apr 25, 2023
ca66a90
corrected cellranger count sample name for module test
klkeys Apr 25, 2023
a11efe2
Merge branch 'master' into add_cellranger_vdj
klkeys Apr 26, 2023
af321f8
Merge branch 'nf-core:master' into add_cellranger_vdj
klkeys Apr 26, 2023
48cba2e
fixed linting errors
klkeys Apr 26, 2023
cfbd8e8
fixed mysterious revert of cellranger/count test
klkeys Apr 26, 2023
5200f56
Merge branch 'master' into add_cellranger_vdj
klkeys Apr 26, 2023
5816818
added cellranger vdj + mkvdjref to excluded conda test workflows
klkeys Apr 27, 2023
46c13b8
Merge branch 'master' into add_cellranger_vdj
klkeys Apr 27, 2023
3145aec
Add prefix rather than using meta.id, removed --sample.
SPPearce Apr 28, 2023
8ac9d39
Indentation
SPPearce Apr 28, 2023
6499e02
Merge branch 'master' into add_cellranger_vdj
SPPearce Apr 28, 2023
4770925
Update modules/nf-core/cellranger/mkvdjref/main.nf
SPPearce Apr 28, 2023
38de20f
Update modules/nf-core/cellranger/vdj/main.nf
SPPearce Apr 28, 2023
dde6686
Update modules/nf-core/cellranger/count/main.nf
SPPearce Apr 28, 2023
85de173
Update to use docker.io
SPPearce Apr 28, 2023
399f539
Merge branch 'master' into add_cellranger_vdj
SPPearce Apr 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ jobs:
tags: cellranger/mkgtf
- profile: "conda"
tags: cellranger/mkref
- profile: "conda"
tags: cellranger/mkvdjref
- profile: "conda"
tags: cellranger/vdj
- profile: "conda"
tags: coreograph
- profile: "conda"
Expand Down
18 changes: 9 additions & 9 deletions modules/nf-core/cellranger/count/main.nf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
process CELLRANGER_COUNT {
tag "$meta.gem"
tag "$meta.id"
label 'process_high'

container "nfcore/cellranger:7.1.0"
container "docker.io/nfcore/cellranger:7.1.0"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
Expand All @@ -14,23 +14,22 @@ process CELLRANGER_COUNT {
path reference

output:
tuple val(meta), path("sample-${meta.gem}/outs/*"), emit: outs
path "versions.yml" , emit: versions
tuple val(meta), path("**/outs/**"), emit: outs
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def sample_arg = meta.samples.unique().join(",")
def prefix = task.ext.prefix ?: "${meta.id}"
def reference_name = reference.name
"""
cellranger \\
count \\
--id='sample-${meta.gem}' \\
--id='$prefix' \\
--fastqs=. \\
--transcriptome=$reference_name \\
--sample=$sample_arg \\
--localcores=$task.cpus \\
--localmem=${task.memory.toGiga()} \\
$args
Expand All @@ -42,9 +41,10 @@ process CELLRANGER_COUNT {
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p "sample-${meta.gem}/outs/"
touch sample-${meta.gem}/outs/fake_file.txt
mkdir -p "${prefix}/outs/"
touch ${prefix}/outs/fake_file.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 3 additions & 2 deletions modules/nf-core/cellranger/count/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ input:
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
pattern: "${Sample_Name}_S1_L00${Lane_Number}_${I1,I2,R1,R2}_001.fastq.gz"
- reference:
type: directory
description: Folder containing all the reference indices needed by Cell Ranger
output:
- outs:
type: file
description: Files containing the outputs of Cell Ranger
pattern: "sample-${meta.gem}/outs/*"
description: Files containing the outputs of Cell Ranger, see official 10X Genomics documentation for a complete list
pattern: "${meta.id}/outs/*"
- versions:
type: file
description: File containing software version
Expand Down
20 changes: 12 additions & 8 deletions modules/nf-core/cellranger/mkfastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process CELLRANGER_MKFASTQ {
tag "mkfastq"
label 'process_medium'

container "nfcore/cellrangermkfastq:7.1.0"
container "docker.io/nfcore/cellrangermkfastq:7.1.0"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
Expand All @@ -14,18 +14,21 @@ process CELLRANGER_MKFASTQ {
path csv

output:
path "versions.yml", emit: versions
path "${bcl.getSimpleName()}/outs/fastq_path/*.fastq.gz" , emit: fastq
path "**/outs/fastq_path/*.fastq.gz", emit: fastq
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${bcl.getSimpleName()}"
"""
cellranger mkfastq --id=${bcl.getSimpleName()} \
--run=$bcl \
--csv=$csv \
cellranger \\
mkfastq \\
--id=${prefix} \\
--run=$bcl \\
--csv=$csv \\
$args

cat <<-END_VERSIONS > versions.yml
Expand All @@ -35,9 +38,10 @@ process CELLRANGER_MKFASTQ {
"""

stub:
def prefix = task.ext.prefix ?: "${bcl.getSimpleName()}"
"""
mkdir -p "${bcl.getSimpleName()}/outs/fastq_path/"
touch ${bcl.getSimpleName()}/outs/fastq_path/fake_file.fastq.gz
mkdir -p "${prefix}/outs/fastq_path/"
touch ${prefix}/outs/fastq_path/fake_file.fastq.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
7 changes: 4 additions & 3 deletions modules/nf-core/cellranger/mkgtf/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process CELLRANGER_MKGTF {
tag "$gtf"
label 'process_low'

container "nfcore/cellranger:7.1.0"
container "docker.io/nfcore/cellranger:7.1.0"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
Expand All @@ -13,19 +13,20 @@ process CELLRANGER_MKGTF {
path gtf

output:
path "*.filtered.gtf", emit: gtf
path "*.gtf" , emit: gtf
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${gtf.baseName}.filtered"
"""
cellranger \\
mkgtf \\
$gtf \\
${gtf.baseName}.filtered.gtf \\
${prefix}.gtf \\
$args

cat <<-END_VERSIONS > versions.yml
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/cellranger/mkref/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process CELLRANGER_MKREF {
tag "$fasta"
label 'process_high'

container "nfcore/cellranger:7.1.0"
container "docker.io/nfcore/cellranger:7.1.0"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
Expand Down
39 changes: 39 additions & 0 deletions modules/nf-core/cellranger/mkvdjref/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
process CELLRANGER_MKVDJREF {
tag "$fasta"
label 'process_high'

container "docker.io/nfcore/cellranger:7.1.0"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
exit 1, "CELLRANGER_MKREF module does not support Conda. Please use Docker / Singularity / Podman instead."
}

input:
path fasta
klkeys marked this conversation as resolved.
Show resolved Hide resolved
path gtf
val reference_name
klkeys marked this conversation as resolved.
Show resolved Hide resolved

output:
path "${reference_name}", emit: reference
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
"""
cellranger \\
mkvdjref \\
--genome=$reference_name \\
--fasta=$fasta \\
--genes=$gtf \\
$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
"""
}
40 changes: 40 additions & 0 deletions modules/nf-core/cellranger/mkvdjref/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: cellranger_mkvdjref
description: Module to build the VDJ reference needed by the 10x Genomics Cell Ranger tool. Uses the cellranger mkvdjref command.
keywords:
- reference
- mkvdjref
- index
- immunoprofiling
- single-cell
- cellranger
tools:
- cellranger:
description: Cell Ranger processes data from 10X Genomics Chromium kits. `cellranger vdj` takes FASTQ files from `cellranger mkfastq` or `bcl2fastq` for V(D)J libraries and performs sequence assembly and paired clonotype calling. It uses the Chromium cellular barcodes and UMIs to assemble V(D)J transcripts per cell. Clonotypes and CDR3 sequences are output as a `.vloupe` file which can be loaded into Loupe V(D)J Browser.
homepage: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/what-is-cell-ranger
documentation: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/advanced/references
tool_dev_url: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/advanced/references
licence: 10x Genomics EULA
input:
- fasta:
type: file
description: Reference genome FASTA file
pattern: "*.{fasta,fa}"
- genes:
type: file
description: Reference transcriptome GTF file
pattern: "*.gtf"
- genome:
type: val
description: The name to give the new reference folder, e.g. `my_vdj_ref`
pattern: str
output:
- reference:
type: directory
description: Folder containing all the reference indices needed by Cell Ranger
- versions:
type: file
description: File containing software version
pattern: "versions.yml"
authors:
- "@ggabernet"
- "@klkeys"
54 changes: 54 additions & 0 deletions modules/nf-core/cellranger/vdj/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
process CELLRANGER_VDJ {
tag "${meta.id}"
label 'process_high'

container "docker.io/nfcore/cellranger:7.1.0"

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
exit 1, "CELLRANGER_VDJ module does not support Conda. Please use Docker / Singularity / Podman instead."
}

input:
tuple val(meta), path(reads)
path reference

output:
tuple val(meta), path("**/outs/**"), emit: outs
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def reference_name = reference.name
"""
cellranger \\
vdj \\
--id='${prefix}' \\
--fastqs=. \\
--reference=$reference_name \\
--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:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p "${meta.id}/outs/"
touch ${meta.id}/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
"""
}
44 changes: 44 additions & 0 deletions modules/nf-core/cellranger/vdj/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: cellranger_vdj
description: Module to use Cell Ranger's pipelines analyze sequencing data produced from Chromium Single Cell Immune Profiling.
keywords:
- align
- vdj
- reference
- immunoprofiling
- single-cell
- cellranger
tools:
- cellranger:
description: Cell Ranger processes data from 10X Genomics Chromium kits. `cellranger vdj` takes FASTQ files from `cellranger mkfastq` or `bcl2fastq` for V(D)J libraries and performs sequence assembly and paired clonotype calling. It uses the Chromium cellular barcodes and UMIs to assemble V(D)J transcripts per cell. Clonotypes and CDR3 sequences are output as a `.vloupe` file which can be loaded into Loupe V(D)J Browser.
homepage: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/what-is-cell-ranger
documentation: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/tutorial/tutorial-vdj
tool_dev_url: https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/tutorial/tutorial-vdj
licence: 10x Genomics EULA
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
klkeys marked this conversation as resolved.
Show resolved Hide resolved
pattern: "${Sample_Name}_S1_L00${Lane_Number}_${I1,I2,R1,R2}_001.fastq.gz"
- reference:
type: directory
description: Folder containing all the reference indices needed by Cell Ranger
output:
- outs:
type: file
description: Files containing the outputs of Cell Ranger, see official 10X Genomics documentation for a complete list
pattern: "${meta.id}/outs/*"
klkeys marked this conversation as resolved.
Show resolved Hide resolved
- versions:
type: file
description: File containing software version
pattern: "versions.yml"
authors:
- "@ggabernet"
- "@Emiller88"
- "@klkeys"
20 changes: 12 additions & 8 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -625,12 +625,8 @@ cellranger/count:
- tests/modules/nf-core/cellranger/count/**
- modules/nf-core/cellranger/mkref/**
- tests/modules/nf-core/cellranger/mkref/**
- modules/nf-core/cellranger/gtf/**
- tests/modules/nf-core/cellranger/gtf/**

cellranger/gtf:
- modules/nf-core/cellranger/gtf/**
- tests/modules/nf-core/cellranger/gtf/**
- modules/nf-core/cellranger/mkgtf/**
- tests/modules/nf-core/cellranger/mkgtf/**

cellranger/mkfastq:
- modules/nf-core/cellranger/mkfastq/**
Expand All @@ -643,8 +639,16 @@ cellranger/mkgtf:
cellranger/mkref:
- modules/nf-core/cellranger/mkref/**
- tests/modules/nf-core/cellranger/mkref/**
- modules/nf-core/cellranger/gtf/**
- tests/modules/nf-core/cellranger/gtf/**
- modules/nf-core/cellranger/mkgtf/**
- tests/modules/nf-core/cellranger/mkgtf/**

cellranger/mkvdjref:
- modules/nf-core/cellranger/mkvdjref/**
- tests/modules/nf-core/cellranger/mkvdjref/**

cellranger/vdj:
- modules/nf-core/cellranger/vdj/**
- tests/modules/nf-core/cellranger/vdj/**

centrifuge/centrifuge:
- modules/nf-core/centrifuge/centrifuge/**
Expand Down
Loading