inrb-labgenpath / bacQC

pipelines for QC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bacQC

Nextflow run with conda run with docker run with singularity

Introduction

bacQC is a bioinformatics analysis pipeline for trimming Illumina reads with fastp, assessing read quality with fastQC and species composition with Kraken2 and Bracken. It also allows reads to be extracted using a Taxon id (optional).

The pipeline is built using Nextflow, a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The Nextflow DSL2 implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies.

Pipeline summary

  1. Read QC (FastQC)
  2. Calculate fastq summary statistics (fastq-scan)
  3. Trim reads for quality and adapter sequence (fastp)
  4. Assign taxonomic labels to sequence reads (Kraken 2)
  5. Re-estimate taxonomic abundance of samples analyzed by kraken 2(Bracken)
  6. Extract reads using Taxon ID (KrakenTools)) (OPTIONAL)
  7. Present QC and visualisation for raw read, trimmed read and kraken2/Bracken results (MultiQC)

Quick Start

  1. Install Nextflow (>=21.10.3)

  2. Install any of Docker, Singularity (you can follow this tutorial), Podman, Shifter or Charliecloud for full pipeline reproducibility (you can use Conda both to install Nextflow itself and also to manage software within pipelines. Please only use it within pipelines as a last resort; see docs).

  3. Download taxonomic databases for Kraken 2 and Bracken (this is a large file and may take a while):

    wget ftp://ftp.ccb.jhu.edu/pub/data/kraken2_dbs/old/minikraken2_v1_8GB_201904.tgz
    
    tar xvfz minikraken2_v1_8GB_201904.tgz
  4. Download the pipeline and test it on a minimal dataset with a single command:

    nextflow run avantonder/bacQC -profile test,YOURPROFILE --outdir <OUTDIR>

    Note that some form of configuration will be needed so that Nextflow knows how to fetch the required software. This is usually done in the form of a config profile (YOURPROFILE in the example command above). You can chain multiple config profiles in a comma-separated string.

    • The pipeline comes with config profiles called docker, singularity, podman, shifter, charliecloud and conda which instruct the pipeline to use the named tool for software management. For example, -profile test,docker.
    • Please check nf-core/configs to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use -profile <institute> in your command. This will enable either docker or singularity and set the appropriate execution settings for your local compute environment.
    • If you are using singularity, please use the nf-core download command to download images first, before running the pipeline. Setting the NXF_SINGULARITY_CACHEDIR or singularity.cacheDir Nextflow options enables you to store and re-use the images from a central location for future pipeline runs.
    • If you are using conda, it is highly recommended to use the NXF_CONDA_CACHEDIR or conda.cacheDir settings to store the environments in a central location for future pipeline runs.
  5. An executable Python script called fastq_dir_to_samplesheet.py has been provided and would like to auto-create an input samplesheet based on a directory containing FastQ files before you run the pipeline (requires Python 3 installed locally) e.g.

    wget -L https://raw.githubusercontent.com/avantonder/bacQC/main/bin/fastq_dir_to_samplesheet.py
    ./fastq_dir_to_samplesheet.py <FASTQ_DIR> samplesheet.csv -r1 <FWD_FASTQ_SUFFIX> -r2 <REV_FASTQ_SUFFIX> 

Alternatively the samplesheet.csv file created by nf-core/fetchngs can also be used.

  1. Start running your own analysis!

    • Typical command for QC and species composition
    nextflow run avantonder/bacQC \
        -profile <docker/singularity/podman/conda/institute> \
        --input samplesheet.csv \
        --kraken2db minikraken2_v1_8GB \
        --brackendb minikraken2_v1_8GB \
        --genome_size 4300000 \
        --outdir <OUTDIR>
    • Typical command for QC, species composition and read extraction using a taxon ID
    nextflow run avantonder/bacQC \
        -profile <docker/singularity/podman/conda/institute> \
        --input samplesheet.csv \
        --kraken2db minikraken2_v1_8GB \
        --brackendb minikraken2_v1_8GB \
        --genome_size 4300000 \
        --kraken_extract \
        --tax_id <TAXON_ID> \
        --outdir <OUTDIR>

Documentation

The avantonder/bacQC pipeline comes with documentation about the pipeline usage, parameters and output.

Acknowledgements

bacQC was originally written by Andries van Tonder.

I wouldn't have been able to write this pipeline with out the tools, documentation, pipelines and modules made available by the fantastic nf-core community.

Feedback

If you have any issues, questions or suggestions for improving bovisanalyzer, please submit them to the Issue Tracker.

Citations

An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.

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.

About

pipelines for QC

License:MIT License


Languages

Language:Groovy 38.2%Language:Nextflow 37.0%Language:Python 22.6%Language:HTML 2.2%