diff --git a/modules/nf-core/ciri2/environment.yml b/modules/nf-core/ciri2/environment.yml new file mode 100644 index 000000000000..f99a93e84427 --- /dev/null +++ b/modules/nf-core/ciri2/environment.yml @@ -0,0 +1,6 @@ +--- +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::ciri2=2.0.6=pl5321hdfd78af_0" diff --git a/modules/nf-core/ciri2/main.nf b/modules/nf-core/ciri2/main.nf new file mode 100644 index 000000000000..3b4de85c672e --- /dev/null +++ b/modules/nf-core/ciri2/main.nf @@ -0,0 +1,54 @@ + +process CIRI2 { + tag "$meta.id" + label 'process_single' + + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ciri2:2.0.6--pl5321hdfd78af_0': + 'quay.io/biocontainers/ciri2:2.0.6--pl5321hdfd78af_0' }" + + input: + tuple val(meta), path(sam) // Required input sam_file + path fasta // optional reference fasta file + path annotation // optional GTF or GFF3 annotation file + path ref_dir // optional reference directory path + + output: + + tuple val(meta), path("*.txt"), emit: circrna + tuple val(meta), path("*.txt.log"), emit: log, optional: true + tuple val(meta), path("CIRIerror.log"), emit: error_log, optional: true + + tuple val("${task.process}"), val('CIRI2.pl'), eval("CIRI2.pl --help | sed -n 's/^Version:\\s*//p'"), topic: versions, emit: versions_ciri2 + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def anno = annotation ? "--anno ${annotation}" : "" + def reference = fasta ? "--ref_file ${fasta}" : "--ref_dir ${ref_dir}" + + """ + CIRI2.pl \\ + --in $sam \\ + --out ${prefix}.txt \\ + $reference \\ + $anno \\ + --thread_num $task.cpus \\ + $args + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + echo $args + + touch ${prefix}.txt + """ +} diff --git a/modules/nf-core/ciri2/meta.yml b/modules/nf-core/ciri2/meta.yml new file mode 100644 index 000000000000..d6ef42626b85 --- /dev/null +++ b/modules/nf-core/ciri2/meta.yml @@ -0,0 +1,103 @@ +name: "ciri2" +description: Circular RNA identification based on multiple seed matching +keywords: + - circRNA + - detection + - genomics + - transcriptomics +tools: + - "ciri2": + description: "CIRI2: Circular RNA identification based on multiple seed matching" + homepage: "https://ciri-cookbook.readthedocs.io/en/latest/CIRI2.html" + documentation: "https://ciri-cookbook.readthedocs.io/en/latest/CIRI2.html" + tool_dev_url: "https://github.com/bioinfo-biols/CIRI-full/tree/master/bin/CIRI_v2.0.6" + doi: "10.1093/bib/bbx014" + licence: + - "GPL-2.0-only" + identifier: "biotools:ciri2" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - sam: + type: file + description: Raw SAM file from BWA + pattern: "*.{sam}" + ontologies: + - edam: "http://edamontology.org/format_3462" + - fasta: + type: file + description: Fasta file for reference sequence + pattern: "*.{fasta, fa}" + ontologies: + - edam: "http://edamontology.org/format_1929" + - annotation: + type: file + description: GTF or GFF3 annotation file + pattern: "*.{gtf, gff, gff3}" + ontologies: + - edam: "http://edamontology.org/format_2305" + - ref_dir: + type: directory + description: Directory containing reference files +output: + circrna: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.txt": + type: file + description: Output file containing circRNA list + pattern: "*.{txt}" + ontologies: [] + log: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.txt.log": + type: file + description: Output log file + pattern: "*.{txt.log}" + ontologies: [] + error_log: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - CIRIerror.log: + type: file + description: Output error log file + pattern: "CIRIerror.log" + ontologies: [] + versions_ciri2: + - - ${task.process}: + type: string + description: The name of the process + - CIRI2.pl: + type: string + description: The name of the tool + - CIRI2.pl --help | sed -n 's/^Version:\s*//p': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - CIRI2.pl: + type: string + description: The name of the tool + - CIRI2.pl --help | sed -n 's/^Version:\s*//p': + type: eval + description: The expression to obtain the version of the tool +authors: + - "@razmia02" +maintainers: + - "@razmia02" diff --git a/modules/nf-core/ciri2/tests/main.nf.test b/modules/nf-core/ciri2/tests/main.nf.test new file mode 100644 index 000000000000..94869c0f3547 --- /dev/null +++ b/modules/nf-core/ciri2/tests/main.nf.test @@ -0,0 +1,85 @@ +nextflow_process { + + name "Test Process CIRI2" + script "../main.nf" + process "CIRI2" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "ciri2" + tag "samtools/view" + + setup { + run("SAMTOOLS_VIEW") { + script "../../samtools/view/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end: false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'fasta' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [] + """ + } + } + } + + test("homo_sapiens - sam - pairedend") { + + when { + process { + """ + input[0] = SAMTOOLS_VIEW.out.sam + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.circrna[0][1]).name, + process.out.logfile ? file(process.out.logfile[0][1]).name : null, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + } + + test("homo_sapiens - sam - pairedend -- stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end: false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = [] + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.circrna, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + } +} diff --git a/modules/nf-core/ciri2/tests/main.nf.test.snap b/modules/nf-core/ciri2/tests/main.nf.test.snap new file mode 100644 index 000000000000..9f74062f3dc7 --- /dev/null +++ b/modules/nf-core/ciri2/tests/main.nf.test.snap @@ -0,0 +1,49 @@ +{ + "homo_sapiens - sam - pairedend": { + "content": [ + "test.txt", + null, + { + "versions_ciri2": [ + [ + "CIRI2", + "CIRI2.pl", + "2.0.6" + ] + ] + } + ], + "timestamp": "2026-07-24T19:44:07.04302318", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } + }, + "homo_sapiens - sam - pairedend -- stub": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_ciri2": [ + [ + "CIRI2", + "CIRI2.pl", + "2.0.6" + ] + ] + } + ], + "timestamp": "2026-07-24T19:44:21.142901021", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } + } +} \ No newline at end of file diff --git a/modules/nf-core/ciri2/tests/nextflow.config b/modules/nf-core/ciri2/tests/nextflow.config new file mode 100644 index 000000000000..871a041e2d54 --- /dev/null +++ b/modules/nf-core/ciri2/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'SAMTOOLS_VIEW' { + ext.args = '--output-fmt sam' + } +}