Update metabat2 output channels and compression (#1111)

* feat: each output type has dedicated channel replace bgzip with gzip can only zip one at a time

* Add condition moving of unbinned files

* fix: solution for moving sometimes non-existant files

* fix: update meta.yml to add the new channels

* fix: remove most of the checksums due to variability

* fix: tweaking of output

* Update modules/metabat2/metabat2/main.nf

Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>

* Fix find commands

* Fix find commands

Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>
This commit is contained in:
James A. Fellows Yates 2021-12-09 15:00:32 +01:00 committed by GitHub
parent 1f3f2b18bb
commit be85289981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 12 deletions

View file

@ -11,8 +11,11 @@ process METABAT2_METABAT2 {
tuple val(meta), path(fasta), path(depth)
output:
tuple val(meta), path("*.tooShort.fa.gz") , optional:true , emit: tooshort
tuple val(meta), path("*.lowDepth.fa.gz") , optional:true , emit: lowdepth
tuple val(meta), path("*.unbinned.fa.gz") , optional:true , emit: unbinned
tuple val(meta), path("*.tsv.gz") , optional:true , emit: membership
tuple val(meta), path("bins/*.fa.gz") , optional:true , emit: fasta
tuple val(meta), path("*.tsv.gz"), optional:true , emit: membership
path "versions.yml" , emit: versions
script:
@ -33,8 +36,10 @@ process METABAT2_METABAT2 {
mv metabat2/${prefix} ${prefix}.tsv
mv metabat2 bins
bgzip --threads $task.cpus ${prefix}.tsv
bgzip --threads $task.cpus bins/*.fa
gzip ${prefix}.tsv
find ./bins/ -name "*.fa" -type f | xargs -t -n 1 bgzip -@ ${task.cpus}
find ./bins/ -name "*[lowDepth,tooShort,unbinned].fa.gz" -type f -exec mv {} . \\;
cat <<-END_VERSIONS > versions.yml
"${task.process}":

View file

@ -46,6 +46,18 @@ output:
type: file
description: Bins created from assembled contigs in fasta file
pattern: "*.fa.gz"
- tooshort:
type: file
description: Contigs that did not pass length filtering
pattern: "*.tooShort.fa.gz"
- lowdepth:
type: file
description: Contigs that did not have sufficient depth for binning
pattern: "*.lowDepth.fa.gz"
- unbinned:
type: file
description: Contigs that pass length and depth filtering but could not be binned
pattern: "*.unbinned.fa.gz"
- membership:
type: file
description: cluster memberships as a matrix format.
@ -54,3 +66,4 @@ output:
authors:
- "@maxibor"
- "@jfy133"

View file

@ -1,23 +1,24 @@
- name: metabat2 metabat2 test_metabat2_no_depth
command: nextflow run ./tests/modules/metabat2/metabat2 -entry test_metabat2_no_depth -c ./tests/config/nextflow.config -c ./tests/modules/metabat2/metabat2/nextflow.config
command: nextflow run tests/modules/metabat2/metabat2 -entry test_metabat2_no_depth -c tests/config/nextflow.config
tags:
- metabat2/metabat2
- metabat2
- metabat2/metabat2
files:
- path: output/metabat2/bins/test.1.fa.gz
md5sum: 0e9bce5b5a0033fd4411a21dec881170
- path: output/metabat2/test.tsv.gz
md5sum: ea77e8c4426d2337419905b57f1ec335
- path: output/metabat2/versions.yml
md5sum: 5742a71af36c3a748fd5726d76924ba8
- name: metabat2 metabat2 test_metabat2_depth
command: nextflow run ./tests/modules/metabat2/metabat2 -entry test_metabat2_depth -c ./tests/config/nextflow.config -c ./tests/modules/metabat2/metabat2/nextflow.config
command: nextflow run tests/modules/metabat2/metabat2 -entry test_metabat2_depth -c tests/config/nextflow.config
tags:
- metabat2/metabat2
- metabat2
- metabat2/metabat2
files:
- path: output/metabat2/bins/test.1.fa.gz
md5sum: 0e9bce5b5a0033fd4411a21dec881170
- path: output/metabat2/test.tsv.gz
md5sum: ea77e8c4426d2337419905b57f1ec335
- path: output/metabat2/test.txt.gz
md5sum: 8f735aa408d6c90e5a0310e06ace7a9a
- path: output/metabat2/versions.yml
md5sum: 538c56b2df7d90580f05097218b5d5b1