diff --git a/modules/nf-core/metaeuk/easypredict/main.nf b/modules/nf-core/metaeuk/easypredict/main.nf index 4d809c2f713..5caf38f96fb 100644 --- a/modules/nf-core/metaeuk/easypredict/main.nf +++ b/modules/nf-core/metaeuk/easypredict/main.nf @@ -25,9 +25,17 @@ process METAEUK_EASYPREDICT { def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" """ + if [ -d ${database} ]; then + ## if supplying an mmseqs database as a directory, metaeuk requires the basename of the database + DBBASE=`find ${database}/ -name "*.version" -exec sh -c 'file=\$(basename {}); echo \${file%%.*}' \\;` + DB=`echo "${database}/\${DBBASE}"` + else + DB=${database} + fi + metaeuk easy-predict \\ ${fasta} \\ - ${database} \\ + \${DB} \\ ${prefix} \\ tmp/ \\ ${args} diff --git a/tests/modules/nf-core/metaeuk/easypredict/main.nf b/tests/modules/nf-core/metaeuk/easypredict/main.nf index 8eb73195ad0..5c3c6544b7f 100644 --- a/tests/modules/nf-core/metaeuk/easypredict/main.nf +++ b/tests/modules/nf-core/metaeuk/easypredict/main.nf @@ -2,18 +2,35 @@ nextflow.enable.dsl = 2 -include { METAEUK_EASYPREDICT } from '../../../../../modules/nf-core/metaeuk/easypredict/main.nf' +include { MMSEQS_DATABASES } from '../../../../../modules/nf-core/mmseqs/databases/main.nf' +include { METAEUK_EASYPREDICT as METAEUK_EASYPREDICT_FASTA } from '../../../../../modules/nf-core/metaeuk/easypredict/main.nf' +include { METAEUK_EASYPREDICT as METAEUK_EASYPREDICT_MMSEQS } from '../../../../../modules/nf-core/metaeuk/easypredict/main.nf' -workflow test_metaeuk_easypredict { +workflow test_metaeuk_easypredict_fasta { input = [ [ id:'test', single_end:false ], // meta map file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] - database = [ + fasta = [ file(params.test_data['proteomics']['database']['yeast_ups'], checkIfExists: true) ] - METAEUK_EASYPREDICT ( input, database ) + METAEUK_EASYPREDICT_FASTA ( input, fasta ) + +} + +workflow test_metaeuk_easypredict_mmseqs { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + + MMSEQS_DATABASES ( 'UniProtKB/Swiss-Prot' ) + database = MMSEQS_DATABASES.out.database + + METAEUK_EASYPREDICT_MMSEQS ( input, database ) + } diff --git a/tests/modules/nf-core/metaeuk/easypredict/test.yml b/tests/modules/nf-core/metaeuk/easypredict/test.yml index 6c6d56461e1..63c9be06bd7 100644 --- a/tests/modules/nf-core/metaeuk/easypredict/test.yml +++ b/tests/modules/nf-core/metaeuk/easypredict/test.yml @@ -1,5 +1,5 @@ -- name: metaeuk easypredict test_metaeuk_easypredict - command: nextflow run ./tests/modules/nf-core/metaeuk/easypredict -entry test_metaeuk_easypredict -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/metaeuk/easypredict/nextflow.config +- name: metaeuk easypredict test_metaeuk_easypredict_fasta + command: nextflow run ./tests/modules/nf-core/metaeuk/easypredict -entry test_metaeuk_easypredict_fasta -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/metaeuk/easypredict/nextflow.config tags: - metaeuk/easypredict - metaeuk @@ -13,3 +13,27 @@ - path: output/metaeuk/test.headersMap.tsv md5sum: b3628c76d7385d326bd8a7931d974cff - path: output/metaeuk/versions.yml + +- name: metaeuk easypredict test_metaeuk_easypredict_mmseqs + command: nextflow run ./tests/modules/nf-core/metaeuk/easypredict -entry test_metaeuk_easypredict_mmseqs -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/metaeuk/easypredict/nextflow.config + tags: + - metaeuk/easypredict + - metaeuk + files: + - path: output/metaeuk/test.codon.fas + - path: output/metaeuk/test.fas + - path: output/metaeuk/test.gff + - path: output/metaeuk/test.headersMap.tsv + - path: output/metaeuk/versions.yml + - path: output/mmseqs/mmseqs_database/database + - path: output/mmseqs/mmseqs_database/database.dbtype + - path: output/mmseqs/mmseqs_database/database.index + - path: output/mmseqs/mmseqs_database/database.lookup + - path: output/mmseqs/mmseqs_database/database.source + - path: output/mmseqs/mmseqs_database/database.version + - path: output/mmseqs/mmseqs_database/database_h + - path: output/mmseqs/mmseqs_database/database_h.dbtype + - path: output/mmseqs/mmseqs_database/database_h.index + - path: output/mmseqs/mmseqs_database/database_mapping + - path: output/mmseqs/mmseqs_database/database_taxonomy + - path: output/mmseqs/versions.yml