mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 10:48:18 +00:00
Add MAFFT module
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
parent
2383d43a0f
commit
2804e2e2d7
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"
|
|
@ -944,6 +944,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