Add MAFFT module (#1351)

Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>

Co-authored-by: Sateesh <33637490+sateeshperi@users.noreply.github.com>
Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
This commit is contained in:
Thomas A. Christensen II 2022-02-28 07:40:24 +00:00 committed by GitHub
parent 9e0abcc443
commit 841c661cad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 111 additions and 0 deletions

35
modules/mafft/main.nf Normal file
View file

@ -0,0 +1,35 @@
process MAFFT {
tag "$meta.id"
label 'process_high'
conda (params.enable_conda ? "bioconda::mafft=7.490" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mafft:7.490--h779adbc_0':
'quay.io/biocontainers/mafft:7.490--h779adbc_0' }"
input:
tuple val(meta), path(fasta)
output:
tuple val(meta), path("*.fas"), emit: fas
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}"
"""
mafft \\
--thread ${task.cpus} \\
${args} \\
${fasta} \\
> ${prefix}.fas
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mafft: \$(mafft --version 2>&1 | sed 's/^v//' | sed 's/ (.*)//')
END_VERSIONS
"""
}

42
modules/mafft/meta.yml Normal file
View file

@ -0,0 +1,42 @@
name: mafft
description: Multiple sequence alignment using MAFFT
keywords:
- msa
- multiple sequence alignment
tools:
- mafft:
description: Multiple alignment program for amino acid or nucleotide sequences based on fast Fourier transform
homepage: https://mafft.cbrc.jp/alignment/software/
documentation: https://mafft.cbrc.jp/alignment/software/manual/manual.html
tool_dev_url: https://mafft.cbrc.jp/alignment/software/source.html
doi: "10.1093/nar/gkf436"
licence: ['BSD']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: FASTA file containing the sequences to align
pattern: "*.{fa,fasta}"
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"
- fas:
type: file
description: Aligned sequences in FASTA format
pattern: "*.{fas}"
authors:
- "@MillironX"

View file

@ -964,6 +964,10 @@ macs2/callpeak:
- modules/macs2/callpeak/** - modules/macs2/callpeak/**
- tests/modules/macs2/callpeak/** - tests/modules/macs2/callpeak/**
mafft:
- modules/mafft/**
- tests/modules/mafft/**
malt/build: malt/build:
- modules/malt/build/** - modules/malt/build/**
- tests/modules/malt/build_test/** - tests/modules/malt/build_test/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { MAFFT } from '../../../modules/mafft/main.nf'
workflow test_mafft {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['scaffolds_fasta'], checkIfExists: true)
]
MAFFT ( input )
}

View file

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

View file

@ -0,0 +1,9 @@
- name: mafft test_mafft
command: nextflow run tests/modules/mafft -entry test_mafft -c tests/config/nextflow.config
tags:
- mafft
files:
- path: output/mafft/test.fas
md5sum: 23426611f4a0df532b6708f072bd445b
- path: output/mafft/versions.yml
md5sum: b1b5ab3728ae17401808335f1c8f8215