Skip to content

oandrefonseca/nf-quarto

Repository files navigation

DOI

nf-quarto

Welcome to nf-quarto, a robust and dynamic template that seamlessly integrates Nextflow pipelines with Quarto notebooks. Designed to enhance reproducibility and ease of use, this template is ideal for researchers and developers seeking to combine the power of workflow automation with the elegance of literate programming.

Key Features

  • Smart Skipping: Incorporates conditional execution logic inspired by the Sarek pipeline to efficiently manage workflow components.
  • Enhanced Session Management: Achieves seamless integration of Nextflow's -resume capability with Quarto's _freeze caching mechanism, preserving computational resources and time.
  • Dynamic Web Rendering: Automatically generates interactive, vignette-like websites that present your analysis with clarity and interactivity.
  • Flexible Parameter Handling: Manages parameters directly through the Quarto command line, providing a streamlined user experience.
  • Cross-Language Support: Offers full support for both Python and R notebooks, accommodating a wide range of scientific computing needs.

Quick Start Guide

Building the Docker image

docker build -t nf-quarto -f Dockerfile .

Running the Pipeline with Standard Settings

nextflow run main.nf -resume

Skipping modules

Avoid rendering specific modules by adjusting the run command as shown below:

nextflow run main.nf --skip_python true -resume

How to use and customize the template

If you want to use this template for your project without linking back to the original repository, you can clone it and then sever the link to the original remote:

  1. Clone the repository: Clone nf-quarto to your local machine:
git clone https://github.com/yourusername/nf-quarto.git
cd nf-quarto
  1. Remove the original remote: Remove the original origin to disconnect from the source repository:
git remote remove origin
  1. Set up a new remote (optional): If you have a new repository where you want to push changes, add it as the new origin:
git remote add origin https://github.com/yourusername/new-repo-name.git
git push -u origin master  # Replace 'master' with your branch if different

Assets and styling

The assets folder is essential for the visual presentation of the Quarto reports. It contains all necessary stylesheets and resources for the Quarto website rendering.

Logo customization

Included in the assets folder is the logotype.png. This default logo is meant to be replaced with your own to personalize the reports. Simply prepare your custom logo in PNG format, rename it to logotype.png, and replace the existing file in the assets folder to reflect your project's identity.

Configuration and automation

GitHub Actions

The repository is configured to use GitHub Actions to automatically build and publish the Docker image whenever changes are pushed to the main branch or when new tags that match the pattern v*.*.* are created. The action specifically tracks changes to the Dockerfile and the action's workflow file:

  • Dockerfile Path: docker/nf-quarto.Dockerfile
  • Workflow File Path: .github/workflows/docker-basic-publish.yml

To ensure the GitHub Actions workflow can push the Docker image to Docker Hub, you need to set up the following secrets in your repository:

  1. DOCKERHUB_USERNAME: Your Docker Hub username.
  2. DOCKERHUB_PASSWORD: Your Docker Hub password or access token.

For instructions on how to set up repository secrets, refer to the official GitHub documentation.

Docker configuration

Our Docker configuration is stored within the Docker directory of the repository. The Dockerfile nf-quarto.Dockerfile is located at docker/nf-quarto.Dockerfile.

Citation

If you utilize this repository in your research, please consider citing it. Your support helps us to continue improving our work and assisting the scientific community. Registered on Zenodo:

DOI

License

This project is available under the GNU General Public License v3.0. See the LICENSE file for more details.