This is a Snakemake workflow for analyzing Oxford Nanopore Technologies (ONT) sequencing data, with a focus on methylation calling and structural variant detection. This pipeline processes raw ONT reads (POD5 format) through basecalling, alignment, methylation analysis, and various structural variant calling methods.
- Basecalling and QC: Uses Dorado for basecalling with modified base detection, followed by quality assessment with PycoQC
- Alignment: High-quality read mapping with Minimap2
- Methylation Analysis:
- Methylation pileup with ONT Modkit
- Visualization with methylartist
- Structural Variant Detection: Multiple SV callers for comprehensive detection
- Clair3 for SNV/indel calling
- ClairS for somatic variant detection in tumor-normal pairs
- Sniffles2 for germline structural variation detection
- Severus for germline and somatic structural variation detection
- Snakemake (>=7.0)
- Conda or Mamba (for environment management)
- For GPU-accelerated basecalling: CUDA-compatible GPU
- Clone this repository:
git clone https://github.com/cnio-bu/myeloma-epi-sv.git
cd myeloma-epi-sv- Create your config file:
cp config/config.yaml.example config/config.yaml- Edit the configuration file to match your environment, data locations, and analysis parameters.
The pipeline is configured through the config/config.yaml file, which includes:
- Reference files: Paths to genome reference, annotations, and other required files
- Tool paths: Locations of external tools like dorado and Clair3 models
- Analysis parameters: Quality thresholds and analysis options
- Samples structure: Hierarchical organization of samples with associated metadata
- Resource specifications: Resource allocation for different workflow steps
See config/config.yaml.example for a detailed example of the configuration structure.
Run the full pipeline with:
snakemake --use-conda --cores <N>For cluster environments using Slurm:
snakemake --use-conda --profile slurmSome rules run inside containers rather than Conda environments. In particular,
the clairs rule runs in the hkubal/clairs Docker/Apptainer image and refers
to its inputs and outputs as absolute paths inside the container (e.g.
/results/..., /models/..., /logs/...). For those paths to resolve, the
corresponding host directories must be bind-mounted into the container at those
locations.
Pass the binds through --apptainer-args (use --singularity-args if you run
Singularity instead of Apptainer):
snakemake \
--sdm conda apptainer \
--apptainer-args "-B /path/on/host/results/:/results/,/path/on/host/clairs_models/:/models/,/path/on/host/logs/:/logs/" \
--executor slurmReplace the /path/on/host/... entries with the actual locations of your
results/, ClairS model, and logs/ directories. The format of each bind is
<host_path>:<container_path>.
- Basecalling: Convert raw POD5 files to BAM format with Dorado, including modified base detection
- Quality Control: Generate QC metrics and reports with PycoQC
- Quality Filtering: Filter reads based on quality score
- Alignment: Map reads to reference genome with Minimap2
- Coverage Analysis: Generate coverage statistics with Mosdepth and samtools
- Methylation Analysis:
- Extract methylation information with Modkit
- Visualize methylation patterns with methylartist
- Variant Calling:
- SNV/indel detection with Clair3
- Somatic variant detection with ClairS (for tumor-normal pairs)
- Germline structural variant detection with Sniffles2
- Germline/somatic structural variation detection with Severus
The pipeline generates results in a hierarchical directory structure:
results/
├── basecall_dorado/ # Basecalled reads
├── pycoqc/ # Quality control reports
├── minimap2/ # Aligned reads
├── primary/ # Filtered primary alignments
├── mosdepth/ # Coverage statistics
├── modkit/ # Methylation data
├── methylartist/ # Methylation visualizations
├── clair3/ # Small variant calls
├── sniffles/ # Structural variant calls
├── severus/ # Tandem repeat expansions
└── clairs/ # Somatic variants
Run the included integration test to verify that the pipeline is properly installed:
export SKIP_BASECALLING=true #skip this line to run the GPU-based basecalling step
bash .tests/integration/get_resources.sh
snakemake --sdm conda --cores 1 --directory .tests/integration