mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Add MEGAN/RMA2INFO (#1513)
* fix: remove left-over unnecessary code * Add megan/rma2info * Attempt at fixing test * Right yml formatting * Get the versios reporting correct
This commit is contained in:
parent
897c33d5da
commit
2d38566eca
6 changed files with 130 additions and 0 deletions
38
modules/megan/rma2info/main.nf
Normal file
38
modules/megan/rma2info/main.nf
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
process MEGAN_RMA2INFO {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_low'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::megan=6.21.7" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/megan:6.21.7--h9ee0642_0':
|
||||||
|
'quay.io/biocontainers/megan:6.21.7--h9ee0642_0' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(rma6)
|
||||||
|
val(megan_summary)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.txt.gz") , emit: txt
|
||||||
|
tuple val(meta), path("*.megan"), optional: true, emit: megan_summary
|
||||||
|
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 summary = megan_summary ? "-es ${prefix}.megan" : ""
|
||||||
|
"""
|
||||||
|
rma2info \\
|
||||||
|
-i ${rma6} \\
|
||||||
|
-o ${prefix}.txt.gz \\
|
||||||
|
${summary} \\
|
||||||
|
$args
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
megan: \$(echo \$(rma2info 2>&1) | grep version | sed 's/.*version //g;s/, built.*//g')
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
51
modules/megan/rma2info/meta.yml
Normal file
51
modules/megan/rma2info/meta.yml
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: "megan_rma2info"
|
||||||
|
description: Analyses an RMA file and exports information in text format
|
||||||
|
keywords:
|
||||||
|
- megan
|
||||||
|
- rma6
|
||||||
|
- classification
|
||||||
|
- conversion
|
||||||
|
tools:
|
||||||
|
- "megan":
|
||||||
|
description: "A tool for studying the taxonomic content of a set of DNA reads"
|
||||||
|
homepage: "https://uni-tuebingen.de/fakultaeten/mathematisch-naturwissenschaftliche-fakultaet/fachbereiche/informatik/lehrstuehle/algorithms-in-bioinformatics/software/megan6/"
|
||||||
|
documentation: "https://software-ab.informatik.uni-tuebingen.de/download/megan6/welcome.html"
|
||||||
|
tool_dev_url: "https://github.com/husonlab/megan-ce"
|
||||||
|
doi: "10.1371/journal.pcbi.1004957"
|
||||||
|
licence: "['GPL >=3']"
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- rma6:
|
||||||
|
type: file
|
||||||
|
description: RMA6 file from MEGAN or MALT
|
||||||
|
pattern: "*.rma6"
|
||||||
|
- megan_summary:
|
||||||
|
type: boolean
|
||||||
|
description: Specify whether to generate an MEGAN summary file
|
||||||
|
|
||||||
|
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"
|
||||||
|
- txt:
|
||||||
|
type: file
|
||||||
|
description: Compressed text file
|
||||||
|
pattern: "*.txt.gz"
|
||||||
|
- megan_summary:
|
||||||
|
type: file
|
||||||
|
description: Optionally generated MEGAN summary file
|
||||||
|
pattern: "*.megan"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@jfy133"
|
|
@ -1138,6 +1138,10 @@ megahit:
|
||||||
- modules/megahit/**
|
- modules/megahit/**
|
||||||
- tests/modules/megahit/**
|
- tests/modules/megahit/**
|
||||||
|
|
||||||
|
megan/rma2info:
|
||||||
|
- modules/megan/rma2info/**
|
||||||
|
- tests/modules/megan/rma2info/**
|
||||||
|
|
||||||
meningotype:
|
meningotype:
|
||||||
- modules/meningotype/**
|
- modules/meningotype/**
|
||||||
- tests/modules/meningotype/**
|
- tests/modules/meningotype/**
|
||||||
|
|
16
tests/modules/megan/rma2info/main.nf
Normal file
16
tests/modules/megan/rma2info/main.nf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { MEGAN_RMA2INFO } from '../../../../modules/megan/rma2info/main.nf'
|
||||||
|
|
||||||
|
workflow test_megan_rma2info {
|
||||||
|
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:false ], // meta map
|
||||||
|
file('https://github.com/nf-core/test-datasets/raw/a7e61654553887475a2f7178108587ecd9b54608/data/delete_me/malt/test.rma6', checkIfExists: true)
|
||||||
|
]
|
||||||
|
megan_summary = true
|
||||||
|
|
||||||
|
MEGAN_RMA2INFO ( input, megan_summary )
|
||||||
|
}
|
9
tests/modules/megan/rma2info/nextflow.config
Normal file
9
tests/modules/megan/rma2info/nextflow.config
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
withName: MEGAN_RMA2INFO {
|
||||||
|
ext.args = "-c2c Taxonomy"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
tests/modules/megan/rma2info/test.yml
Normal file
12
tests/modules/megan/rma2info/test.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
- name: megan rma2info test_megan_rma2info
|
||||||
|
command: nextflow run tests/modules/megan/rma2info -entry test_megan_rma2info -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- megan
|
||||||
|
- megan/rma2info
|
||||||
|
files:
|
||||||
|
- path: output/megan/test.megan
|
||||||
|
contains:
|
||||||
|
- "@Creator"
|
||||||
|
- path: output/megan/test.txt.gz
|
||||||
|
md5sum: 5c3b876aa0abef12158bcd7c3702740f
|
||||||
|
- path: output/megan/versions.yml
|
Loading…
Reference in a new issue