Skip to content

Commit

Permalink
Regressive patch for compression (nf-core#5753)
Browse files Browse the repository at this point in the history
* Regressive patch for compression

* Update tcs test and remove stdout file

* remoe test
  • Loading branch information
luisas authored Jun 5, 2024
1 parent d0e026f commit 1cacace
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 35 deletions.
15 changes: 11 additions & 4 deletions modules/nf-core/tcoffee/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,26 @@ process TCOFFEE_ALIGN {
def prefix = task.ext.prefix ?: "${meta.id}"
def tree_args = tree ? "-usetree $tree" : ""
def template_args = template ? "-template_file $template" : ""
def write_output = compress ? " >(pigz -cp ${task.cpus} > ${prefix}.aln.gz)" : "> ${prefix}.aln"
// using >() is necessary to preserve the tcoffee return value,
// so nextflow knows to display an error when it failed
def outfile = compress ? "stdout" : "${prefix}.aln"
def write_output = compress ? " | pigz -cp ${task.cpus} > ${prefix}.aln.gz" : ""
"""
export TEMP='./'
t_coffee -seq ${fasta} \
$tree_args \
$template_args \
$args \
-thread ${task.cpus} \
-outfile stdout \
-outfile $outfile \
$write_output
# If stdout file exist and compress is true, then compress the file
# This is a patch for the current behaviour of the regressive algorithm
# that does not support the stdout redirection
if [ -f stdout ] && [ "$compress" = true ]; then
pigz -cp ${task.cpus} < stdout > ${prefix}.aln.gz
rm stdout
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
tcoffee: \$( t_coffee -version | awk '{gsub("Version_", ""); print \$3}')
Expand Down
29 changes: 0 additions & 29 deletions modules/nf-core/tcoffee/tcs/main.nf.test

This file was deleted.

4 changes: 2 additions & 2 deletions modules/nf-core/tcoffee/tcs/tests/lib.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process {
withName: "TCOFFEE_ALIGN"{
ext.args = { "-output fasta_aln -out_lib=sample_lib1.tc_lib" }
ext.args = { "-output fasta_aln -out_lib sample_lib1.tc_lib" }
}
}
}

0 comments on commit 1cacace

Please sign in to comment.