Add hmmer/eslreformat (#2009)

* Created hmmer/eslalimask from template

* esl-alimask module with --rf-is-mask test case

* Add optional file output

* Add hmmer to test name

* Move from process_single to process_low

* Test for versions.yml, plus content

* Prettier

* Avoid gzipping input alignment

* hmmer/eslreformat from template

* Started on main.nf

* meta.id to prefix

* Continued work

* Fix version string so it's from *this* tool

* hmmer/eslreformat

* Prettier

* Get tests/config/pytest_modules.yml back

* Delete extra hmmer/eslalimask in pytest_modules.yml

* More prettier

* Fix path to versions.yml in test

* Remove 'format' param

* Fix problems with format param deletion

* Document format param
This commit is contained in:
Daniel Lundin 2022-09-05 15:21:09 +02:00 committed by GitHub
parent b5e3d16d80
commit 8bc5236371
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,36 @@
process HMMER_ESLREFORMAT {
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--h1b792b2_1':
'quay.io/biocontainers/hmmer:3.3.2--h1b792b2_1' }"
input:
tuple val(meta), path(seqfile)
output:
tuple val(meta), path("*.sequences.gz"), emit: seqreformated
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}"
"""
esl-reformat \\
-o ${prefix}.sequences \\
$args \\
$seqfile
gzip ${prefix}.sequences
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hmmer/easel: \$(esl-reformat -h | grep -o '^# Easel [0-9.]*' | sed 's/^# Easel *//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,41 @@
name: "hmmer_eslreformat"
description: reformats sequence files, see HMMER documentation for details. The module requires that the format is specified in ext.args in a config file, and that this comes last. See the tools help for possible values.
keywords:
- sort
tools:
- "hmmer":
description: "Biosequence analysis using profile hidden Markov models"
homepage: http://hmmer.org/
documentation: http://hmmer.org/documentation.html
tool_dev_url: None
doi: "http://dx.doi.org/10.1371/journal.pcbi.1002195"
licence: ["BSD-3-Clause"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- seqfile:
type: file
description: Sequences, aligned or not, in any supported format
pattern: "*"
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"
- seqreformated:
type: file
description: Reformated sequence file
pattern: "*.sequences.gz"
authors:
- "@erikrikarddaniel"

View file

@ -1154,6 +1154,10 @@ hmmer/eslalimask:
- modules/hmmer/eslalimask/** - modules/hmmer/eslalimask/**
- tests/modules/hmmer/eslalimask/** - tests/modules/hmmer/eslalimask/**
hmmer/eslreformat:
- modules/hmmer/eslreformat/**
- tests/modules/hmmer/eslreformat/**
hmmer/hmmalign: hmmer/hmmalign:
- modules/hmmer/hmmalign/** - modules/hmmer/hmmalign/**
- tests/modules/hmmer/hmmalign/** - tests/modules/hmmer/hmmalign/**

View file

@ -0,0 +1,20 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf'
include { HMMER_ESLREFORMAT as HMMER_ESLREFORMAT_AFA } from '../../../../modules/hmmer/eslreformat/main.nf'
workflow test_hmmer_eslreformat_afa {
input = [
[ id:'test' ], // meta map
file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/hmmer/e_coli_k12_16s.fna.gz') // Change to params.test_data syntax after the data is included in tests/config/test_data.config
]
hmm = file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/hmmer/bac.16S_rRNA.hmm.gz')
HMMER_HMMALIGN ( input, hmm )
HMMER_ESLREFORMAT_AFA ( HMMER_HMMALIGN.out.sthlm )
}

View file

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

View file

@ -0,0 +1,12 @@
- name: hmmer eslreformat test_hmmer_eslreformat_afa
command: nextflow run ./tests/modules/hmmer/eslreformat -entry test_hmmer_eslreformat_afa -c ./tests/config/nextflow.config -c ./tests/modules/hmmer/eslreformat/nextflow.config
tags:
- hmmer/eslreformat
- hmmer
files:
- path: output/hmmer/test.sequences.gz
contains:
- ">CP025268.1"
- path: output/hmmer/versions.yml
contains:
- "easel:"