Skip to content
Snippets Groups Projects
Verified Commit dbbbac30 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

CONTRIBUTING.md: add info on channel creation

parent c6dce992
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,23 @@ If you want to use information within the `file_id` to name outputs in your `scr
```
and use the `file_prefix` variable.
This also means that channel emitting `path` item should be transformed with at least the following map function:
```
.map { it -> [it.simpleName, it]}
````
for example:
```
channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
.map { it -> [it.simpleName, it]}
.set { fasta_files }
```
The rational behind taking a `file_id` and emitting the same `file_id` is to facilitate complex channel operations in pipelines without having to rewrite the `process` blocks.
### dealing with paired-end and single-end data
......
......@@ -46,7 +46,7 @@ process mapping_fastq {
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*.bam"), emit: bam
tuple val(), path("*.bam"), emit: bam
path "*_report.txt", emit: report
script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment