bio-long-read-sequencing-nanopore-methylation
$
npx mdskill add GPTomics/bioSkills/bio-long-read-sequencing-nanopore-methylationCalls DNA methylation from Oxford Nanopore reads using signal-level analysis
- Detects 5mC or 6mA modifications directly from nanopore reads without bisulfite conversion
- Uses modkit and requires aligned BAM files with MM/ML tags from basecalling
- Analyzes signal-level data to extract methylation probabilities per site
- Outputs methylation results in bedMethyl format with per-site coverage and modification percentages
SKILL.md
.github/skills/bio-long-read-sequencing-nanopore-methylationView on GitHub ↗
---
name: bio-long-read-sequencing-nanopore-methylation
description: Calls DNA methylation from Oxford Nanopore sequencing data using signal-level analysis. Use when detecting 5mC or 6mA modifications directly from nanopore reads without bisulfite conversion.
tool_type: cli
primary_tool: modkit
---
## Version Compatibility
Reference examples tested with: methylKit 1.28+, minimap2 2.26+, samtools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Nanopore Methylation Calling
**"Call methylation from my Nanopore reads"** → Extract 5mC/6mA modification probabilities from basecalled reads and summarize per-site methylation frequencies.
- CLI: `modkit pileup aligned.bam methylation.bed --ref ref.fa`
## Modern Workflow (modkit)
ONT's modkit is the recommended tool for methylation analysis from basecalled data.
### Extract Methylation from BAM
```bash
# Assumes BAM has MM/ML tags from dorado basecalling
modkit pileup input.bam methylation.bed \
--ref reference.fa \
--cpg \
--combine-strands
```
### Output Format
```
# bedMethyl format
chr1 1000 1001 . 10 + 1000 1001 0,0,0 10 80.5
# Columns: chrom, start, end, name, score, strand, thickStart, thickEnd,
# itemRgb, coverage, percent_modified
```
## Basecalling with Methylation
```bash
# Dorado basecalling with 5mC model
dorado basecaller dna_r10.4.1_e8.2_400bps_sup@v4.2.0 \
pod5_dir/ \
--modified-bases 5mCG \
> calls.bam
# Index and align
samtools fastq calls.bam | \
minimap2 -ax map-ont -y reference.fa - | \
samtools sort -o aligned.bam
samtools index aligned.bam
```
## Region-Specific Analysis
```bash
# CpG islands only
modkit pileup aligned.bam cpg_islands.bed \
--ref reference.fa \
--cpg \
--include-bed cpg_islands.bed
# Promoter regions
modkit pileup aligned.bam promoters.bed \
--ref reference.fa \
--cpg \
--include-bed promoters.bed
```
## Sample Summary
```bash
# Get modification summary statistics
modkit summary aligned.bam
# Output includes:
# - Total reads with modifications
# - Modification types detected
# - Fraction modified per type
```
## Differential Methylation
```bash
# Create BED files for each sample
modkit pileup sample1.bam sample1.bed --ref ref.fa --cpg
modkit pileup sample2.bam sample2.bed --ref ref.fa --cpg
# Compare with methylKit or DSS in R
```
## Quality Considerations
- Minimum coverage: 10x for reliable calls
- Modified base probability threshold: 0.5 default, adjust as needed
- Combine strands for CpG (symmetric methylation)
## Related Skills
- long-read-sequencing/basecalling - Dorado basecalling
- methylation-analysis/methylation-calling - General methylation concepts
- methylation-analysis/dmr-detection - Differential methylation
More from GPTomics/bioSkills
- bio-admet-predictionPredicts ADMET properties using ADMETlab 3.0 API or DeepChem models. Estimates bioavailability, CYP inhibition, hERG liability, and 119 toxicity endpoints with uncertainty quantification. Filters for PAINS and other structural alerts. Use when filtering compounds for drug-likeness or prioritizing leads by predicted safety.
- bio-alignment-amplicon-clippingTrim PCR primers from aligned reads in amplicon-panel BAMs using samtools ampliconclip. Use when processing SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, or any amplicon assay where primer-derived bases would falsely confirm reference at primer footprints.
- bio-alignment-filteringFilter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.
- bio-alignment-indexingCreate and use BAI/CSI indices for BAM/CRAM files using samtools and pysam. Use when enabling random access to alignment files or fetching specific genomic regions.
- bio-alignment-ioRead, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.
- bio-alignment-msa-parsingParse and analyze multiple sequence alignments using Biopython. Extract sequences, identify conserved regions, analyze gaps, work with annotations, and manipulate alignment data for downstream analysis. Use when parsing or manipulating multiple sequence alignments.
- bio-alignment-msa-statisticsCalculate alignment statistics including sequence identity, conservation scores, substitution matrices, and similarity metrics. Use when comparing alignment quality, measuring sequence divergence, and analyzing evolutionary patterns.
- bio-alignment-multiplePerform multiple sequence alignment using MAFFT, MUSCLE5, ClustalOmega, or T-Coffee. Guides tool and algorithm selection based on dataset size, sequence divergence, and downstream application. Use when aligning three or more homologous sequences for phylogenetics, conservation analysis, or evolutionary studies.
- bio-alignment-pairwisePerform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner. Use when comparing two sequences, finding optimal alignments, scoring similarity, and identifying local or global matches between DNA, RNA, or protein sequences.
- bio-alignment-sortingSort alignment files by coordinate or read name using samtools and pysam. Use when preparing BAM files for indexing, variant calling, or paired-end analysis.