mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-13 05:13:09 +00:00
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:
parent
9e0abcc443
commit
841c661cad
6 changed files with 111 additions and 0 deletions
35
modules/mafft/main.nf
Normal file
35
modules/mafft/main.nf
Normal 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
42
modules/mafft/meta.yml
Normal 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"
|
|
@ -964,6 +964,10 @@ macs2/callpeak:
|
|||
- modules/macs2/callpeak/**
|
||||
- tests/modules/macs2/callpeak/**
|
||||
|
||||
mafft:
|
||||
- modules/mafft/**
|
||||
- tests/modules/mafft/**
|
||||
|
||||
malt/build:
|
||||
- modules/malt/build/**
|
||||
- tests/modules/malt/build_test/**
|
||||
|
|
15
tests/modules/mafft/main.nf
Normal file
15
tests/modules/mafft/main.nf
Normal 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 )
|
||||
}
|
6
tests/modules/mafft/nextflow.config
Normal file
6
tests/modules/mafft/nextflow.config
Normal file
|
@ -0,0 +1,6 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
ext.args = "--auto"
|
||||
|
||||
}
|
9
tests/modules/mafft/test.yml
Normal file
9
tests/modules/mafft/test.yml
Normal 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
|
Loading…
Reference in a new issue