Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
14 changes: 3 additions & 11 deletions modules/nf-core/crispresso2/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process CRISPRESSO2 {
tuple val(meta), path("CRISPResso_on_*") , emit: results
tuple val(meta), path("*.html") , emit: html
tuple val(meta), path("CRISPResso_on_*/*.txt") , emit: txt
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('crispresso2'), eval("CRISPResso --version 2>&1 | sed 's/CRISPResso //'"), emit: versions_crispresso2, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -32,34 +32,26 @@ process CRISPRESSO2 {
}

"""
export MPLCONFIGDIR=.matplotlib
CRISPResso \\
${read_inputs} \\
--name ${prefix} \\
--output_folder . \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
crispresso2: \$(CRISPResso --version 2>&1 | grep -o 'CRISPResso version [0-9.]*' | sed 's/CRISPResso version //')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
#!/usr/bin/env bash
set -e
export MPLCONFIGDIR=.matplotlib

mkdir -p CRISPResso_on_${prefix}
touch CRISPResso_on_${prefix}/${prefix}.html
touch CRISPResso_on_${prefix}/CRISPResso_report.html
touch CRISPResso_on_${prefix}/CRISPResso_mapping_statistics.txt
touch CRISPResso_on_${prefix}/quantification_of_editing_frequency.txt
touch ${prefix}.html

cat <<-END_VERSIONS > versions.yml
"${task.process}":
crispresso2: 2.3.3
END_VERSIONS
"""
}
41 changes: 26 additions & 15 deletions modules/nf-core/crispresso2/meta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "crispresso2"
description: "A software pipeline for the analysis of genome editing outcomes from
deep sequencing data"
Expand All @@ -15,9 +14,9 @@ tools:
documentation: "https://docs.crispresso.com"
tool_dev_url: "https://github.com/pinellolab/CRISPResso2"
doi: "10.1038/s41587-019-0032-3"
licence: ["MIT"]
licence:
- "MIT"
identifier: biotools:crispresso2

input:
- - meta:
type: map
Expand All @@ -30,8 +29,7 @@ input:
paired-end data, respectively.
pattern: "*.{fastq,fq,fastq.gz,fq.gz}"
ontologies:
- edam: http://edamontology.org/format_1930 # FASTQ

- edam: http://edamontology.org/format_1930
output:
results:
- - meta:
Expand All @@ -54,27 +52,40 @@ output:
description: CRISPResso HTML report
pattern: "*.html"
ontologies:
- edam: http://edamontology.org/format_2331 # HTML
- edam: http://edamontology.org/format_2331
txt:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- "CRISPResso_on_*/*.txt":
- CRISPResso_on_*/*.txt:
type: file
description: CRISPResso text output files
pattern: "CRISPResso_on_*/*.txt"
ontologies:
- edam: http://edamontology.org/format_2330 # Textual format
- edam: http://edamontology.org/format_2330
versions_crispresso2:
- - ${task.process}:
type: string
description: The name of the process
- crispresso2:
type: string
description: The name of the tool
- CRISPResso --version 2>&1 | sed 's/CRISPResso //':
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"

ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- crispresso2:
type: string
description: The name of the tool
- CRISPResso --version 2>&1 | sed 's/CRISPResso //':
type: eval
description: The expression to obtain the version of the tool
authors:
- "@sathyasjali"
maintainers:
Expand Down
32 changes: 19 additions & 13 deletions modules/nf-core/crispresso2/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ nextflow_process {
}

then {
assertAll(
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("single_end_versions") },
{ assert process.out.results[0][1].size() > 0 },
{ assert process.out.html[0][1].size() > 0 },
{ assert process.out.txt[0][1].size() > 0 }
{ assert snapshot(
process.out.results[0][1].size(),
file(process.out.html[0][1]).name,
process.out.txt[0][1].size(),
process.out.findAll { key, val -> key.startsWith("versions")}
).match() },
)
}
}
Expand All @@ -55,10 +57,12 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("paired_end_versions") },
{ assert process.out.results[0][1].size() > 0 },
{ assert process.out.html[0][1].size() > 0 },
{ assert process.out.txt[0][1].size() > 0 }
{ assert snapshot(
process.out.results[0][1].size(),
process.out.html[0][1].collect{ html -> file(html).name }.sort(),
process.out.txt[0][1].size(),
process.out.findAll { key, val -> key.startsWith("versions")}
).match() },
)
}
}
Expand All @@ -81,10 +85,12 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("nhej_analysis_versions") },
{ assert process.out.results[0][1].size() > 0 },
{ assert process.out.html[0][1].size() > 0 },
{ assert process.out.txt[0][1].size() > 0 }
{ assert snapshot(
process.out.results[0][1].size(),
file(process.out.html[0][1]).name,
process.out.txt[0][1].size(),
process.out.findAll { key, val -> key.startsWith("versions")}
).match() },
)
}
}
Expand Down
76 changes: 53 additions & 23 deletions modules/nf-core/crispresso2/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,38 +1,68 @@
{
"paired_end_versions": {
"crispresso2 - paired_end": {
"content": [
2,
[
"versions.yml:md5,2c04a720d2ac80a8651db90eaa1e8c35"
]
"CRISPResso_on_paired_test.html",
"fastp.html"
],
9,
{
"versions_crispresso2": [
[
"CRISPRESSO2",
"crispresso2",
"2.3.3"
]
]
}
],
"timestamp": "2026-03-13T14:56:09.120398517",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2025-09-04T10:40:04.221264"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"nhej_analysis_versions": {
"crispresso2 - nhej_analysis": {
"content": [
[
"versions.yml:md5,2c04a720d2ac80a8651db90eaa1e8c35"
]
2,
"CRISPResso_on_nhej_test.html",
9,
{
"versions_crispresso2": [
[
"CRISPRESSO2",
"crispresso2",
"2.3.3"
]
]
}
],
"timestamp": "2026-03-13T15:34:17.493407027",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2025-09-04T10:40:15.66427"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"single_end_versions": {
"crispresso2 - single_end": {
"content": [
[
"versions.yml:md5,2c04a720d2ac80a8651db90eaa1e8c35"
]
2,
"CRISPResso_on_test.html",
9,
{
"versions_crispresso2": [
[
"CRISPRESSO2",
"crispresso2",
"2.3.3"
]
]
}
],
"timestamp": "2026-03-13T15:32:17.852481198",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2025-09-04T10:39:52.068269"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
}
}
Loading