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

Updated mkfastq module #5984

Merged
merged 4 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
34 changes: 23 additions & 11 deletions modules/nf-core/cellranger/mkfastq/main.nf
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
process CELLRANGER_MKFASTQ {
tag "mkfastq"
tag {"$meta.lane" ? "$meta.id"+"."+"$meta.lane" : "$meta.id" }
label 'process_medium'

container "nf-core/cellrangermkfastq:8.0.0"

input:
path bcl
path csv
tuple val(meta), path(csv), path(bcl)

output:
path "**/outs/fastq_path/*.fastq.gz", emit: fastq
path "versions.yml" , emit: versions
tuple val(meta), path("*_outs/outs/fastq_path/*.fastq.gz"), emit: fastq
tuple val(meta), path("*_outs/outs/fastq_path/Reports") , emit: reports
tuple val(meta), path("*_outs/outs/fastq_path/Stats") , emit: stats
tuple val(meta), path("*_outs/outs/interop_path/*.bin") , emit: interop
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -21,11 +23,11 @@ process CELLRANGER_MKFASTQ {
error "CELLRANGER_MKFASTQ module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${bcl.getSimpleName()}"
def prefix = task.ext.prefix ?: "${meta.id}" //run_dir (bcl) and id must be different because a folder is created with the id value
"""
cellranger \\
mkfastq \\
--id=${prefix} \\
--id=${prefix}_outs \\
--run=$bcl \\
--csv=$csv \\
$args
Expand All @@ -41,17 +43,27 @@ process CELLRANGER_MKFASTQ {
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "CELLRANGER_MKFASTQ module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def prefix = task.ext.prefix ?: "${bcl.getSimpleName()}"
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p "${prefix}/outs/fastq_path/"
mkdir -p "${prefix}_outs/outs/fastq_path/"
# data with something to avoid breaking nf-test java I/O stream
cat <<-FAKE_FQ > ${prefix}/outs/fastq_path/fake_file.fastq
cat <<-FAKE_FQ > ${prefix}_outs/outs/fastq_path/fake_file.fastq
@SEQ_ID
GATTTGGGGTTCAAAGCAGTATCGATCAAATAGTAAATCCATTTGTTCAACTCACAGTTT
+
!''*((((***+))%%%++)(%%%%).1***-+*''))**55CCF>>>>>>CCCCCCC65
FAKE_FQ
gzip -n ${prefix}/outs/fastq_path/fake_file.fastq
gzip -n ${prefix}_outs/outs/fastq_path/fake_file.fastq

# data for reports output channel
mkdir -p "${prefix}_outs/outs/fastq_path/Reports"

# data for stats output channel
mkdir -p "${prefix}_outs/outs/fastq_path/Stats"

# data for interops output channel
mkdir -p "${prefix}_outs/outs/interop_path/"
touch "${prefix}_outs/outs/interop_path/IndexMetricsOut.bin"

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
11 changes: 4 additions & 7 deletions modules/nf-core/cellranger/mkfastq/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nextflow_process {
process {
"""
input[0] = [
[],
[ id: 'test', lane:1 ],
file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-1.2.0.tar.gz", checkIfExists: true)
]
"""
Expand All @@ -31,8 +31,7 @@ nextflow_process {
when {
process {
"""
input[0] = UNTAR.out.untar.map{ it[1] }
input[1] = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-simple-1.2.0.csv", checkIfExists: true)
input[0] = UNTAR.out.untar.map{ it -> [ [ id: 'test', lane:1 ], file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-simple-1.2.0.csv", checkIfExists: true), it[1] ] }
"""
}
}
Expand All @@ -51,8 +50,7 @@ nextflow_process {
when {
process {
"""
input[0] = UNTAR.out.untar.map{ it[1] }
input[1] = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-samplesheet-1.2.0.csv", checkIfExists: true)
input[0] = UNTAR.out.untar.map{ it -> [ [ id: 'test', lane:1 ], file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-samplesheet-1.2.0.csv", checkIfExists: true), it[1] ] }
"""
}
}
Expand All @@ -73,8 +71,7 @@ nextflow_process {
when {
process {
"""
input[0] = UNTAR.out.untar.map{ it[1] }
input[1] = file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-simple-1.2.0.csv", checkIfExists: true)
input[0] = UNTAR.out.untar.map{ it -> [ [ id: 'test', lane:1 ], file("https://cf.10xgenomics.com/supp/cell-exp/cellranger-tiny-bcl-simple-1.2.0.csv", checkIfExists: true), it[1] ] }
"""
}
}
Expand Down
Loading
Loading