Merge pull request #1528 from jianhong/motus_downloaddb

add module motus_downloaddb
This commit is contained in:
JIANHONG OU 2022-05-05 09:37:02 -04:00 committed by GitHub
commit 1be14375ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,39 @@
process MOTUS_DOWNLOADDB {
label 'process_low'
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:
path motus_downloaddb_script
output:
path "db_mOTU/" , emit: db
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def software = "${motus_downloaddb_script.simpleName}_copy.py"
"""
## must copy script file to working directory,
## otherwise the reference_db will be download to bin folder
## other than current directory
cp $motus_downloaddb_script ${software}
python ${software} \\
$args \\
-t $task.cpus
## mOTUs version number is not available from command line.
## mOTUs save the version number in index database folder.
## mOTUs will check the database version is same version as exec version.
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mOTUs: \$(grep motus db_mOTU/db_mOTU_versions | sed 's/motus\\t//g')
END_VERSIONS
"""
}

View file

@ -0,0 +1,39 @@
name: "motus_downloaddb"
description: Download the mOTUs database
keywords:
- classify
- metagenomics
- fastq
- taxonomic profiling
- database
- download
tools:
- "motus":
description: "The mOTU profiler is a computational tool that estimates relative taxonomic abundance of known and currently unknown microbial community members using metagenomic shotgun sequencing data."
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']"
input:
- motus_downloaddb:
type: directory
description: |
The mOTUs downloadDB script source file.
It is the source file installed or
remote source in github such as https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py
pattern: "downloadDB.py"
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- db:
type: directory
description: The mOTUs database directory
pattern: "db_mOTU"
authors:
- "@jianhong"

View file

@ -1254,6 +1254,10 @@ mosdepth:
- modules/mosdepth/**
- tests/modules/mosdepth/**
motus/downloaddb:
- modules/motus/downloaddb/**
- tests/modules/motus/downloaddb/**
msisensor/msi:
- modules/msisensor/msi/**
- tests/modules/msisensor/msi/**

View file

@ -0,0 +1,12 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { MOTUS_DOWNLOADDB } from '../../../../modules/motus/downloaddb/main.nf'
workflow test_motus_downloaddb {
input = file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py')
MOTUS_DOWNLOADDB ( input )
}

View file

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

View file

@ -0,0 +1,7 @@
- name: motus downloaddb test_motus_downloaddb
command: nextflow run tests/modules/motus/downloaddb -entry test_motus_downloaddb -c tests/config/nextflow.config
tags:
- motus
- motus/downloaddb
files:
- path: output/motus/db_mOTU/db_mOTU_versions