nf-core/cookiecutter

Name: cookiecutter

Owner: Science For Life Laboratory

Owner: nf-core

Description: Template for your own top-end Nextflow pipeline, customised using Cookiecutter

Forked from: ewels/NGI-NFcookiecutter

Created: 2017-12-20 16:37:53.0

Updated: 2018-05-16 11:22:07.0

Pushed: 2018-05-16 11:22:06.0

Homepage: http://nf-co.re

Size: 132

Language: Nextflow

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NGI-NFcookiecutter

A template Nextflow analysis pipeline to built using Cookiecutter.

Run cookiecutter with this repository to create a new Nextflow pipeline built with the details that you add when prompted. This gives a quick route to a solid pipeline that uses lots of Nextflow best-practices and nice features.

Specifically, it comes with:

Usage
Step 1: Run cookiecutter

To use this template, first install cookiecutter:

install cookiecutter

Then run the wizard with this repository:

iecutter https://github.com/ewels/NGI-NFcookiecutter.git
Step 2: Publish to GitHub

Create a new repository to hold your pipeline on GitHub. Match the variables that you entered whilst running the cookiecutter script (github_repo). Don't initialise with a README or any files, leave it blank.

Back on your computer, change directory into your new pipeline folder and initialise a git repository:

init

Add your generated files, commit and push to GitHub:

add .
commit -m "First commit, based on NGI-NFcookiecutter template"
remote add origin [your github remote url]
push -u origin master
Step 3: Write your pipeline!

Using the examples of FastQC and MultiQC, add in the steps that you want in your pipeline.

Remember that you can add process-specific configuration (eg. memory requirements) in conf/base.config.

Step 4: Edit the Dockerfile

Your Nextflow pipeline will work best when using Docker and Singularity to handle software requirements. The pipeline comes with a basic Docker template file (Dockerfile) which installs FastQC and MultiQC. Edit this to add in any additional software packages that you need.

Step 5: Publish your docker image

Nextflow and this pipeline are set up to automatically pull the docker image when the pipeline runs. Set up a new docker image on dockerhub (https://hub.docker.com/) at the address that you entered in the setup (dockerhub_slug).

Make sure that you create an Automated Build that is connected to your GitHub repository and set to automatically build an image when you commit to master. Add a second automated build under Build Settings so that an image is built when you create a new tag (stick with the default - every tag, same name as tag).

Step 6: Write up the documentation

This cookiecutter comes with some basic documentation that's general to Nextflow, but you'll want to write some docs which are specific to your pipeline.

Note that docs/output.md is converted to HTML by the pipeline and saved to the results directory, so you'll want to be especially sure that this contains useful information.

Step 7: Set up automated testing

Edit the demo data URL in tests/run_test.sh to point to a valid location and edit to run with required configuration.

Go to https://travis-ci.org/ and enable testing on your pipeline repository.

Step 8: Release your pipeline

Once you're happy that your pipeline works, make a release on GitHub! This tags a stable version of your pipeline and associated docker image. People can then run your pipeline directly from GitHub with -r [version] to get super reproducible results!

Remember to update the version variable in your main script as you keep working after this.

Celebrate!

That's it! You've just made a super cool new analysis pipeline in very little time! Congratulations!

Credits

This template and most of the scripts within were written by Phil Ewels (@ewels) at the National Genomics Infrastructure, part of SciLifeLab in Stockholm, Sweden.


SciLifeLab National Genomics Infrastructure



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.