Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Added introduction and moved glossary to the top of
Browse files Browse the repository at this point in the history
samplesheet/examples.md
  • Loading branch information
adamrtalbot committed Jul 27, 2023
1 parent 8d99ac1 commit 302ec09
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docs/samplesheets/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ description: Examples of advanced sample sheet creation techniques.

# Sample sheet channel manipulation examples

## Introduction

Understanding channel structure and manipulation is critical for getting the most out of Nextflow. nf-validation helps initialise your channels from the text inputs to get you started, but further work might be required to fit your exact use case. In this page we run through some common cases for transforming the output of `.fromSamplesheet`.

### Glossary

- A channel is the Nextflow object, referenced in the code
- An item is each thing passing through the channel, equivalent to one row in the samplesheet
- An element is each thing in the item, e.g., the meta value, fastq_1 etc. It may be a file or value

## Default mode

Each item in the channel emitted by `.fromSamplesheet()` is a flat tuple, corresponding with each row of the samplesheet. Each item will be composed of a meta value (if present) and any additional elements from columns in the samplesheet, e.g.:

```csv
Expand Down Expand Up @@ -32,12 +44,6 @@ tuple val(meta), path(fastq_1), path(fastq_2), path(bed)

It may be necessary to manipulate this channel to fit your process inputs. For more documentation, check out the [Nextflow operator docs](https://www.nextflow.io/docs/latest/operator.html), however here are some common use cases with `.fromSamplesheet()`.

Here we use the following terminology:

- A channel is the Nextflow object, referenced in the code
- An item is each thing passing through the channel, equivalent to one row in the samplesheet
- An element is each thing in the item, e.g., the meta value, fastq_1 etc. It may be a file or value.

## Changing the structure of channel items

Each item in the channel will be a flat tuple, but some processes will use multiple files as a list in their input channel, this is common in nf-core modules. For example, consider the following input declaration in a process, where FASTQ could be > 1 file:
Expand Down

0 comments on commit 302ec09

Please sign in to comment.