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

View file

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

View file

@ -29,3 +29,15 @@ workflow test_motus_profile_paired_end {
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db) 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: files:
- path: output/motus/test.out - path: output/motus/test.out
contains: ["#consensus_taxonomy\ttest"] 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"]