Skip to content

Commit

Permalink
addedd optional output channel for lib files (nf-core#5257)
Browse files Browse the repository at this point in the history
* addedd optional output channel for lib files

* added the output description for lin in meta.yml
  • Loading branch information
alessiovignoli authored and famosab committed Mar 19, 2024
1 parent 2940ff3 commit b7689e6
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/nf-core/tcoffee/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ process TCOFFEE_ALIGN {

output:
tuple val(meta), path("*.aln{.gz,}"), emit: alignment
// in the args there might be the request to generate a lib file, so the following is an optional output
tuple val(meta), path("*.*lib") , emit: lib, optional : true
path "versions.yml" , emit: versions

when:
Expand Down
6 changes: 6 additions & 0 deletions modules/nf-core/tcoffee/align/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ output:
type: file
description: Alignment file in FASTA format. May be gzipped.
pattern: "*.aln{.gz,}"
- lib:
type: file
description: optional output, the library generated from the MSA file.
pattern: "*.*lib"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@luisas"
- "@JoseEspinosa"
- "@alessiovignoli"
maintainers:
- "@luisas"
- "@JoseEspinosa"
- "@lrauschning"
- "@alessiovignoli"
3 changes: 3 additions & 0 deletions modules/nf-core/tcoffee/align/tests/lib.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
process {
ext.args = { "-output fasta_aln -out_lib=sample_lib1.tc_lib" }
}
27 changes: 27 additions & 0 deletions modules/nf-core/tcoffee/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,31 @@ nextflow_process {
}

}

test("fasta - align_with_lib") {

config "./lib.config"

when {
process {
"""
input[0] = [ [ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = [[:],[]]
input[2] = [[:],[],[]]
input[3] = true
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.alignment).match("alignment - lib") },
{ assert path(process.out.lib.get(0).get(1)).getText().contains("1ahl") },
{ assert snapshot(process.out.versions).match("versions_lib") }
)
}
}
}
29 changes: 29 additions & 0 deletions modules/nf-core/tcoffee/align/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b7689e6

Please sign in to comment.