This commit is contained in:
JIANHONG OU 2022-04-24 07:55:17 -04:00
parent c7def8707b
commit 98d318c0e0
6 changed files with 145 additions and 0 deletions

View file

@ -0,0 +1,41 @@
process MOTUS_PROFILE {
tag "$meta.id"
label 'process_high'
conda (params.enable_conda ? "bioconda::motus=3.0.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/motus:3.0.1--pyhdfd78af_0':
'quay.io/biocontainers/motus:3.0.1--pyhdfd78af_0' }"
input:
tuple val(meta), path(reads)
output:
tuple val(meta), path("*.out"), emit: out
tuple val(meta), path("*.bam"), optional: true, emit: bam
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 inputs = "$reads[0]".toLowerCase().endsWith('.bam') ?
"-i ${reads}" :
meta.single_end ?
"-s $reads" : "-f ${reads[0]} -r ${reads[1]}"
"""
motus profile \\
$args \\
$inputs \\
-t $task.cpus \\
-n ${prefix} \\
-o ${prefix}.out
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mOTUs: \$(echo \$(motus -h 2>&1) | sed 's/^.*Version: //; s/References.*\$//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,55 @@
name: "motus_profile"
description: Taxonomic meta-omics profiling using universal marker genes
keywords:
- classify
- metagenomics
- fastq
- taxonomic profiling
tools:
- "motus":
description: "Marker gene-based OTU (mOTU) profiling"
homepage: "None"
documentation: "https://github.com/motu-tool/mOTUs/wiki"
tool_dev_url: "https://github.com/motu-tool/mOTUs"
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
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: |
List of input fastq/fasta files of size 1 and 2 for single-end and paired-end data,
respectively.
pattern: "*.{fastq,fq,fasta,fa,fastq.gz,fq.gz,fasta.gz,fa.gz}"
- db:
type: derectory
description: |
mOTUs database downloaded by `motus downloadDB`
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- out:
type: file
description: Results with taxonomic classification of each read
pattern: "*.out"
- bam:
type: file
description: Sorted BAM file
pattern: "*.{bam}"
authors:
- "@jianhong"

View file

@ -1194,6 +1194,10 @@ mosdepth:
- modules/mosdepth/**
- tests/modules/mosdepth/**
motus/profile:
- modules/motus/profile/**
- tests/modules/motus/profile/**
msisensor/msi:
- modules/msisensor/msi/**
- tests/modules/msisensor/msi/**

View file

@ -0,0 +1,26 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { MOTUS_PROFILE } from '../../../../modules/motus/profile/main.nf'
workflow test_motus_profile_single_end {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
MOTUS_PROFILE ( input )
}
workflow test_motus_profile_paired_end {
input = [
[ id:'test', single_end:false ], // meta map
[ 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 )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,14 @@
## TODO nf-core: Please run the following command to build this file:
# nf-core modules create-test-yml motus/profile
- name: "motus profile"
command: nextflow run ./tests/modules/motus/profile -entry test_motus_profile -c ./tests/config/nextflow.config -c ./tests/modules/motus/profile/nextflow.config
tags:
- "motus"
#
- "motus/profile"
#
files:
- path: "output/motus/test.bam"
md5sum: e667c7caad0bc4b7ac383fd023c654fc
- path: output/motus/versions.yml
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b