diff --git a/modules/motus/profile/main.nf b/modules/motus/profile/main.nf index 3cf5961c..23ee2531 100644 --- a/modules/motus/profile/main.nf +++ b/modules/motus/profile/main.nf @@ -9,6 +9,8 @@ process MOTUS_PROFILE { input: tuple val(meta), path(reads) + path db + path bam output: tuple val(meta), path("*.out"), emit: out @@ -25,12 +27,16 @@ process MOTUS_PROFILE { "-i ${reads}" : meta.single_end ? "-s $reads" : "-f ${reads[0]} -r ${reads[1]}" + def refdb = db ? "-db ${db}" : "" + def intermediateBam = bam ? "-I $bam" : "" """ motus profile \\ $args \\ $inputs \\ + $refdb \\ + $intermediateBam \\ -t $task.cpus \\ - -n ${prefix} \\ + -n $prefix \\ -o ${prefix}.out cat <<-END_VERSIONS > versions.yml diff --git a/modules/motus/profile/meta.yml b/modules/motus/profile/meta.yml index 94f6a9fc..98b24c45 100644 --- a/modules/motus/profile/meta.yml +++ b/modules/motus/profile/meta.yml @@ -14,7 +14,6 @@ tools: doi: "10.1038/s41467-019-08844-4" licence: "['GPL v3']" -## TODO nf-core: Add a description of all of the variables used as input input: - meta: type: map @@ -31,6 +30,11 @@ input: type: derectory description: | mOTUs database downloaded by `motus downloadDB` + - bam: + type: file + description: | + The intermediate bam file mapped by bwa to the mOTUs database or + the output bam file from motus profile output: - meta: diff --git a/tests/modules/motus/profile/main.nf b/tests/modules/motus/profile/main.nf index 54f51bd8..e6fdc23b 100644 --- a/tests/modules/motus/profile/main.nf +++ b/tests/modules/motus/profile/main.nf @@ -2,7 +2,8 @@ nextflow.enable.dsl = 2 -include { MOTUS_PROFILE } from '../../../../modules/motus/profile/main.nf' +include { MOTUS_DOWNLOADDB } from '../../../../modules/motus/downloaddb/main.nf' +include { MOTUS_PROFILE } from '../../../../modules/motus/profile/main.nf' workflow test_motus_profile_single_end { @@ -11,7 +12,9 @@ workflow test_motus_profile_single_end { file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] - MOTUS_PROFILE ( input ) + MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py')) + + MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db, []) } workflow test_motus_profile_paired_end { @@ -21,6 +24,8 @@ workflow test_motus_profile_paired_end { [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] - MOTUS_PROFILE ( input ) + MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py')) + + MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db, []) }