nf-core/methylseq

repository·master·Indexed 41 days ago

https://github.com/nf-core/methylseq

A Nextflow-based bioinformatics pipeline for processing Methylation (Bisulfite) sequencing data. It supports multiple alignment workflows including Bismark, bwa-meth, and BWA-Mem/TAPS, and offers GPU acceleration via NVIDIA Parabricks. The pipeline handles raw FastQ inputs, read alignment, adapter trimming via TrimGalore, deduplication, and methylation extraction, providing quality control reports through FastQC and MultiQC.

Tokens
8.9K
Snippets
27
Records
43
Agent score
48%

What's inside nf-core/methylseq

  1. Overview of nf-core/methylseq

    master
    nf-core/methylseq is a bioinformatics analysis pipeline designed for Methylation (Bisulfite) sequencing data. It processes raw FastQ inputs, performs read alignment, and provides extensive quality control (QC) on the results. The pipeline is built on Nextflow, ensuring portability across different compute infrastructures using container technologies like Docker, Singularity, Podman, Apptainer, and Charliecloud.
  2. Understand the nf-core/methylseq pipeline workflow

    master

    The nf-core/methylseq pipeline is a Nextflow-based workflow designed for processing methylation sequencing data. The specific output files generated depend on the alignment workflow selected (Bismark, bwa-meth, or bwa-mem) and whether additional protocols like TAPS (processed via Rastair) are used.

    Core processing steps include:

    • FastQC: Raw read quality control.
    • TrimGalore: Adapter trimming.
    • Alignment: Mapping reads to a reference genome.
    • Deduplication: Removing duplicate reads.
    • Methylation Extraction: Calling cytosine methylation.
    • MultiQC: Aggregating results into a single report.

    Optional steps include Reference Genome Preparation, Qualimap (alignment QC), Preseq (sample complexity estimation), and HS Metrics (target-capture performance).

  3. Access nf-core/methylseq documentation

    master

    The documentation for the nf-core/methylseq pipeline is organized into specific sections for usage and output. For general information regarding the installation, configuration, and execution of any nf-core pipeline, refer to the central nf-core website.

    • Usage: Detailed overview of pipeline operation, execution instructions, and command-line flag descriptions.
    • Output: Description of produced results and guidance on how to interpret them.
  4. Provide additional arguments to tools via ext.args

    master

    You can append additional arguments to a specific tool/module by modifying its custom configuration in conf/modules or conf/subworkflows.

    Example Use Case: To bypass OS file handle limits (e.g., ulimit -a showing 1024) when working with genomes containing many scaffolds, you can add the --scaffolds option as ext.args in conf/modules/bismark_methylationextractor.config. This prevents methylation calls from being pre-sorted into individual chromosome files.

  5. Workflow: BWA-MEM + TAPS (TET-Assisted Pyridine borane Sequencing)

    master

    The pipeline supports TAPS data analysis, which preserves the original DNA sequence while converting methylated cytosines to thymine.

    Key Features of TAPS Workflow

    • Automatic Configuration: When the --taps flag is specified, the pipeline automatically uses Rastair for methylation calling, validates aligner compatibility (preventing Bismark usage), and configures Picard MarkDuplicates.
    • Optimization: Using --aligner bwamem automatically triggers the use of Rastair for methylation calling, even if the --taps flag is not explicitly provided, as bwamem is optimized for TAPS data.
  6. Choose an alignment workflow

    master

    The pipeline supports several different alignment strategies depending on your data type and performance requirements. You select the workflow using the --aligner flag:

    • --aligner bismark (default): Uses Bismark (which utilizes bowtie2 for alignment). This workflow includes Bismark-specific sample and summary reports.
    • --aligner bismark_hisat: Uses Bismark with HISAT2.
    • --aligner bwameth: Uses the bwa-meth / MethylDackel workflow.
    • --aligner bwamem: Uses BWA-Mem combined with the rastair tool for TAPS data processing.

    Performance Optimizations

    • BWA-MEM2: For faster CPU-based runs using the bwa-meth workflow, enable the BWA-MEM2 algorithm with the --use_mem2 flag.
    • GPU Acceleration (Parabricks): For high-performance GPU runs, use the gpu profile with either --aligner bwameth or --aligner bwamem. Note that the GPU pathway requires a container runtime (Docker, Singularity, or Podman) and does not support Conda/Mamba.
  7. Compare Bismark and BWA-Meth aligners

    master

    The nf-core/methylseq pipeline supports two primary 'three-base aligners' for bisulfite sequencing. Choosing between them depends on your priority for accuracy versus computational efficiency.

    Bismark

    • Approach: Performs up to four parallel alignments by converting reads in silico to represent both forward and reverse strand conversions (C-to-T and G-to-A).
    • Best for: High accuracy and detailed methylation context. It includes built-in methylation calling, deduplication, and reporting.
    • Note: In this pipeline, Bismark uses Bowtie2 or HISAT2. Long-read aligners are not currently supported.

    BWA-Meth

    • Approach: Adapts the BWA-MEM algorithm to map bisulfite-converted reads to an in silico converted reference. It uses streaming to convert reads on the fly, reducing temporary storage.
    • Best for: Speed, scalability, and modular workflows. It is generally faster and more efficient but requires external tools (like MethylDackel) for methylation calling and QC.
    FeatureBismarkBWA-Meth
    Core algorithmBowtie2/HISAT2BWA-MEM
    EfficiencyMore intensiveFaster/More efficient
    OutputSAM/BAM + integrated methylation/QCStandard SAM/BAM (requires external tools)
    DownstreamBuilt-in calling/filteringRequires external tools
    Use CaseAccuracy & detail prioritySpeed & scalability priority
  8. Workflow: Bismark

    master

    The default workflow uses Bismark with Bowtie2 for alignment. This is optimized for most DNA methylation workflows.

    Using HISAT2 with Bismark

    Starting with Bismark v0.21.0, you can use HISAT2 as an alternative aligner (useful for RNA-based analyses like SLAMseq) by using the --aligner bismark_hisat flag. For splice-aware alignment, you can provide known splice sites using the --known_splices parameter.

    nextflow run nf-core/methylseq --aligner bismark_hisat
  9. Interpret Preseq complexity curves

    master

    The preseq step estimates library complexity by predicting how many additional unique reads are sequenced as the total read count increases.

    • A shallow curve indicates complexity saturation: further sequencing is unlikely to yield more unique reads.
    • A dashed line represents a perfectly complex library where total reads equal unique reads.

    Note: Values are predictive, not absolute. If the MultiQC plot shows extreme sequencing depth on the X axis, click and drag from the left side of the plot to zoom in on realistic values.

    Output directory: results/preseq

    • sample_ccurve.txt: Contains the plot values used for the MultiQC complexity curve.
  10. Use a parameters file for pipeline settings

    master

    To avoid specifying long lists of flags in the command line, you can use a yaml or json file via the -params-file flag. This is recommended for reproducibility and ease of use.

    Warning: Do not use -c <file> to specify pipeline parameters; this will result in errors. The -c flag is reserved for Nextflow configuration files used for tuning resources or module arguments. Use -params-file for pipeline parameters like input, outdir, or genome.

    nextflow run nf-core/methylseq -profile docker -params-file params.yaml

    Example params.yaml:

    input: './samplesheet.csv'
    outdir: './results/'
    genome: 'GRCh37'
    <...>
  11. Requirements for nf-core/methylseq

    master

    To run the nf-core/methylseq pipeline, ensure you meet the following requirements:

    • Nextflow: version >= 24.10.5
    • Container Runtime: Docker, Singularity, Podman, Charliecloud, or Apptainer.
    • Conda/Mamba: Supported for CPU workflows. Note that the Parabricks GPU pathway does not support Conda/Mamba.