diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 985179a..d80983f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -209,6 +209,7 @@ jobs: NFT_DIFF: "pdiff" NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2" run: | + PROFILE=${{ matrix.profile }} NFT_WORKDIR=~ \ nf-test test \ --profile=$PROFILE \ diff --git a/cleanNXF.sh b/cleanNXF.sh new file mode 100755 index 0000000..874b72d --- /dev/null +++ b/cleanNXF.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +rm -rf .nextflow* +echo "Cleaned .nextflow..." +rm -rf .nextflow.pid +echo "Cleaned .nextflow.pid..." +for i in $(ls work | grep -v "conda"); +do + rm -rf "work/$i" +done +echo "Cleaned work..." + +rm -rf output +echo "Cleaned output..." + +rm -rf .pytest_cache +echo "Cleaned .pytest_cache..." + +rm -rf .nf-test +echo "Cleaned .nf-test..." + +rm -rf ./.nf-test.log diff --git a/modules/edta-components/annosine/environment.yml b/modules/edta-components/annosine/environment.yml new file mode 100644 index 0000000..f78a531 --- /dev/null +++ b/modules/edta-components/annosine/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "annosine" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::annosine2=2.0.7" diff --git a/modules/edta-components/annosine/main.nf b/modules/edta-components/annosine/main.nf new file mode 100644 index 0000000..6408b28 --- /dev/null +++ b/modules/edta-components/annosine/main.nf @@ -0,0 +1,58 @@ +process ANNOSINE { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/annosine2:2.0.7--pyh7cba7a3_0': + 'biocontainers/annosine2:2.0.7--pyh7cba7a3_0' }" + + input: + tuple val(meta), path(fasta) + val mode + + output: + tuple val(meta), path("*.fa") , emit: fa , optional: true + 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}" + def VERSION = '2.0.7' // WARN: Manually update when changing Bioconda assets + if ( "$fasta" == "${prefix}.fa" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + AnnoSINE_v2 \\ + $args \\ + --threads $task.cpus \\ + $mode \\ + $fasta \\ + $prefix + + mv \\ + $prefix/Seed_SINE.fa \\ + ${prefix}.fa \\ + || echo 'AnnoSINE_v2 did not find SINE sequences. See log for details!' + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + annosine: $VERSION + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '2.0.7' // WARN: Manually update when changing Bioconda assets + if ( "$fasta" == "${prefix}.fa" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + """ + touch ${prefix}.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + annosine: $VERSION + END_VERSIONS + """ +} diff --git a/modules/edta-components/annosine/meta.yml b/modules/edta-components/annosine/meta.yml new file mode 100644 index 0000000..6e64596 --- /dev/null +++ b/modules/edta-components/annosine/meta.yml @@ -0,0 +1,50 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "annosine" +description: Accelerating de novo SINE annotation in plant and animal genomes +keywords: + - genomics + - SINE + - annotation + - plant +tools: + - "annosine": + description: "AnnoSINE_v2 - SINE Annotation Tool for Plant and Animal Genomes" + homepage: "https://github.com/liaoherui/AnnoSINE_v2" + documentation: "https://github.com/liaoherui/AnnoSINE_v2" + tool_dev_url: "https://github.com/liaoherui/AnnoSINE_v2" + doi: "10.1101/2024.03.01.582874" + licence: ["MIT"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: Input genome assembly + pattern: "*.{fasta,fa,fsa}" + - mode: + type: integer + description: Run mode + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - fa: + type: file + description: Non-redundant SINE library with serial number + pattern: "*.fa" +authors: + - "@GallVp" +maintainers: + - "@GallVp" diff --git a/modules/edta-components/annosine/tests/main.nf.test b/modules/edta-components/annosine/tests/main.nf.test new file mode 100644 index 0000000..d48f8f0 --- /dev/null +++ b/modules/edta-components/annosine/tests/main.nf.test @@ -0,0 +1,61 @@ +nextflow_process { + + name "Test Process ANNOSINE" + script "../main.nf" + process "ANNOSINE" + + tag "modules" + tag "modules_nfcore" + tag "annosine" + + test("actinidia_chinensis-genome_21_fasta_gz") { + + config './nextflow.config' + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + ] + input[1] = 3 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("actinidia_chinensis-genome_21_fasta_gz-stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['actinidia_chinensis']['genome']['genome_21_fasta_gz'], checkIfExists: true) + ] + input[1] = 3 + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/edta-components/annosine/tests/main.nf.test.snap b/modules/edta-components/annosine/tests/main.nf.test.snap new file mode 100644 index 0000000..c333473 --- /dev/null +++ b/modules/edta-components/annosine/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "actinidia_chinensis-genome_21_fasta_gz-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,e4a37dd3eccd5ff39c2262542db40e98" + ], + "fa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e4a37dd3eccd5ff39c2262542db40e98" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T16:58:04.62843" + }, + "actinidia_chinensis-genome_21_fasta_gz": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fa:md5,fc3bd39555133a1b50623bccc7d4cf9b" + ] + ], + "1": [ + "versions.yml:md5,e4a37dd3eccd5ff39c2262542db40e98" + ], + "fa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fa:md5,fc3bd39555133a1b50623bccc7d4cf9b" + ] + ], + "versions": [ + "versions.yml:md5,e4a37dd3eccd5ff39c2262542db40e98" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T16:57:59.09361" + } +} \ No newline at end of file diff --git a/modules/edta-components/annosine/tests/nextflow.config b/modules/edta-components/annosine/tests/nextflow.config new file mode 100644 index 0000000..efdc449 --- /dev/null +++ b/modules/edta-components/annosine/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: ANNOSINE { + ext.args = '-a 2 -rpm 0 --copy_number 1 --shift 200' + } +} diff --git a/modules/edta-components/annosine/tests/tags.yml b/modules/edta-components/annosine/tests/tags.yml new file mode 100644 index 0000000..45b6089 --- /dev/null +++ b/modules/edta-components/annosine/tests/tags.yml @@ -0,0 +1,2 @@ +annosine: + - "modules/edta-components/annosine/**" diff --git a/tests/config/test_data.config b/tests/config/test_data.config index e412f12..4633ce9 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -46,7 +46,7 @@ params { kofamscan_ko_list_gz = "${params.test_data_base}/data/genomics/sarscov2/genome/db/kofamscan/ko_list.gz" metamaps_db = "${params.test_data_base}/data/genomics/sarscov2/genome/db/metamaps_db.tar.gz" - + ncbi_taxmap_zip = "${params.test_data_base}/data/genomics/sarscov2/genome/db/maltextract/ncbi_taxmap.zip" taxon_list_txt = "${params.test_data_base}/data/genomics/sarscov2/genome/db/maltextract/taxon_list.txt" @@ -655,7 +655,7 @@ params { 'genome' { samplesheet = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/samplesheet.csv" genome_gfp_gtf = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/genome_gfp.gtf" - kallisto_results = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/kallisto_results.tar.gz" + kallisto_results = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/kallisto_results.tar.gz" salmon_results = "${params.test_data_base}/data/genomics/eukaryotes/saccharomyces_cerevisiae/salmon_results.tar.gz" } }