mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
Add postprocessing option to hmmer/eslreformat (#2061)
* Add postprocessing option to hmmer/eslreformat * Update tests/modules/hmmer/eslreformat/nextflow.config Co-authored-by: Daniel Straub <42973691+d4straub@users.noreply.github.com> * Update modules/hmmer/eslreformat/main.nf Co-authored-by: Daniel Straub <42973691+d4straub@users.noreply.github.com> Co-authored-by: Daniel Straub <42973691+d4straub@users.noreply.github.com>
This commit is contained in:
parent
8c0127e071
commit
885e724e07
4 changed files with 43 additions and 8 deletions
|
@ -18,15 +18,16 @@ process HMMER_ESLREFORMAT {
|
||||||
task.ext.when == null || task.ext.when
|
task.ext.when == null || task.ext.when
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
|
// Use for any postprocessing of the sequence file, e.g. removal of gap characters
|
||||||
|
def postproc = task.ext.postprocessing ?: ""
|
||||||
"""
|
"""
|
||||||
esl-reformat \\
|
esl-reformat \\
|
||||||
-o ${prefix}.sequences \\
|
|
||||||
$args \\
|
$args \\
|
||||||
$seqfile
|
$seqfile \\
|
||||||
|
$postproc \\
|
||||||
gzip ${prefix}.sequences
|
| gzip -c > ${prefix}.sequences.gz
|
||||||
|
|
||||||
cat <<-END_VERSIONS > versions.yml
|
cat <<-END_VERSIONS > versions.yml
|
||||||
"${task.process}":
|
"${task.process}":
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
nextflow.enable.dsl = 2
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
include { HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf'
|
include { HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf'
|
||||||
include { HMMER_ESLREFORMAT as HMMER_ESLREFORMAT_AFA } from '../../../../modules/hmmer/eslreformat/main.nf'
|
include { HMMER_ESLREFORMAT as HMMER_ESLREFORMAT_AFA } from '../../../../modules/hmmer/eslreformat/main.nf'
|
||||||
|
include { HMMER_ESLREFORMAT as HMMER_ESLREFORMAT_UNALIGN } from '../../../../modules/hmmer/eslreformat/main.nf'
|
||||||
|
|
||||||
workflow test_hmmer_eslreformat_afa {
|
workflow test_hmmer_eslreformat_afa {
|
||||||
|
|
||||||
|
@ -18,3 +19,17 @@ workflow test_hmmer_eslreformat_afa {
|
||||||
|
|
||||||
HMMER_ESLREFORMAT_AFA ( HMMER_HMMALIGN.out.sthlm )
|
HMMER_ESLREFORMAT_AFA ( HMMER_HMMALIGN.out.sthlm )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
workflow test_hmmer_eslreformat_unalign {
|
||||||
|
|
||||||
|
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_UNALIGN ( HMMER_HMMALIGN.out.sthlm )
|
||||||
|
}
|
||||||
|
|
|
@ -6,4 +6,9 @@ process {
|
||||||
ext.args = 'afa'
|
ext.args = 'afa'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
withName: HMMER_ESLREFORMAT_UNALIGN {
|
||||||
|
ext.args = '--gapsym=- afa'
|
||||||
|
ext.postprocessing = '| sed "/^>/!s/-//g"'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,20 @@
|
||||||
- path: output/hmmer/test.sequences.gz
|
- path: output/hmmer/test.sequences.gz
|
||||||
contains:
|
contains:
|
||||||
- ">CP025268.1"
|
- ">CP025268.1"
|
||||||
|
- "aaa---UUGAAGAGUUUGAUCAUGGCUCAGAUUGAACGCUGGCGGCAGGCCUAACACAUG"
|
||||||
|
- path: output/hmmer/versions.yml
|
||||||
|
contains:
|
||||||
|
- "easel:"
|
||||||
|
- name: hmmer eslreformat test_hmmer_eslreformat_unalign
|
||||||
|
command: nextflow run ./tests/modules/hmmer/eslreformat -entry test_hmmer_eslreformat_unalign -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"
|
||||||
|
- "aaaUUGAAGAGUUUGAUCAUGGCUCAGAUUGAACGCUGGCGGCAGGCCUAACACAUG"
|
||||||
- path: output/hmmer/versions.yml
|
- path: output/hmmer/versions.yml
|
||||||
contains:
|
contains:
|
||||||
- "easel:"
|
- "easel:"
|
||||||
|
|
Loading…
Reference in a new issue