Make hmmer/hmmalign output files with correct prefix (#2067)

This commit is contained in:
Daniel Lundin 2022-09-15 14:06:18 +02:00 committed by GitHub
parent 4b1d4bf401
commit 847bebc0ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 2 deletions

View file

@ -25,7 +25,7 @@ process HMMER_HMMALIGN {
hmmalign \\ hmmalign \\
$args \\ $args \\
$hmm \\ $hmm \\
$fasta | gzip -c > ${meta.id}.sthlm.gz $fasta | gzip -c > ${prefix}.sthlm.gz
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":

View file

@ -2,7 +2,8 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf' include { HMMER_HMMALIGN as HMMER_HMMALIGN } from '../../../../modules/hmmer/hmmalign/main.nf'
include { HMMER_HMMALIGN as HMMER_HMMALIGN_PREFIX } from '../../../../modules/hmmer/hmmalign/main.nf'
workflow test_hmmer_hmmalign { workflow test_hmmer_hmmalign {
@ -15,3 +16,15 @@ workflow test_hmmer_hmmalign {
HMMER_HMMALIGN ( input, hmm ) HMMER_HMMALIGN ( input, hmm )
} }
workflow test_hmmer_hmmalign_prefix {
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_PREFIX ( input, hmm )
}

View file

@ -2,4 +2,7 @@ process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: HMMER_HMMALIGN_PREFIX {
ext.prefix = { "${meta.id}.prefix" }
}
} }

View file

@ -6,3 +6,11 @@
files: files:
- path: output/hmmer/test.sthlm.gz - path: output/hmmer/test.sthlm.gz
md5sum: ddaa8b96291edf4e1a929a224329161b md5sum: ddaa8b96291edf4e1a929a224329161b
- name: hmmer hmmalign test_hmmer_hmmalign_prefix
command: nextflow run ./tests/modules/hmmer/hmmalign -entry test_hmmer_hmmalign_prefix -c ./tests/config/nextflow.config -c ./tests/modules/hmmer/hmmalign/nextflow.config
tags:
- hmmer
- hmmer/hmmalign
files:
- path: output/hmmer/test.prefix.sthlm.gz
md5sum: ddaa8b96291edf4e1a929a224329161b