Skip to content

mahesh-panchal/Nextflow_sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A playground for exploring Nextflow and nf-core

This repository is a place to explore Nextflow and nf-core functions in the Devcontainer/Codespaces or local environment.

The Devcontainer environment (a docker container) comes installed with:

  • Git
  • Docker
  • Apptainer
  • Conda
  • Nextflow
  • nf-core
  • nf-test

The Dockerfile for this environment lives on nf-core/tools.

Alternatively, you can use Pixi to run Nextflow in a local conda-like environment. You'll need to install a container platform or conda yourself to run workflows with a package manager.

Explore

Explore shell commands in a process:
workflow {
    TASK( Channel.of( 1..3 ) )
        .view()
}

process TASK {
    input:
    val num

    script:
    """
    echo "Num: $num"
    """

    output:
    stdout
}
Explore channel operator output:
workflow {
    Channel.of( 'A' )
        // Convert channel entry to Map
        .map { it -> [ letter: it ] }
        .view()
    // TASK()
}

// process TASK {
    // input:

    // script:
    // """
    // """

    // output:
// }
Explore configuration settings:
workflow {
    TASK()
}

process TASK {
    input:

    script:
    """
    touch versions.{txt,yml}
    """

    output:
    path "versions.txt"
    path "versions.yml"
}
// Try excluding versions.yml from output - Failed
process.publishDir = [ path: "results", pattern: "{!versions.yml}" ]
Explore using Groovy in Nextflow:
// Can I use subMap on a key not present - yes
println ( [ id: 'test' ].subMap( ['id','sample'] ) )

// workflow {
    // TASK()
// }

// process TASK {
    // input:

    // script:
    // """
    // """

    // output:
// }

About

A playground to explore how to implement things in Nextflow and nf-core

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published