diff --git a/modules/nf-core/ciri2/environment.yml b/modules/nf-core/ciri2/environment.yml new file mode 100644 index 000000000000..bb298e178f57 --- /dev/null +++ b/modules/nf-core/ciri2/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::ciri2=2.0.6" diff --git a/modules/nf-core/ciri2/main.nf b/modules/nf-core/ciri2/main.nf new file mode 100644 index 000000000000..03a90da2ef69 --- /dev/null +++ b/modules/nf-core/ciri2/main.nf @@ -0,0 +1,91 @@ +// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) +// https://github.com/nf-core/modules/tree/master/modules/nf-core/ +// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: +// https://nf-co.re/join +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta +// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty +// list (`[]`) instead of a file can be used to work around this issue. + +process CIRI2 { + tag "$meta.id" + label 'process_single' + + // TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below. + 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:// TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group" + // MUST be provided as an input via a Groovy Map called "meta". + // This information may not be required in some instances e.g. indexing reference genome files: + // https://github.com/nf-core/modules/blob/master/modules/nf-core/bwa/index/main.nf + // TODO nf-core: Where applicable please provide/convert compressed files as input/output + // e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc. + tuple val(meta), path(sam) // Required -I sam_file + path fasta // optional -F reference fasta file + path annotation // optional -A GTF or GFF3 annotation file + path ref_dir // optional -R reference directory path + + output: + // TODO nf-core: Named file extensions MUST be emitted for ALL output channels + tuple val(meta), path("*.txt"), emit: circrna + tuple val(meta), path("*.log"), emit: logfile, optional: true + + // TODO nf-core: Update the command here to obtain the version number of the software used in this module + // TODO nf-core: If multiple software packages are used in this module, all MUST be added here + // by copying the line below and replacing the current tool with the extra tool(s) + tuple val("${task.process}"), val('ciri2'), eval("ciri2 --version"), 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 ? "-A ${annotation}" : "" + def reference = fasta ? "-F ${fasta}" : "-R ${ref_dir}" + // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 + // If the software is unable to output a version number on the command-line then it can be manually specified + // e.g. https://github.com/nf-core/modules/blob/master/modules/nf-core/homer/annotatepeaks/main.nf + // Each software used MUST provide the software name and version number in the YAML version file (versions.yml) + // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "task.ext.args" directive + // TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter + // using the Nextflow "task" variable e.g. "--threads $task.cpus" + // TODO nf-core: Please replace the example samtools command below with your module's command + // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) + """ + perl CIRI2.pl \\ + -I $sam \\ + -O ${prefix}.txt \\ + $reference \\ + $anno \\ + -T $task.cpus \\ + $args + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // TODO nf-core: A stub section should mimic the execution of the original module as best as possible + // Have a look at the following examples: + // Simple example: https://github.com/nf-core/modules/blob/624977dfaf562211e68a8a868ca80acc8461f1ac/modules/nf-core/cutadapt/main.nf#L34-L46 + // Complex example: https://github.com/nf-core/modules/blob/88d43dad73a675e66bff49ebb57fe657a5909018/modules/nf-core/bedtools/split/main.nf#L32-L43 + // TODO nf-core: If the module doesn't use arguments ($args), you SHOULD remove: + // - The definition of args `def args = task.ext.args ?: ''` above. + // - The use of the variable in the script `echo $args ` below. + """ + 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..bf0af47af4f6 --- /dev/null +++ b/modules/nf-core/ciri2/meta.yml @@ -0,0 +1,92 @@ +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: [] + versions_ciri2: + - - ${task.process}: + type: string + description: The name of the process + - ciri2: + type: string + description: The name of the tool + - ciri2 --version: + type: eval + description: The expression to obtain the version of the tool + logfile: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.log": + type: file + description: Output logfile + pattern: "*.{log}" + ontologies: [] +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - ciri2: + type: string + description: The name of the tool + - ciri2 --version: + 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..a357a6490d22 --- /dev/null +++ b/modules/nf-core/ciri2/tests/main.nf.test @@ -0,0 +1,75 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test ciri2 +nextflow_process { + + name "Test Process CIRI2" + script "../main.nf" + process "CIRI2" + + tag "modules" + tag "modules_nfcore" + tag "ciri2" + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used + test("sarscov2 - bam") { + + // TODO nf-core: If you are created a test for a chained module + // (the module requires running more than one process to generate the required output) + // add the 'setup' method here. + // You can find more information about how to use a 'setup' method in the nf-test docs (https://www.nf-test.com/docs/testcases/setup/). + + when { + process { + """ + // TODO nf-core: define inputs of the process here. Example: + + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + ] + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + //TODO nf-core: Add all required assertions to verify the test output. + // See https://nf-co.re/docs/developing/testing/assertions for more information and examples. + ) + } + + } + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + // TODO nf-core: define inputs of the process here. Example: + + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + ] + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + + } + +}