Skip to content

Commit

Permalink
ADD MODULE: Famsa guidetree (nf-core#3691)
Browse files Browse the repository at this point in the history
* famsa_guidetree module: add

* famsa_guidetree module: add

* Modify meta.yaml -> family to id

* Remove white space

* Fix report of famsa version

* Remove trailing whitespace
  • Loading branch information
luisas authored Aug 4, 2023
1 parent 8aa36d4 commit 2fe424b
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 0 deletions.
49 changes: 49 additions & 0 deletions modules/nf-core/famsa/guidetree/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

process FAMSA_GUIDETREE {
tag "$meta.id"
label 'process_medium'

conda "bioconda::famsa=2.2.2"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/famsa:2.2.2--h9f5acd7_0':
'biocontainers/famsa:2.2.2--h9f5acd7_0' }"

input:
tuple val(meta), path(fasta)

output:
tuple val(meta), path("*.dnd"), emit: tree
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}"
"""
famsa -gt_export \\
$args \\
-t ${task.cpus} \\
${fasta} \\
${prefix}.dnd
cat <<-END_VERSIONS > versions.yml
"${task.process}":
famsa: \$( famsa -help 2>&1 | head -n 2 | tail -n 1 | sed 's/ version //g' )
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.dnd
cat <<-END_VERSIONS > versions.yml
"${task.process}":
famsa: \$( famsa -help 2>&1 | head -n 2 | tail -n 1 | sed 's/ version //g' )
END_VERSIONS
"""
}

48 changes: 48 additions & 0 deletions modules/nf-core/famsa/guidetree/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "famsa_guidetree"
description: Renders a guidetree in famsa
keywords:
- guide tree
- msa
- newick
tools:
- "famsa":
description: "Algorithm for large-scale multiple sequence alignments"
homepage: "https://github.com/refresh-bio/FAMSA"
documentation: "https://github.com/refresh-bio/FAMSA"
tool_dev_url: "https://github.com/refresh-bio/FAMSA"
doi: "10.1038/srep33964"
licence: "['GPL v3']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test']`
- fasta:
type: file
description: Input sequences in FASTA format
pattern: "*.{fa,fasta}"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test']`
- tree:
type: file
description: Guide tree file in Newick format
pattern: "*.{dnd}"

- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@luisas"
4 changes: 4 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,10 @@ falco:
- modules/nf-core/falco/**
- tests/modules/nf-core/falco/**

famsa/guidetree:
- modules/nf-core/famsa/guidetree/**
- tests/modules/nf-core/famsa/guidetree/**

faqcs:
- modules/nf-core/faqcs/**
- tests/modules/nf-core/faqcs/**
Expand Down
15 changes: 15 additions & 0 deletions tests/modules/nf-core/famsa/guidetree/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { FAMSA_GUIDETREE } from '../../../../../modules/nf-core/famsa/guidetree/main.nf'

workflow test_famsa_guidetree {

input = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true)
]

FAMSA_GUIDETREE ( input )
}
6 changes: 6 additions & 0 deletions tests/modules/nf-core/famsa/guidetree/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
process {

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


}
9 changes: 9 additions & 0 deletions tests/modules/nf-core/famsa/guidetree/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: famsa guidetree test_famsa_guidetree
command: nextflow run ./tests/modules/nf-core/famsa/guidetree -entry test_famsa_guidetree -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/famsa/guidetree/nextflow.config
tags:
- famsa/guidetree
- famsa
files:
- path: output/famsa/test.dnd
md5sum: f3ef8b16a7a16cb4548942ebf2e7bad6
- path: output/famsa/versions.yml

0 comments on commit 2fe424b

Please sign in to comment.