Add MEGAN/DAA2INFO (#1848)

* Add daa2info

* Add right flag in the config

* Fix config

* Apply suggestions from code review

Co-authored-by: Jose Espinosa-Carrasco <kadomu@gmail.com>

Co-authored-by: Jose Espinosa-Carrasco <kadomu@gmail.com>
This commit is contained in:
James A. Fellows Yates 2022-07-05 09:36:22 +02:00 committed by GitHub
parent fa37e06626
commit 6702d2e145
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 133 additions and 0 deletions

View file

@ -0,0 +1,38 @@
process MEGAN_DAA2INFO {
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(daa)
val(megan_summary)
output:
tuple val(meta), path("*.txt.gz") , emit: txt_gz
tuple val(meta), path("*.megan"), optional: true, emit: megan
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" : ""
"""
daa2info \\
-i ${daa} \\
-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
"""
}

View file

@ -0,0 +1,52 @@
name: "megan_daa2info"
description: Analyses a DAA file and exports information in text format
keywords:
- megan
- diamond
- daa
- 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 ]
- daa:
type: file
description: DAA file from DIAMOND
pattern: "*.daa"
- megan_summary:
type: boolean
description: Specify whether to generate a 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_gz:
type: file
description: Compressed text file
pattern: "*.txt.gz"
- megan:
type: file
description: Optionally generated MEGAN summary file
pattern: "*.megan"
authors:
- "@jfy133"

View file

@ -1378,6 +1378,10 @@ megahit:
- modules/megahit/**
- tests/modules/megahit/**
megan/daa2info:
- modules/megan/daa2info/**
- tests/modules/megan/daa2info/**
megan/rma2info:
- modules/megan/rma2info/**
- tests/modules/megan/rma2info/**

View file

@ -0,0 +1,20 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { DIAMOND_MAKEDB } from '../../../../modules/diamond/makedb/main.nf'
include { DIAMOND_BLASTX } from '../../../../modules/diamond/blastx/main.nf'
include { MEGAN_DAA2INFO } from '../../../../modules/megan/daa2info/main.nf'
workflow test_megan_daa2info {
db = [ file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['proteome_fasta'], checkIfExists: true) ]
fasta = [ file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true) ]
out_ext = 'daa'
blast_columns = []
megan_summary = true
DIAMOND_MAKEDB ( db )
DIAMOND_BLASTX ( [ [id:'test'], fasta ], DIAMOND_MAKEDB.out.db, out_ext, blast_columns )
MEGAN_DAA2INFO ( DIAMOND_BLASTX.out.daa, megan_summary )
}

View file

@ -0,0 +1,9 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: MEGAN_DAA2INFO {
ext.args = "-l"
}
}

View file

@ -0,0 +1,10 @@
- name: megan daa2info test_megan_daa2info
command: nextflow run ./tests/modules/megan/daa2info -entry test_megan_daa2info -c ./tests/config/nextflow.config -c ./tests/modules/megan/daa2info/nextflow.config
tags:
- megan/daa2info
- megan
files:
- path: output/megan/test.megan
contains: ["@Creator"]
- path: output/megan/test.txt.gz
contains: ["# Number of reads: 1"]