mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
update motus module.
This commit is contained in:
parent
c8f2c44e22
commit
fb5c5d310a
4 changed files with 30 additions and 25 deletions
|
@ -10,7 +10,6 @@ process MOTUS_PROFILE {
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(reads)
|
tuple val(meta), path(reads)
|
||||||
path db
|
path db
|
||||||
path bam
|
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*.out"), emit: out
|
tuple val(meta), path("*.out"), emit: out
|
||||||
|
@ -28,20 +27,26 @@ process MOTUS_PROFILE {
|
||||||
meta.single_end ?
|
meta.single_end ?
|
||||||
"-s $reads" : "-f ${reads[0]} -r ${reads[1]}"
|
"-s $reads" : "-f ${reads[0]} -r ${reads[1]}"
|
||||||
def refdb = db ? "-db ${db}" : ""
|
def refdb = db ? "-db ${db}" : ""
|
||||||
def intermediateBam = bam ? "-I $bam" : ""
|
|
||||||
"""
|
"""
|
||||||
motus profile \\
|
motus profile \\
|
||||||
$args \\
|
$args \\
|
||||||
$inputs \\
|
$inputs \\
|
||||||
$refdb \\
|
$refdb \\
|
||||||
$intermediateBam \\
|
|
||||||
-t $task.cpus \\
|
-t $task.cpus \\
|
||||||
-n $prefix \\
|
-n $prefix \\
|
||||||
-o ${prefix}.out
|
-o ${prefix}.out
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
if [ "$refdb" == "" ]; then
|
||||||
|
VERSION=\$(echo \$(motus -h 2>&1) | sed 's/^.*Version: //; s/References.*\$//')
|
||||||
|
else
|
||||||
|
VERSION=\$(grep motus $refdb/db_mOTU_versions | sed 's/motus\\t//g')
|
||||||
|
fi
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
mOTUs: \$(echo \$(motus -h 2>&1) | sed 's/^.*Version: //; s/References.*\$//')
|
mOTUs: \$VERSION
|
||||||
END_VERSIONS
|
END_VERSIONS
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,16 +25,13 @@ input:
|
||||||
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.
|
||||||
pattern: "*.{fastq,fq,fasta,fa,fastq.gz,fq.gz,fasta.gz,fa.gz}"
|
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}"
|
||||||
- db:
|
- db:
|
||||||
type: derectory
|
type: derectory
|
||||||
description: |
|
description: |
|
||||||
mOTUs database downloaded by `motus downloadDB`
|
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:
|
output:
|
||||||
- meta:
|
- meta:
|
||||||
|
|
|
@ -8,13 +8,13 @@ include { MOTUS_PROFILE } from '../../../../modules/motus/profile/main.nf'
|
||||||
workflow test_motus_profile_single_end {
|
workflow test_motus_profile_single_end {
|
||||||
|
|
||||||
input = [
|
input = [
|
||||||
[ id:'test', single_end:false ], // meta map
|
[ id:'test', single_end:true ], // meta map
|
||||||
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
|
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
|
||||||
]
|
]
|
||||||
|
|
||||||
MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py'))
|
MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py'))
|
||||||
|
|
||||||
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db, [])
|
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db)
|
||||||
}
|
}
|
||||||
|
|
||||||
workflow test_motus_profile_paired_end {
|
workflow test_motus_profile_paired_end {
|
||||||
|
@ -27,5 +27,5 @@ workflow test_motus_profile_paired_end {
|
||||||
|
|
||||||
MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py'))
|
MOTUS_DOWNLOADDB(file('https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py'))
|
||||||
|
|
||||||
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db, [])
|
MOTUS_PROFILE ( input, MOTUS_DOWNLOADDB.out.db)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
## TODO nf-core: Please run the following command to build this file:
|
- name: motus profile test_motus_profile_single_end
|
||||||
# nf-core modules create-test-yml motus/profile
|
command: nextflow run tests/modules/motus/profile -entry test_motus_profile_single_end -c tests/config/nextflow.config
|
||||||
- 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:
|
tags:
|
||||||
- "motus"
|
- motus
|
||||||
#
|
- motus/profile
|
||||||
- "motus/profile"
|
|
||||||
#
|
|
||||||
files:
|
files:
|
||||||
- path: "output/motus/test.bam"
|
- path: output/motus/test.out
|
||||||
md5sum: e667c7caad0bc4b7ac383fd023c654fc
|
contains: ["#consensus_taxonomy\ttest"]
|
||||||
- path: output/motus/versions.yml
|
|
||||||
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b
|
- name: motus profile test_motus_profile_paired_end
|
||||||
|
command: nextflow run tests/modules/motus/profile -entry test_motus_profile_paired_end -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- motus
|
||||||
|
- motus/profile
|
||||||
|
files:
|
||||||
|
- path: output/motus/test.out
|
||||||
|
contains: ["#consensus_taxonomy\ttest"]
|
||||||
|
|
Loading…
Reference in a new issue