add test_bam and -m parameter for motus_profile

This commit is contained in:
JIANHONG OU 2022-05-06 08:56:42 -04:00
parent c301a406dd
commit 9b50036e9b
4 changed files with 35 additions and 4 deletions

View file

@ -14,6 +14,7 @@ process MOTUS_PROFILE {
output:
tuple val(meta), path("*.out"), emit: out
tuple val(meta), path("*.bam"), optional: true, emit: bam
tuple val(meta), path("*.mgc"), optional: true, emit: mgc
path "versions.yml" , emit: versions
when:
@ -24,8 +25,9 @@ process MOTUS_PROFILE {
def prefix = task.ext.prefix ?: "${meta.id}"
def inputs = "$reads[0]".getExtension == ('.bam') ?
"-i ${reads}" :
meta.single_end ?
"-s $reads" : "-f ${reads[0]} -r ${reads[1]}"
meta.mgc ? "-m $reads" :
meta.single_end ?
"-s $reads" : "-f ${reads[0]} -r ${reads[1]}"
def refdb = db ? "-db ${db}" : ""
"""
motus profile \\

View file

@ -20,14 +20,18 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
If input file is the mgc read counts table, the mgc should be set to `true`
e.g. [ id:'test', single_end:false, mgc:true ]
- reads:
type: file
description: |
List of input fastq/fasta files of size 1 and 2 for single-end and paired-end data,
respectively.
Or the intermediate bam file mapped by bwa to the mOTUs database or
the output bam file from motus profile
pattern: "*.{fastq,fq,fasta,fa,fastq.gz,fq.gz,fasta.gz,fa.gz,.bam}"
the output bam file from motus profile.
Or the intermediate mgc read counts table. Please note if mgc table is input,
the `mgc` in metadata must be `true`.
pattern: "*.{fastq,fq,fasta,fa,fastq.gz,fq.gz,fasta.gz,fa.gz,.bam,.tsv,.txt,.mgc}"
- db:
type: directory
description: |
@ -51,6 +55,10 @@ output:
type: file
description: Optional intermediate sorted BAM file from BWA
pattern: "*.{bam}"
- mgc:
type: file
description: Optional intermediate mgc read count table file saved with `-M`.
pattern: "*.{mgc}"
authors:
- "@jianhong"

View file

@ -29,3 +29,15 @@ workflow test_motus_profile_paired_end {
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db)
}
workflow test_motus_profile_bam {
input = [
[ id:'test', single_end:false ], // meta map
[ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ]
]
MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py'))
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db)
}

View file

@ -15,3 +15,12 @@
files:
- path: output/motus/test.out
contains: ["#consensus_taxonomy\ttest"]
- name: motus profile test_motus_profile_bam
command: nextflow run tests/modules/motus/profile -entry test_motus_profile_bam -c tests/config/nextflow.config
tags:
- motus
- motus/profile
files:
- path: output/motus/test.out
contains: ["#consensus_taxonomy\ttest"]