Skip to content

Incorporate old Patterns website into training #967

Description

@bentsherman

Nextflow Patterns: https://nextflow-io.github.io/patterns/

This website documents various implementation patterns, mostly around channel operators. It's not very visible and it's out of date. I recommend taking the examples that are still useful and incorporating them into the training, e.g. as a "Dataflow Patterns" side quest.

Feel free to rewrite or throw out anything that doesn't fit. This content is very old

See also: https://docs.seqera.io/nextflow/tutorials/static-types-operators

I went through them a year or two ago and wrote down these recommendations:

  • Channel duplication: Not needed since DSL2 -- remove

  • Sort file pairs by sample name: Use collect and then map with toSorted() to collect and sort a channel of samples

  • Create key to combine channels: looks fine, although better to use a samplesheet

  • Scatter executions: Use channel.fromList() or fromPath to scatter a collection of inputs. Use flatMap to scatter further if needed. Avoid fromFilePairs, use a samplesheet instead

  • Gather results: Use collect to gather a channel into a collection. Use groupBy (>=26.04) or groupTuple to gather a scattered channel into groups (opposite of flatMap)

  • Organize outputs: Use the output block

  • Other: not sure these are worth keeping

  • Advanced patterns: not sure these are worth keeping

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions