diff --git a/modules/nf-core/icountmini/metagene/main.nf b/modules/nf-core/icountmini/metagene/main.nf new file mode 100644 index 00000000000..d6a01476b9e --- /dev/null +++ b/modules/nf-core/icountmini/metagene/main.nf @@ -0,0 +1,48 @@ +process ICOUNTMINI_METAGENE { + tag "$meta.id" + label 'process_low' + + conda "bioconda::icount-mini=3.0.0" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/icount-mini:3.0.0--pyh7cba7a3_0': + 'biocontainers/icount-mini:3.0.0--pyh7cba7a3_0' }" + + input: + tuple val(meta), path(bed) + path segmentation + + output: + tuple val(meta), path("metagene_*/*plot_data.tsv"), emit: tsv + 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}" + + """ + mv $bed ${prefix}.bed + + iCount-Mini metagene \\ + ${prefix}.bed \\ + $segmentation \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + iCount-Mini: \$(iCount-Mini -v) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch metagene_${prefix}/${prefix}_plot_data.tsv + cat <<-END_VERSIONS > versions.yml + "${task.process}": + iCount-Mini: \$(iCount-Mini -v) + END_VERSIONS + """ +} diff --git a/modules/nf-core/icountmini/metagene/meta.yml b/modules/nf-core/icountmini/metagene/meta.yml new file mode 100644 index 00000000000..e5ad0e55a10 --- /dev/null +++ b/modules/nf-core/icountmini/metagene/meta.yml @@ -0,0 +1,44 @@ +--- +name: icountmini_metagene +description: Plot a metagene of cross-link events/sites around various transcriptomic landmarks. +keywords: + - iCLIP + - gtf + - genomics +tools: + - icount: + description: Computational pipeline for analysis of iCLIP data + homepage: https://icount.readthedocs.io/en/latest/ + documentation: https://icount.readthedocs.io/en/latest/ + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file of crosslinks + - segmentation: + type: file + description: A iCount segmentation file + pattern: "*.{gtf}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tsv: + type: file + description: Metagene table + pattern: "*.tsv" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@marc-jones" + - "@chris-cheshire" + - "@charlotteanne" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4c7c32f8b58..267df7d4455 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1897,6 +1897,10 @@ ichorcna/run: - modules/nf-core/ichorcna/run/** - tests/modules/nf-core/ichorcna/run/** +icountmini/metagene: + - modules/nf-core/icountmini/metagene/** + - tests/modules/nf-core/icountmini/metagene/** + icountmini/peaks: - modules/nf-core/icountmini/peaks/** - tests/modules/nf-core/icountmini/peaks/** diff --git a/tests/modules/nf-core/icountmini/metagene/main.nf b/tests/modules/nf-core/icountmini/metagene/main.nf new file mode 100644 index 00000000000..ef5fa20ed8d --- /dev/null +++ b/tests/modules/nf-core/icountmini/metagene/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ICOUNTMINI_SEGMENT } from '../../../../../modules/nf-core/icountmini/segment/main.nf' +include { ICOUNTMINI_METAGENE} from '../../../../../modules/nf-core/icountmini/metagene/main.nf' + +workflow test_icountmini_metagene { + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_21_gencode_gtf'], checkIfExists: true) + ] + + ICOUNTMINI_SEGMENT ( + input, + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ) + + bed = [ + [ id:'test' ], // meta map + file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true) + ] + + ICOUNTMINI_METAGENE ( + bed, + ICOUNTMINI_SEGMENT.out.gtf.map{ it[1] } + ) +} + diff --git a/tests/modules/nf-core/icountmini/metagene/nextflow.config b/tests/modules/nf-core/icountmini/metagene/nextflow.config new file mode 100644 index 00000000000..50f50a7a357 --- /dev/null +++ b/tests/modules/nf-core/icountmini/metagene/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/nf-core/icountmini/metagene/test.yml b/tests/modules/nf-core/icountmini/metagene/test.yml new file mode 100644 index 00000000000..0e9994b0aa8 --- /dev/null +++ b/tests/modules/nf-core/icountmini/metagene/test.yml @@ -0,0 +1,9 @@ +- name: icountmini metagene test_icountmini_metagene + command: nextflow run ./tests/modules/nf-core/icountmini/metagene -entry test_icountmini_metagene -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/icountmini/metagene/nextflow.config + tags: + - icountmini + - icountmini/metagene + files: + - path: output/icountmini/metagene_test/test_plot_data.tsv + md5sum: 63032c9e159e81f617e30bcb1c3c8509 + - path: output/icountmini/versions.yml