### Print Hello World in Nextflow Source: https://github.com/nextflow-io/nextflow/blob/master/docs/script.md Use the `println` function to display output to the console. This is a basic example for starting with Nextflow scripts. ```nextflow println 'Hello, World!' ``` -------------------------------- ### Install Plugin Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/cli.md Installs a specified plugin. Multiple plugins can be installed by providing a comma-separated list. ```console $ nextflow plugin install ``` -------------------------------- ### Install Nextflow Modules Source: https://github.com/nextflow-io/nextflow/blob/master/docs/modules/using-modules.md Install modules from a registry into your project using the `module install` command. You can specify a version using the `-version` flag. Modules from nf-core use a `0.0.0-` format. ```console $ nextflow module install nf-core/fastqc $ nextflow module install nf-core/fastqc -version 0.0.0-0c7146d ``` -------------------------------- ### Install a Module Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/cli.md Download and install a module from the Nextflow registry to your local environment. ```console $ nextflow module install nf-core/fastqc ``` -------------------------------- ### Basic Kubernetes Configuration Example Source: https://github.com/nextflow-io/nextflow/blob/master/plugins/nf-k8s/README.md A comprehensive example of basic Kubernetes plugin configuration, including namespace, service account, storage, and mount path. ```groovy plugins { id 'nf-k8s' } process.executor = 'k8s' k8s { namespace = 'nextflow' serviceAccount = 'nextflow-sa' storageClaimName = 'nf-workdir-pvc' storageMountPath = '/workspace' } workDir = '/workspace/work' ``` -------------------------------- ### Install Nextflow Module Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md Download and install a module from the registry to the local 'modules/' directory. Use -version to specify a version or -force to overwrite local changes. ```bash nextflow module install nf-core/bwa-align # Install specific module (latest) nextflow module install nf-core/salmon -version 1.2.0 ``` -------------------------------- ### Install Nextflow Source: https://context7.com/nextflow-io/nextflow/llms.txt Install Nextflow using a curl command or via Bioconda. Verify the installation and move the executable to your PATH. ```bash # Install Nextflow executable in current directory curl -fsSL https://get.nextflow.io | bash ``` ```bash # Or install via Bioconda conda install -c bioconda nextflow ``` ```bash # Verify installation ./nextflow -version ``` ```bash # Move to PATH mv nextflow /usr/local/bin/ ``` -------------------------------- ### Module Version Examples Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md Examples of semantic versioning for modules. Mandatory for registry-published modules. ```yaml version: "1.0.0" version: "2.3.1" version: "1.0.0-beta.1" ``` -------------------------------- ### Basic Azure Batch Configuration Example Source: https://github.com/nextflow-io/nextflow/blob/master/plugins/nf-azure/README.md A complete example of configuring the nf-azure plugin for Azure Batch, including storage and batch account details, and enabling automatic pool management. ```groovy plugins { id 'nf-azure' } azure { storage { accountName = 'mystorageaccount' accountKey = System.getenv('AZURE_STORAGE_KEY') } batch { endpoint = 'https://mybatchaccount.westeurope.batch.azure.com' accountName = 'mybatchaccount' accountKey = System.getenv('AZURE_BATCH_KEY') autoPoolMode = true deletePoolsOnCompletion = true } } process.executor = 'azurebatch' workDir = 'az://mycontainer/work' ``` -------------------------------- ### Install Build Dependencies Source: https://github.com/nextflow-io/nextflow/blob/master/docs/README.md Install the necessary Python dependencies for building the documentation using pip. ```bash cd docs pip install -r requirements.txt ``` -------------------------------- ### Install Java with SDKMAN Source: https://github.com/nextflow-io/nextflow/blob/master/docs/install.md Installs a specific version of Java (17.0.10-tem) using SDKMAN. Ensure SDKMAN is installed first and a new terminal is opened. ```bash sdk install java 17.0.10-tem ``` -------------------------------- ### Install Nextflow Registry Module Source: https://github.com/nextflow-io/nextflow/blob/master/docs/modules/modules.md Install the nf-core/fastqc module from the Nextflow registry using the command line. This makes the module available for inclusion in your project. ```bash nextflow module install nf-core/fastqc ``` -------------------------------- ### Install a remote module Source: https://github.com/nextflow-io/nextflow/blob/master/docs/migrations/26-04.md The `nextflow module install` command downloads and installs a specified module from the registry into your project's `modules` directory. ```bash nextflow module install nf-core/bwa/mem ``` -------------------------------- ### Basic Wave Configuration Example Source: https://github.com/nextflow-io/nextflow/blob/master/plugins/nf-wave/README.md A minimal configuration to enable the Wave plugin and specify a Conda package for a process. ```groovy plugins { id 'nf-wave' } wave { enabled = true } process { conda = 'samtools=1.17' } ``` -------------------------------- ### Install a Module from Registry Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/cli.md Installs a module from a registry into the local project's `modules/` directory. Use `-version` to specify a version or `-force` to reinstall even if modified. ```console nextflow module install [options] [namespace/name] ``` ```console nextflow module install -version 1.0.0 my-org/my-module ``` ```console nextflow module install -force my-org/my-module ``` -------------------------------- ### Basic AWS Batch Configuration Example Source: https://github.com/nextflow-io/nextflow/blob/master/plugins/nf-amazon/README.md A complete example for configuring AWS Batch, including the plugin, executor, work directory, region, CLI path, and a job role ARN. ```groovy plugins { id 'nf-amazon' } process.executor = 'awsbatch' process.queue = 'my-batch-queue' workDir = 's3://my-bucket/work' aws { region = 'eu-west-1' batch { cliPath = '/home/ec2-user/miniconda/bin/aws' jobRole = 'arn:aws:iam::123456789:role/MyBatchJobRole' } } ``` -------------------------------- ### View Module Information Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/cli.md Display detailed metadata and example usage for a specific module from the registry. ```console $ nextflow module view nf-core/fastqc ``` -------------------------------- ### Example Workflow with Seqera Executor Source: https://github.com/nextflow-io/nextflow/blob/master/plugins/nf-seqera/README.md A complete example demonstrating a simple Nextflow workflow configured to run with the Seqera executor, including plugin declaration, executor settings, and a basic process. ```groovy plugins { id 'nf-seqera' } process { executor = 'seqera' } tower { accessToken = '' } seqera { executor { region = 'eu-west-1' } } ``` ```groovy process HELLO { output: path 'hello.txt' script: ''' echo "Hello from Seqera Cloud" > hello.txt ''' } workflow { HELLO() } ``` -------------------------------- ### Install Git on Debian/Ubuntu Source: https://github.com/nextflow-io/nextflow/blob/master/docs/developer-env.md Installs the latest stable Git version on Debian/Ubuntu based Linux distributions. Verify installation with `git version`. ```bash sudo apt-get install git-all ``` ```bash git version ``` -------------------------------- ### Start Flux Instance Source: https://github.com/nextflow-io/nextflow/blob/master/docs/tutorials/flux.md Initialize an interactive Flux instance with a specified number of test size. This command is used to start a local Flux cluster for testing. ```console flux start --test-size=4 ``` -------------------------------- ### Example Process with Auto Pool Configuration Source: https://github.com/nextflow-io/nextflow/blob/master/docs/azure.md This example demonstrates how a process requests specific compute resources (8 CPUs, 8GB memory) and uses a glob pattern for machine type selection within autoPoolMode. ```groovy process EXAMPLE_PROCESS { machineType "Standard_E*d_v5" cpus 8 memory 8.GB script: """ echo "cpus: ${task.cpus}" """ } ``` -------------------------------- ### Install Nextflow with cURL Source: https://github.com/nextflow-io/nextflow/blob/master/README.md Installs the Nextflow executable in the current directory. Move it to your PATH to run from anywhere. ```bash curl -fsSL https://get.nextflow.io | bash ``` -------------------------------- ### Run a pipeline with a locally installed plugin Source: https://github.com/nextflow-io/nextflow/blob/master/docs/guides/gradle-plugin.md After installing a plugin locally, you can run your pipeline by specifying the plugin name and version. ```bash nextflow run main.nf -plugins @ ``` -------------------------------- ### Nextflow Module Structure Example Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md Example directory layout for a Nextflow module, including required files like main.nf, meta.yml, and README.md. ```yaml name: nf-core/bwa-align version: 1.2.4 # This module's version description: Align reads using BWA-MEM authors: - nf-core community license: MIT requires: nextflow: ">=24.04.0" ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/nextflow-io/nextflow/blob/master/docs/README.md Start a local HTTP server to preview the generated HTML documentation. Ensure you are in the correct directory before running this command. ```bash python -m http.server 8080 --directory _build/html/ ``` -------------------------------- ### Get First Item Matching Regular Expression Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/operator.md Use the `first` operator with a regular expression to emit the first item from a channel that matches the pattern. This example finds the first string starting with 'aa'. Note: This operator is deprecated. ```nextflow // emits the first item matching the regular expression: 'aa' channel.of( 'a', 'aa', 'aaa' ) .first( ~/aa.*/ ) .view() ``` -------------------------------- ### Configure Azure Batch Start Task Source: https://github.com/nextflow-io/nextflow/blob/master/docs/azure.md Define optional start tasks to run when a node joins an Azure Batch pool. Useful for environment setup. ```groovy azure { batch { pools { { startTask { script = 'echo "Hello, world!"' privileged = true // optional, defaults to false } } } } } ``` -------------------------------- ### Build Documentation with Make Source: https://github.com/nextflow-io/nextflow/blob/master/docs/README.md Clean previous builds and generate HTML documentation files using the make command. ```bash make clean html ``` -------------------------------- ### Activate Configuration Profiles at Runtime Source: https://github.com/nextflow-io/nextflow/blob/master/docs/config.md Example of how to activate one or more defined configuration profiles using the `-profile` command-line option. Multiple profiles can be specified as a comma-separated list. ```bash nextflow run main.nf -profile standard,cloud ``` -------------------------------- ### Typed Function Definition Source: https://github.com/nextflow-io/nextflow/blob/master/docs/migrations/25-10.md Define functions with type-annotated parameters and return values. This example shows a function that checks if a string starts with 'SRA'. ```nextflow def isSraId(id: String) -> Boolean { return id.startsWith('SRA') } ``` -------------------------------- ### Filter Channel by Regular Expression Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/operator.md Use the `filter` operator with a regular expression to emit items from a channel that match the pattern. This example filters for strings starting with 'a'. ```nextflow channel.of( 'a', 'b', 'aa', 'bc', 3, 4.5 ) .filter( ~/^a.*/ ) .view() ``` -------------------------------- ### Prepare a Module for Publishing Source: https://github.com/nextflow-io/nextflow/blob/master/specs/251117-module-system/quickstart.md Structures a module directory with required files (`main.nf`, `meta.yaml`, `README.md`) and recommended files (`tests/`) before publishing to a registry. ```bash # Directory structure: # my-module/ # ├── main.nf # Required: entry point # ├── meta.yaml # Required for registry # ├── README.md # Required for registry # └── tests/ # Recommended ``` -------------------------------- ### Get First Item of Specific Type Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/operator.md Use the `first` operator with a type qualifier to emit the first item of that type from a channel. This example selects the first `String`. Note: This operator is deprecated. ```nextflow // emits the first String value: 'a' channel.of( 1, 2, 'a', 'b', 3 ) .first( String ) .view() ``` -------------------------------- ### Get First Item Matching Predicate Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/operator.md Use the `first` operator with a boolean predicate to emit the first item that satisfies the condition. This example finds the first number greater than 3. Note: This operator is deprecated. ```nextflow // emits the first item for which the predicate evaluates to true: 4 channel.of( 1, 2, 3, 4, 5 ) .first { v -> v > 3 } .view() ``` -------------------------------- ### Negate Selector Expressions Source: https://github.com/nextflow-io/nextflow/blob/master/docs/config.md Use the '!' prefix to negate selector expressions, applying configurations to processes that do *not* match the specified label or name pattern. This example sets different CPU counts based on the 'hello' label and applies a queue to processes not starting with 'align'. ```groovy process { withLabel: 'hello' { cpus = 2 } withLabel: '!hello' { cpus = 4 } withName: '!align.*' { queue = 'long' } } ``` -------------------------------- ### Run Nextflow Module Directly Source: https://github.com/nextflow-io/nextflow/blob/master/docs/modules/using-modules.md Execute a module directly for ad-hoc tasks or testing using the `module run` command. This command automatically downloads the module if not installed and accepts standard Nextflow run options. Local modules are specified with a path starting with `./` or `../`. ```console $ nextflow module run nf-core/fastqc --meta.id test_sample --reads sample1_R1.fastq.gz $ nextflow module run nf-core/fastqc \ --meta.id test_sample \ --reads sample1_R1.fastq.gz \ -with-docker ``` ```console $ nextflow module run ./modules/local/fastqc/main.nf \ --meta.id test_sample \ --reads sample1_R1.fastq.gz \ -with-docker ``` -------------------------------- ### Install Git on macOS with Homebrew Source: https://github.com/nextflow-io/nextflow/blob/master/docs/developer-env.md Installs Git on macOS using the Homebrew package manager. Ensure Homebrew is installed first. Verify installation with `git version`. ```bash brew install git ``` ```bash git version ``` -------------------------------- ### Create a New Module Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/cli.md Initializes a new module with essential files like `main.nf`, `meta.yml`, and `README.md`. ```console nextflow module create [namespace/name] ``` -------------------------------- ### Install SDKMAN Source: https://github.com/nextflow-io/nextflow/blob/master/docs/install.md Installs SDKMAN, a tool for managing parallel versions of multiple SDKs, including Java. This is a prerequisite for installing Java via SDKMAN. ```bash curl -s https://get.sdkman.io | bash ``` -------------------------------- ### Represent Installed Module Source: https://github.com/nextflow-io/nextflow/blob/master/specs/251117-module-system/data-model.md Represents a module installed in the local project directory, including its files and integrity status. Use for managing local module installations. ```groovy class InstalledModule { ModuleReference reference Path directory // e.g., /project/modules/@nf-core/fastqc Path mainFile // e.g., /project/modules/@nf-core/fastqc/main.nf Path manifestFile // e.g., /project/modules/@nf-core/fastqc/meta.yaml Path checksumFile // e.g., /project/modules/@nf-core/fastqc/.checksum String installedVersion String expectedChecksum ModuleIntegrity getIntegrity() { // Compute and compare checksum } } enum ModuleIntegrity { VALID, // Checksum matches MODIFIED, // Checksum mismatch (local changes) MISSING_CHECKSUM, // No .checksum file CORRUPTED // Missing required files } ``` -------------------------------- ### Verify AWS CLI Installation Source: https://github.com/nextflow-io/nextflow/blob/master/docs/aws.md Checks the installed AWS CLI version. The `aws` tool is located in the `bin` directory within the Miniconda installation folder. ```console $ ./miniconda/bin/aws --version aws-cli/1.29.20 Python/3.11.4 Linux/4.14.318-241.531.amzn2.x86_64 botocore/1.31.20 ``` -------------------------------- ### Collect and write files with exec and collectFile alternative Source: https://github.com/nextflow-io/nextflow/blob/master/docs/tutorials/static-types-operators.md This example demonstrates an alternative to `collectFile` using an `exec` block within a process to write collected items to a file, combined with `collect` and `map` for data preparation. ```nextflow nextflow.enable.types = true process COLLECT_FILE { input: name: String items: List output: file(name) exec: def path = task.workDir.resolve(name) items.each { item -> path << item path << '\n' } } workflow { val_names = channel.of('alpha', 'beta', 'gamma') .collect() .map { names -> names.toSorted() } COLLECT_FILE('sample.txt', val_names) .view { result -> result.text } } ``` -------------------------------- ### List Installed Nextflow Modules Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md Display the status of installed modules, comparing local installations with the configuration and available updates. Use -json for machine-readable output or -outdated to filter. ```bash nextflow module list nextflow module list -outdated ``` -------------------------------- ### Task Launch (nxf_launch) Source: https://github.com/nextflow-io/nextflow/blob/master/modules/nextflow/src/main/resources/nextflow/executor/command-run.txt Placeholder for the command that launches the main task. ```bash nxf_launch() { {{launch_cmd}} } ``` -------------------------------- ### Dynamic Configuration with Groovy Scripting Source: https://github.com/nextflow-io/nextflow/blob/master/docs/strict-syntax.md This example demonstrates dynamic configuration using Groovy scripting, allowing variables and conditional logic. This approach is not supported by the strict config syntax. ```groovy def getHostname() { // ... } def hostname = getHostname() if (hostname == 'small') { params.max_memory = 32.GB params.max_cpus = 8 } else if (hostname == 'large') { params.max_memory = 128.GB params.max_cpus = 32 } ``` -------------------------------- ### Install Nextflow Locally Source: https://github.com/nextflow-io/nextflow/blob/master/CLAUDE.md Installs the Nextflow project locally, typically to the Maven local repository. ```bash make install ``` -------------------------------- ### Run Integration Tests Source: https://github.com/nextflow-io/nextflow/blob/master/docs/developer/index.md Navigate to the tests/checks directory and use './qrun.sh' to run integration tests. You can run all tests or a specific test by providing a FOLDER name. ```bash cd tests/checks ./qrun.sh cd tests/checks ./qrun.sh ``` -------------------------------- ### Nextflow Configuration (`nextflow.config`) Example Source: https://context7.com/nextflow-io/nextflow/llms.txt Defines pipeline parameters, default process settings, Docker and Conda configurations, and various profiles for different execution environments. Includes settings for labels, process names, and regex selectors. ```groovy // nextflow.config // Pipeline parameters params { reads = 'data/*_{1,2}.fastq.gz' genome = 'refs/hg38.fa' outdir = 'results' max_cpus = 32 } // Output directory outputDir = params.outdir // Default process settings process { executor = 'local' cpus = 2 memory = '4 GB' time = '1h' // Apply settings to all processes with label 'big_mem' withLabel: big_mem { cpus = 16 memory = '64 GB' queue = 'highmem' } // Apply settings to a specific process by name withName: ALIGN { container = 'quay.io/biocontainers/bwa:0.7.17' cpus = 8 memory = '32 GB' } // Regex selector: all processes NOT starting with 'QC' withName: '!QC.*' { queue = 'standard' } } // Docker settings docker { enabled = true runOptions = '-u $(id -u):$(id -g)' } // Conda settings conda.enabled = true conda.cacheDir = '/shared/conda-envs' // Profiles for different environments profiles { standard { process.executor = 'local' docker.enabled = true } slurm { process.executor = 'slurm' process.queue = 'compute' process.clusterOptions = '--account=proj123' singularity.enabled = true singularity.autoMounts = true } aws { process.executor = 'awsbatch' process.queue = 'nextflow-queue' process.container = 'my-ecr/pipeline:latest' workDir = 's3://my-bucket/work' aws.region = 'us-east-1' } test { params.reads = "${projectDir}/test/data/*_{1,2}.fastq.gz" params.genome = "${projectDir}/test/refs/chr22.fa" process.cpus = 1 process.memory = '2 GB' } } // Include additional config includeConfig 'conf/resources.config' ``` -------------------------------- ### Confirm Nextflow Installation (Self-Install) Source: https://github.com/nextflow-io/nextflow/blob/master/docs/install.md Verifies that Nextflow has been installed correctly and is accessible in the system's PATH. ```bash nextflow info ``` -------------------------------- ### Test ECS Container Agent Installation Source: https://github.com/nextflow-io/nextflow/blob/master/docs/aws.md Tests the ECS container agent installation by querying its metadata endpoint. ```bash curl -s http://localhost:51678/v1/metadata | python -mjson.tool ``` -------------------------------- ### Nextflow I/O Read/Write Example Source: https://github.com/nextflow-io/nextflow/blob/master/docs/tutorials/metrics.md This script demonstrates reading and writing different data volumes using the `dd` command within Nextflow processes. It's useful for observing I/O metrics. ```nextflow process io_read_write_1G { script: """ dd if=/dev/zero of=/dev/null bs=1G count=1 """ } process io_read_write_256M { script: """ dd if=/dev/zero of=/dev/null bs=256M count=1 """ } workflow{ io_read_write_1G() // Read and write 1 GiB io_read_write_256M() // Read and write 256 Mb } ``` -------------------------------- ### Install Plugin Source: https://github.com/nextflow-io/nextflow/blob/master/docs/cli.md Installs a plugin to extend Nextflow functionality. Use this to add new features or integrations to Nextflow. ```console $ nextflow plugin install my-plugin ``` -------------------------------- ### Singleton Output Example Source: https://github.com/nextflow-io/nextflow/blob/master/docs/process.md Demonstrates how processes return singleton outputs when provided with dataflow values or no inputs. This can lead to multiple task executions if inputs are channels. ```nextflow process echo { input: val greeting output: val greeting exec: true } process greet { input: val greeting val name output: val "$greeting, $name!" exec: true } workflow { names = channel.of( 'World', 'Mundo', 'Welt' ) greeting = echo('Hello') result = greet(greeting, names) result.view() } ``` -------------------------------- ### Module Name Examples Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md Examples of fully qualified scoped identifiers for module names. Follows the 'scope/name' format. ```yaml name: nf-core/fastqc name: nf-core/bwa-mem name: myorg/custom-aligner ``` -------------------------------- ### Docker Configuration using Dot and Block Syntax Source: https://github.com/nextflow-io/nextflow/blob/master/docs/config.md Configure Docker settings, including enablement and run options, using both dot and block syntax. ```groovy // dot syntax docker.enabled = true docker.runOptions = '-u $(id -u):$(id -g)' // block syntax docker { enabled = true runOptions = '-u $(id -u):$(id -g)' } ``` -------------------------------- ### Function Definition Example Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20250922-plugin-spec.md An example of a Function definition within a plugin specification, outlining a scriptable function with parameters. ```json { "type": "Function", "spec": { "name": "sayHello", "description": "Say hello to the given target", "returnType": "void", "parameters": [ { "name": "target", "type": "String" } ] } } ``` -------------------------------- ### ConfigScope Definition Example Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20250922-plugin-spec.md An example of a ConfigScope definition within a plugin specification, detailing a nested configuration option. ```json { "type": "ConfigScope", "spec": { "name": "hello", "description": "The `hello` scope controls the behavior of the `nf-hello` plugin.", "children": [ { "type": "ConfigOption", "spec": { "name": "message", "description": "Message to print to standard output when the plugin is enabled.", "type": "String" } } ] } } ``` -------------------------------- ### Basic Seqera Platform Configuration Source: https://github.com/nextflow-io/nextflow/blob/master/plugins/nf-tower/README.md A minimal configuration to enable the nf-tower plugin and set the Seqera Platform access token. ```groovy plugins { id 'nf-tower' } tower { enabled = true accessToken = '' } ``` -------------------------------- ### Implement Custom FileSystemProvider Source: https://github.com/nextflow-io/nextflow/blob/master/docs/plugins/developing-plugins.md Extend `FileSystemProvider` to create a custom filesystem. Implement `getScheme()` to define the URI scheme. ```groovy import java.nio.file.spi.FileSystemProvider class MyFileSystemProvider extends FileSystemProvider { @Override String getScheme() { return 'myfs' } // ... } ``` -------------------------------- ### Module Version Constraint Examples Source: https://github.com/nextflow-io/nextflow/blob/master/specs/251117-module-system/research.md Illustrates the supported version constraint syntax for module dependencies, reusing Nextflow's plugin versioning patterns. ```text | Notation | Meaning | |----------|---------| | `1.2.3` | Exact version | | `>=1.2.3` | Greater or equal | | `<=1.2.3` | Less or equal | | `>=1.2.0,<2.0.0` | Range | ``` -------------------------------- ### Install Nextflow with Conda Source: https://github.com/nextflow-io/nextflow/blob/master/README.md Installs Nextflow using the Bioconda package manager. Ensure you have Conda configured with the bioconda channel. ```bash conda install -c bioconda nextflow ``` -------------------------------- ### Expression statement example Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/syntax.md Any expression can serve as a statement. Function calls with side effects, like `println`, are common examples. ```nextflow println 'This is an expression statement.' ``` -------------------------------- ### Referencing Config Settings as Variables (Legacy) Source: https://github.com/nextflow-io/nextflow/blob/master/docs/strict-syntax.md This example shows how config settings could be referenced like variables in the legacy parser. This is not supported in strict config syntax. ```groovy google.location = "us-west1" google.batch.subnetwork = "regions/${google.location}/subnetworks/default" ``` -------------------------------- ### Configure Processes with Regular Expression Selectors Source: https://github.com/nextflow-io/nextflow/blob/master/docs/config.md Apply configurations to multiple processes using regular expressions within selectors. This example targets processes labeled 'hello' or 'bye'. ```groovy process { withLabel: 'hello|bye' { cpus = 2 memory = 4.GB } } ``` -------------------------------- ### Plugin Spec Schema Example Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20250922-plugin-spec.md A basic example of a plugin specification JSON, including the schema reference and a list of definitions. ```json { "$schema": "https://raw.githubusercontent.com/nextflow-io/schemas/main/plugin/v1/schema.json", "definitions": [ { "type": "ConfigScope", "spec": { // ... } }, { "type": "Function", "spec": { // ... } }, ] } ``` -------------------------------- ### Minimal nf-core Module Example Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md A minimal example of an nf-core module definition, including metadata, input reads, and output reports. ```yaml name: fastqc description: Run FastQC on sequenced reads keywords: - quality control - qc - fastq tools: - fastqc: description: FastQC quality metrics homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ license: ["GPL-2.0-only"] identifier: biotools:fastqc authors: - "@drpatelh" maintainers: - "@drpatelh" input: - - meta: type: map description: Metadata map - reads: type: file description: List of input FastQ files output: html: - "*.html": type: file description: FastQC HTML report versions: - versions.yml: type: file description: Software versions ``` -------------------------------- ### Build Documentation with Docker Source: https://github.com/nextflow-io/nextflow/blob/master/docs/README.md Build the documentation within a Docker container for a consistent build environment. This involves building the Docker image and then running the build command inside the container. ```bash docker build -t nextflow/sphinx:5.3.0 . docker run -v $(pwd):/tmp nextflow/sphinx:5.3.0 -- make html ``` -------------------------------- ### Start Apple container service Source: https://github.com/nextflow-io/nextflow/blob/master/docs/container.md Start the system service for Apple container before running your pipeline. This is a prerequisite for using Apple container. ```bash container system start ``` -------------------------------- ### Temporary Directory Creation (nxf_mktemp) Source: https://github.com/nextflow-io/nextflow/blob/master/modules/nextflow/src/main/resources/nextflow/executor/command-run.txt Creates a temporary directory, supporting custom base directories and handling OS differences. ```bash nxf_mktemp() { local base=${1:-/tmp} mkdir -p "$base" if [[ $(uname) = Darwin ]]; then mktemp -d $base/nxf.XXXXXXXXXX else TMPDIR="$base" mktemp -d -t nxf.XXXXXXXXXX fi } ``` -------------------------------- ### Install AWS CLI with Miniconda Source: https://github.com/nextflow-io/nextflow/blob/master/docs/aws.md Installs the AWS CLI using Miniconda. Ensure you use a path that does not conflict with existing container files. ```bash cd $HOME sudo yum install -y bzip2 wget wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh -b -f -p $HOME/miniconda $HOME/miniconda/bin/conda install -c conda-forge --override-channels -y awscli rm Miniconda3-latest-Linux-x86_64.sh ``` -------------------------------- ### Verify Plugin Build Source: https://github.com/nextflow-io/nextflow/blob/master/specs/superpowers/plans/2026-04-17-seqera-resource-labels.md Run the Gradle wrapper command to check if the Seqera plugin builds successfully after the changes. ```bash ./gradlew :plugins:nf-seqera:check ``` -------------------------------- ### Include Modules from Registry and Local Files Source: https://github.com/nextflow-io/nextflow/blob/master/adr/20251114-module-system.md Demonstrates how to include modules from a remote registry using a scoped name and from local files using relative paths. Ensure the module name is correctly formatted for registry inclusion. ```groovy include { BWA_ALIGN } from 'nf-core/bwa-align' include { MY_PROCESS } from './modules/my-process.nf' ``` -------------------------------- ### Install a Nextflow Module Source: https://github.com/nextflow-io/nextflow/blob/master/specs/251117-module-system/quickstart.md Installs the latest version or a specific version of a module from a registry. The module is downloaded to the `modules/` directory and its version is recorded in `nextflow_spec.json`. ```bash # Install latest version nextflow module install nf-core/fastqc # Install specific version nextflow module install nf-core/fastqc -version 1.0.0 ``` -------------------------------- ### Display Nextflow Help Information Source: https://github.com/nextflow-io/nextflow/blob/master/docs/reference/cli.md Prints the top-level help overview of the CLI interface, including options and commands. This is equivalent to invoking `nextflow` without any arguments. ```console nextflow help [options] [command] ```