NanoMethViz is a Bioconductor package for visualising and summarising DNA methylation from Oxford Nanopore long-read sequencing.
It supports:
- tabular methylation calls (for example, Modkit, Megalodon, Nanopolish, and f5c)
- modBAM-based methylation calls
Install from Bioconductor:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("NanoMethViz")Install the Bioconductor devel version:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install(version = "devel")
BiocManager::install("NanoMethViz")For tabix-backed methylation data, NanoMethResult needs three inputs:
methy: path to a bgzip-compressed and tabix-indexed methylation filesamples: adata.framewith at least asamplecolumnexons: adata.framewith exon-level annotation
library(NanoMethViz)
# Example object bundled with the package
nmr <- load_example_nanomethresult()
# Region/gene visualisation
plot_gene(nmr, "Peg3")
# Group-level summaries
plot_agg_genes(nmr)
# Dimension reduction on methylation profiles
bss <- methy_to_bsseq(nmr)
gene_regions <- exons_to_genes(exons(nmr))
lmr <- bsseq_to_log_methy_ratio(bss, gene_regions)
plot_mds(lmr)
plot_pca(lmr)- Import methylation calls.
- Convert to tabix format if needed (
convert_methy_format(),create_tabix_file(),modbam_to_tabix()). - Prepare sample metadata and exon annotation (
get_exons_hg38(),get_exons_mm10(), or custom annotation). - Build a result object (
NanoMethResult()orModBamResult()). - Query and visualise methylation (
query_methy(),plot_gene(),plot_region(),plot_agg_genes(),plot_agg_regions(),plot_violin(),plot_region_heatmap()). - Export for downstream differential analysis (
methy_to_bsseq(),bsseq_to_edger()).
Choose the right object type:
- Use
NanoMethResultfor tabix-backed tabular methylation calls. - Use
ModBamResultfor modBAM-based workflows.
If you want to...
- plot one gene: use
plot_gene(x, gene) - plot one genomic interval: use
plot_region(x, chr, start, end) - show per-read heatmap in a region: use
plot_region_heatmap(x, chr, start, end) - aggregate over genes/regions: use
plot_agg_genes(x)/plot_agg_regions(x, regions) - get methylation values for a region: use
query_methy(x, chr, start, end) - run dimension reduction: use
plot_mds(log_methy_ratio_matrix)/plot_pca(log_methy_ratio_matrix) - export for differential testing: use
methy_to_bsseq(x), thenbsseq_to_edger(...)
- Chromosome naming must match across methylation calls and annotation (
chr1vs1). - Sample names in methylation data must match
samples$sample. - Exon annotation should include columns:
gene_id,chr,strand,start,end,transcript_id,symbol
options(NanoMethViz.site_filter = 3L): minimum site coverage used by query/plot functions.options(NanoMethViz.highlight_col = "grey50"): default colour for highlighted annotation regions.
- User Guide (Bioconductor vignette): https://www.bioconductor.org/packages/release/bioc/vignettes/NanoMethViz/inst/doc/UsersGuide.html
- User Guide (pkgdown site): https://shians.github.io/NanoMethViz/articles/UsersGuide.html
- Function reference index: https://shians.github.io/NanoMethViz/reference/index.html
- Issue tracker: https://github.com/Shians/NanoMethViz/issues
This project is licensed under Apache License, Version 2.0.


