mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Add hmmbuild (#1960)
* Fixing test.yml * hmmbuild passing tests * Output meta * Linting problem * Linting problem again * Fix prettier * Update modules/hmmer/hmmbuild/meta.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Fix missing prefix * Accept mxfile param * Output gzipped hmm * Moved input file for test to modules branch * Update modules/hmmer/hmmbuild/meta.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * Describe mxfile * Get LENG 80 check back Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
parent
d0ff29fca3
commit
98642619bd
6 changed files with 124 additions and 0 deletions
44
modules/hmmer/hmmbuild/main.nf
Normal file
44
modules/hmmer/hmmbuild/main.nf
Normal file
|
@ -0,0 +1,44 @@
|
|||
process HMMER_HMMBUILD {
|
||||
tag '$meta.id'
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::hmmer=3.3.2" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/hmmer:3.3.2--h87f3376_2':
|
||||
'quay.io/biocontainers/hmmer:3.3.2--h1b792b2_1' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(alignment)
|
||||
path mxfile
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.hmm.gz"), emit: hmm
|
||||
path "*.hmmbuild.txt", emit: hmmbuildout
|
||||
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 mxfileopt = mxfile ? "--mxfile ${mxfile}" : ""
|
||||
|
||||
"""
|
||||
hmmbuild \\
|
||||
$args \\
|
||||
--cpu $task.cpus \\
|
||||
-n ${prefix} \\
|
||||
-o ${prefix}.hmmbuild.txt \\
|
||||
${mxfileopt} \\
|
||||
${prefix}.hmm \\
|
||||
$alignment
|
||||
|
||||
gzip ${prefix}.hmm
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
hmmer: \$(echo \$(hmmbuild -h | grep HMMER | sed 's/# HMMER //' | sed 's/ .*//' 2>&1))
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
44
modules/hmmer/hmmbuild/meta.yml
Normal file
44
modules/hmmer/hmmbuild/meta.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: "hmmer_hmmbuild"
|
||||
description: create an hmm profile from a multiple sequence alignment
|
||||
keywords:
|
||||
- search
|
||||
- hidden Markov model
|
||||
- HMM
|
||||
- hmmer
|
||||
- hmmsearch
|
||||
tools:
|
||||
- "hmmer":
|
||||
description: "Biosequence analysis using profile hidden Markov models"
|
||||
homepage: "http://hmmer.org"
|
||||
documentation: "http://hmmer.org/documentation.html"
|
||||
tool_dev_url: "https://github.com/EddyRivasLab/hmmer"
|
||||
doi: "10.1371/journal.pcbi.1002195"
|
||||
licence: "['BSD']"
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- alignment:
|
||||
type: file
|
||||
description: multiple sequence alignment in fasta, clustal, stockholm or phylip format
|
||||
pattern: "*"
|
||||
- mxfile:
|
||||
type: file
|
||||
description: read substitution score matrix, for use when building profiles from single sequences (--singlemx option)
|
||||
pattern: "*"
|
||||
|
||||
output:
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- hmm:
|
||||
type: file
|
||||
description: Gzipped HMM file
|
||||
pattern: "*.{hmm.gz}"
|
||||
|
||||
authors:
|
||||
- "@erikrikarddaniel"
|
|
@ -1142,6 +1142,10 @@ hmmer/hmmalign:
|
|||
- modules/hmmer/hmmalign/**
|
||||
- tests/modules/hmmer/hmmalign/**
|
||||
|
||||
hmmer/hmmbuild:
|
||||
- modules/hmmer/hmmbuild/**
|
||||
- tests/modules/hmmer/hmmbuild/**
|
||||
|
||||
hmmer/hmmsearch:
|
||||
- modules/hmmer/hmmsearch/**
|
||||
- tests/modules/hmmer/hmmsearch/**
|
||||
|
|
15
tests/modules/hmmer/hmmbuild/main.nf
Normal file
15
tests/modules/hmmer/hmmbuild/main.nf
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { HMMER_HMMBUILD } from '../../../../modules/hmmer/hmmbuild/main.nf'
|
||||
|
||||
workflow test_hmmer_hmmbuild {
|
||||
|
||||
input = [
|
||||
[ id: 'PF14720' ], // meta map
|
||||
file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/hmmer/PF14720_seed.alnfaa.gz', checkIfExists: true)
|
||||
]
|
||||
|
||||
HMMER_HMMBUILD ( input, [] )
|
||||
}
|
5
tests/modules/hmmer/hmmbuild/nextflow.config
Normal file
5
tests/modules/hmmer/hmmbuild/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
12
tests/modules/hmmer/hmmbuild/test.yml
Normal file
12
tests/modules/hmmer/hmmbuild/test.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
- name: hmmer hmmbuild test_hmmer_hmmbuild
|
||||
command: nextflow run ./tests/modules/hmmer/hmmbuild -entry test_hmmer_hmmbuild -c ./tests/config/nextflow.config -c ./tests/modules/hmmer/hmmbuild/nextflow.config
|
||||
tags:
|
||||
- hmmer
|
||||
- hmmer/hmmbuild
|
||||
files:
|
||||
- path: output/hmmer/PF14720.hmm.gz
|
||||
contains:
|
||||
- "LENG 80"
|
||||
- path: output/hmmer/versions.yml
|
||||
contains:
|
||||
- "hmmer:"
|
Loading…
Reference in a new issue