Skip to content

An example private modules library built using nf-core tooling

License

Notifications You must be signed in to change notification settings

kenibrewer/nf-modules-demo

Repository files navigation

kenibrewer/nf-modules-demo

Adapted from nf-core/modules/README.md

Nextflow run with conda run with docker run with singularity

A demo nf-core style modules library generated using kenibrewer/nf-modules-template.

Table of contents

Using existing modules

The module files hosted in this repository define a set of processes for software tools that allow you to share and add common functionality across multiple pipelines in a modular fashion.

We use a helper command in the nf-core/tools package that uses the GitHub API to obtain the relevant information for the module files present in the modules/ directory of this repository. This includes using git commit hashes to track changes for reproducibility purposes, and to download and install all of the relevant module files.

  1. Install the latest version of nf-core/tools (>=2.0)

  2. List the available modules:

    nf-core modules --git-remote https://github.com/kenibrewer/nf-modules-demo.git list remote
                                 ,--./,-.
         ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                 `._,._,'
    
    nf-core/tools version 3.0.1 - https://nf-co.re
    
    INFO     Modules available from https://github.com/kenibrewer/nf-modules-demo.git (main):
    
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
    ┃ Module Name                    ┃
    ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
    │ examplemodule       │
    ..truncated..
  3. Install the module in your pipeline directory:

    nf-core modules --git-remote https://github.com/kenibrewer/nf-modules-demo.git install examplemodule
                                 ,--./,-.
         ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                 `._,._,'
    
    nf-core/tools version 3.0.1 - https://nf-co.re
    
    INFO     Installing 'examplemodule'
    INFO     Use the following statement to include this module:
    
       include { EXAMPLEMODULE } from '../modules/kbrewer/examplemodule/main'
  4. Import the module in your Nextflow script:

    #!/usr/bin/env nextflow
    
    nextflow.enable.dsl = 2
    
    include { EXAMPLEMODULE } from '../modules/kbrewer/examplemodule/main'
  5. Remove the module from the pipeline repository if required:

    nf-core modules --git-remote https://github.com/kenibrewer/nf-modules-demo.git remove examplemodule
                                 ,--./,-.
         ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                 `._,._,'
    
    nf-core/tools version 3.0.1 - https://nf-co.re
    
    INFO     Removed files for 'examplemodule' and its dependencies 'examplemodule'.
  6. Check that a locally installed nf-core module is up-to-date compared to the one hosted in this repo:

    nf-core modules --git-remote https://github.com/kenibrewer/nf-modules-demo.git lint examplemodule
                                 ,--./,-.
         ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                 `._,._,'
    
       nf-core/tools version 3.0.1 - https://nf-co.re
    
       INFO     Linting pipeline: '.'
       INFO     Linting module: 'examplemodule'
    
       ╭─ [!] 6 Module Test Warnings ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
       │              ╷                             ╷                                                                                                                                          │
       │ Module name  │ File path                   │ Test message                                                                                                                             │
       │╶─────────────┼─────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴│
       │ examplemodule       │ modules/kbrewer/examplemodule/main.nf  │ Unable to connect to container registry, code:  403, url: <https://www.docker.com/kbrewercc/examplemodule-suite:2.0.9>                                │
       │ examplemodule       │ modules/kbrewer/examplemodule/main.nf  │ Container versions do not match                                                                                                          │                                                                  │
       │              ╵                             ╵                                                                                                                                          │
       ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
       ╭───────────────────────╮
       │ LINT RESULTS SUMMARY  │
       ├───────────────────────┤
       │ [✔]  59 Tests Passed  │
       │ [!]   6 Test Warnings │
       │ [✗]   0 Tests Failed  │

Citation

If you use the module files in this repository for your analysis please you can cite the nf-core publication as follows:

The nf-core framework for community-curated bioinformatics pipelines.

Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.

Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.

Template

This module library was create using kenibrewer/nf-modules-template.

You can fetch updates to the library template by running:

pipx install copier
copier update

About

An example private modules library built using nf-core tooling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published