From 9f8c237e2bc5430be672416624f54cf15c4c53ea Mon Sep 17 00:00:00 2001 From: Christopher Hakkaart Date: Thu, 19 Mar 2026 10:09:31 +1300 Subject: [PATCH 1/4] Update mixed example and title --- src/components/Footer.astro | 2 +- src/components/Menu/Menu.tsx | 2 +- .../SideNavigation/ExamplesSideNav.tsx | 2 +- src/pages/mixing-scripting-languages.md | 70 +++++++++++++------ 4 files changed, 50 insertions(+), 26 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index c4507d2d9..95300e170 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -93,7 +93,7 @@ import LogoSeqera from "../../public/img/assets/Logo_Seqera_white.svg";
  • Mixing scripting languagesMixed script languages
  • diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 221d78f09..3f2712c28 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -198,7 +198,7 @@ const Menu = ({}) => {
  • - Mixing scripting languages + Mixed script languages
  • diff --git a/src/components/SideNavigation/ExamplesSideNav.tsx b/src/components/SideNavigation/ExamplesSideNav.tsx index cbad4e3f5..64cf777b4 100644 --- a/src/components/SideNavigation/ExamplesSideNav.tsx +++ b/src/components/SideNavigation/ExamplesSideNav.tsx @@ -26,7 +26,7 @@ const ExamplesSideNav = () => { }, { id: 'mixing-scripting-languages', - title: 'Mixing scripting languages', + title: 'Mixed script languages', href: 'mixing-scripting-languages.html' }, { diff --git a/src/pages/mixing-scripting-languages.md b/src/pages/mixing-scripting-languages.md index e296b20e4..6dea6f221 100644 --- a/src/pages/mixing-scripting-languages.md +++ b/src/pages/mixing-scripting-languages.md @@ -1,44 +1,39 @@ --- -title: Multiple inputs +title: Mixed script languages layout: "@layouts/ExampleLayout.astro" ---
    -

    Mixing scripting languages

    +

    Mixed script languages

    -

    - With Nextflow, you are not limited to Bash scripts -- you can use any scripting language! In other words, for each process you can use the language that best fits the specific task or that you simply prefer. +

    + This pipeline shows how to use different scripting languages in a single Nextflow pipeline. The first process uses a Perl script to generate random number pairs, and the second process uses a Python script to calculate the average of each pair.

    ```groovy -#!/usr/bin/env nextflow - +// Default parameter input params.range = 100 -/* - * A trivial Perl script that produces a list of number pairs - */ +// Perl process process perlTask { output: stdout - shell: - ''' + script: + """ #!/usr/bin/env perl use strict; use warnings; - my $count; - my $range = !{params.range}; - for ($count = 0; $count < 10; $count++) { - print rand($range) . ', ' . rand($range) . "\n"; + my \$count; + my \$range = ${params.range}; + for (\$count = 0; \$count < 10; \$count++) { + print rand(\$range) . ', ' . rand(\$range) . "\\n"; } - ''' + """ } -/* - * A Python script which parses the output of the previous script - */ +// Python process process pyTask { input: stdin @@ -46,6 +41,7 @@ process pyTask { output: stdout + script: """ #!/usr/bin/env python import sys @@ -63,6 +59,7 @@ process pyTask { """ } +// Workflow block workflow { perlTask | pyTask | view } @@ -72,9 +69,36 @@ workflow { ### Synopsis -In the above example we define a simple pipeline with two processes. +This pipeline defines two processes: + +

    perlTask: executes a Perl script that generates 10 pairs of random numbers within a configurable range and prints them to standard output

    + +

    pyTask: executes a Python script that reads the pairs from standard input and calculates the average of each coordinate

    + +Each process uses a shebang declaration at the start of its script block to specify the scripting language. Nextflow detects the shebang and executes the script using the appropriate interpreter. + +The `workflow` block pipes the output of `perlTask` directly into `pyTask`, and then passes the result to the `view` operator to print it to the terminal. + +
    + +To run this pipeline: + +

    1. Install Nextflow (version 25.10 or later)

    + +

    2. Create a new file named main.nf in your current directory

    + +

    3. Copy and save the above script to your new file

    + +

    4. Run your pipeline:

    + +
    + +``` +nextflow run main.nf +``` + +
    -The first process executes a Perl script, because the script block definition starts -with a Perl _shebang_ declaration (line 14). Since Perl uses the `$` character for variables, we use the special `shell` block instead of the normal `script` block to easily distinguish the Perl variables from the Nextflow variables. +
    -In the same way, the second process will execute a Python script, because the script block starts with a Python shebang (line 36). +See [Scripts à la carte](https://docs.seqera.io/nextflow/process#scripts-%C3%A0-la-carte) for more information about using multiple scripting languages in Nextflow. From e507499026c8b8df014f577952a0320e5b9a93b8 Mon Sep 17 00:00:00 2001 From: Christopher Hakkaart Date: Thu, 19 Mar 2026 10:10:31 +1300 Subject: [PATCH 2/4] Update mixed example and title --- src/components/Footer.astro | 2 +- src/components/Menu/Menu.tsx | 2 +- src/components/SideNavigation/ExamplesSideNav.tsx | 2 +- src/pages/mixing-scripting-languages.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 95300e170..46652f5a1 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -93,7 +93,7 @@ import LogoSeqera from "../../public/img/assets/Logo_Seqera_white.svg";
  • Mixed script languagesMixed scripts
  • diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index 3f2712c28..d5c356a32 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -198,7 +198,7 @@ const Menu = ({}) => {
  • - Mixed script languages + Mixed scripts
  • diff --git a/src/components/SideNavigation/ExamplesSideNav.tsx b/src/components/SideNavigation/ExamplesSideNav.tsx index 64cf777b4..917365d9f 100644 --- a/src/components/SideNavigation/ExamplesSideNav.tsx +++ b/src/components/SideNavigation/ExamplesSideNav.tsx @@ -26,7 +26,7 @@ const ExamplesSideNav = () => { }, { id: 'mixing-scripting-languages', - title: 'Mixed script languages', + title: 'Mixed scripts', href: 'mixing-scripting-languages.html' }, { diff --git a/src/pages/mixing-scripting-languages.md b/src/pages/mixing-scripting-languages.md index 6dea6f221..c9ed18cff 100644 --- a/src/pages/mixing-scripting-languages.md +++ b/src/pages/mixing-scripting-languages.md @@ -1,10 +1,10 @@ --- -title: Mixed script languages +title: Mixed scripts layout: "@layouts/ExampleLayout.astro" ---
    -

    Mixed script languages

    +

    Mixed scripts

    This pipeline shows how to use different scripting languages in a single Nextflow pipeline. The first process uses a Perl script to generate random number pairs, and the second process uses a Python script to calculate the average of each pair. From 9d049678bb6fe6341e827dfb3f74606a7418aafd Mon Sep 17 00:00:00 2001 From: Christopher Hakkaart Date: Thu, 19 Mar 2026 10:12:02 +1300 Subject: [PATCH 3/4] Consistency --- src/components/Footer.astro | 2 +- src/components/Menu/Menu.tsx | 2 +- src/components/SideNavigation/ExamplesSideNav.tsx | 2 +- src/pages/mixing-scripting-languages.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 46652f5a1..57797850d 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -93,7 +93,7 @@ import LogoSeqera from "../../public/img/assets/Logo_Seqera_white.svg";

  • Mixed scriptsMixed script pipeline
  • diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx index d5c356a32..464eb040b 100644 --- a/src/components/Menu/Menu.tsx +++ b/src/components/Menu/Menu.tsx @@ -198,7 +198,7 @@ const Menu = ({}) => {
  • - Mixed scripts + Mixed script pipeline
  • diff --git a/src/components/SideNavigation/ExamplesSideNav.tsx b/src/components/SideNavigation/ExamplesSideNav.tsx index 917365d9f..f05de64bf 100644 --- a/src/components/SideNavigation/ExamplesSideNav.tsx +++ b/src/components/SideNavigation/ExamplesSideNav.tsx @@ -26,7 +26,7 @@ const ExamplesSideNav = () => { }, { id: 'mixing-scripting-languages', - title: 'Mixed scripts', + title: 'Mixed script pipeline', href: 'mixing-scripting-languages.html' }, { diff --git a/src/pages/mixing-scripting-languages.md b/src/pages/mixing-scripting-languages.md index c9ed18cff..c5b3363e1 100644 --- a/src/pages/mixing-scripting-languages.md +++ b/src/pages/mixing-scripting-languages.md @@ -1,10 +1,10 @@ --- -title: Mixed scripts +title: Mixed script pipeline layout: "@layouts/ExampleLayout.astro" ---
    -

    Mixed scripts

    +

    Mixed script pipeline

    This pipeline shows how to use different scripting languages in a single Nextflow pipeline. The first process uses a Perl script to generate random number pairs, and the second process uses a Python script to calculate the average of each pair. From 6fec9608cfe0e011579dccb072e24ba49f336558 Mon Sep 17 00:00:00 2001 From: Christopher Hakkaart Date: Mon, 23 Mar 2026 15:08:31 +1300 Subject: [PATCH 4/4] Add title --- src/pages/basic-pipeline.md | 2 ++ src/pages/mixing-scripting-languages.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/pages/basic-pipeline.md b/src/pages/basic-pipeline.md index 7239753d6..2a93d7292 100644 --- a/src/pages/basic-pipeline.md +++ b/src/pages/basic-pipeline.md @@ -88,6 +88,8 @@ The `output` block (outside the workflow) defines where and how each output shou
    +### Get started + To run this pipeline:

    1. Install Nextflow (version 25.10 or later)

    diff --git a/src/pages/mixing-scripting-languages.md b/src/pages/mixing-scripting-languages.md index c5b3363e1..228bc1e8a 100644 --- a/src/pages/mixing-scripting-languages.md +++ b/src/pages/mixing-scripting-languages.md @@ -81,6 +81,8 @@ The `workflow` block pipes the output of `perlTask` directly into `pyTask`, and
    +### Get started + To run this pipeline:

    1. Install Nextflow (version 25.10 or later)