nf-core/methylseq
repository·master·Indexed 41 days ago
https://github.com/nf-core/methylseqA 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.
What's inside nf-core/methylseq
- 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.
Understand the nf-core/methylseq pipeline workflow
masterThe
nf-core/methylseqpipeline 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).
Access nf-core/methylseq documentation
masterThe documentation for the
nf-core/methylseqpipeline 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.
Provide additional arguments to tools via ext.args
masterYou can append additional arguments to a specific tool/module by modifying its custom configuration in
conf/modulesorconf/subworkflows.Example Use Case: To bypass OS file handle limits (e.g.,
ulimit -ashowing 1024) when working with genomes containing many scaffolds, you can add the--scaffoldsoption asext.argsinconf/modules/bismark_methylationextractor.config. This prevents methylation calls from being pre-sorted into individual chromosome files.Workflow: BWA-MEM + TAPS (TET-Assisted Pyridine borane Sequencing)
masterThe 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
--tapsflag is specified, the pipeline automatically uses Rastair for methylation calling, validates aligner compatibility (preventing Bismark usage), and configures Picard MarkDuplicates. - Optimization: Using
--aligner bwamemautomatically triggers the use of Rastair for methylation calling, even if the--tapsflag is not explicitly provided, asbwamemis optimized for TAPS data.
- Automatic Configuration: When the
Choose an alignment workflow
masterThe pipeline supports several different alignment strategies depending on your data type and performance requirements. You select the workflow using the
--alignerflag:--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 thebwa-meth/MethylDackelworkflow.--aligner bwamem: UsesBWA-Memcombined with therastairtool for TAPS data processing.
Performance Optimizations
- BWA-MEM2: For faster CPU-based runs using the
bwa-methworkflow, enable the BWA-MEM2 algorithm with the--use_mem2flag. - GPU Acceleration (Parabricks): For high-performance GPU runs, use the
gpuprofile with either--aligner bwamethor--aligner bwamem. Note that the GPU pathway requires a container runtime (Docker, Singularity, or Podman) and does not support Conda/Mamba.
Compare Bismark and BWA-Meth aligners
masterThe
nf-core/methylseqpipeline 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.
Feature Bismark BWA-Meth Core algorithm Bowtie2/HISAT2 BWA-MEM Efficiency More intensive Faster/More efficient Output SAM/BAM + integrated methylation/QC Standard SAM/BAM (requires external tools) Downstream Built-in calling/filtering Requires external tools Use Case Accuracy & detail priority Speed & scalability priority Workflow: Bismark
masterThe 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_hisatflag. For splice-aware alignment, you can provide known splice sites using the--known_splicesparameter.nextflow run nf-core/methylseq --aligner bismark_hisatInterpret Preseq complexity curves
masterThe
preseqstep 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/preseqsample_ccurve.txt: Contains the plot values used for the MultiQC complexity curve.
Use a parameters file for pipeline settings
masterTo avoid specifying long lists of flags in the command line, you can use a
yamlorjsonfile via the-params-fileflag. 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-cflag is reserved for Nextflow configuration files used for tuning resources or module arguments. Use-params-filefor pipeline parameters likeinput,outdir, orgenome.nextflow run nf-core/methylseq -profile docker -params-file params.yamlExample
params.yaml:input: './samplesheet.csv' outdir: './results/' genome: 'GRCh37' <...>Requirements for nf-core/methylseq
masterTo 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.
Update the pipeline code
masterNextflow caches the pipeline code locally. To ensure you are running the latest version of the pipeline, you must manually pull the updates using the
pullcommand.nextflow pull nf-core/methylseq