Skip to contents

Convert BSseq object to edgeR methylation matrix

Usage

bsseq_to_edger(bsseq, regions = NULL)

Arguments

bsseq

the BSseq object.

regions

the regions to calculate log-methylation ratios over. If left NULL, ratios will be calculated per site.

Value

a matrix compatible with the edgeR differential methylation pipeline

Examples

methy <- system.file("methy_subset.tsv.bgz", package = "NanoMethViz")
bsseq <- methy_to_bsseq(methy)
#> [2024-08-22 04:04:34] creating intermediate files...
#> [2024-08-22 04:04:34] parsing chr11...
#> [2024-08-22 04:04:34] parsing chr12...
#> [2024-08-22 04:04:34] parsing chr18...
#> [2024-08-22 04:04:34] parsing chr5...
#> [2024-08-22 04:04:34] parsing chr7...
#> [2024-08-22 04:04:34] parsing chrX...
#> [2024-08-22 04:04:34] samples found: B6Cast_Prom_3_cast B6Cast_Prom_3_bl6 B6Cast_Prom_2_cast B6Cast_Prom_2_bl6 B6Cast_Prom_1_cast B6Cast_Prom_1_bl6 
#> [2024-08-22 04:04:34] creating bsseq object...
#> [2024-08-22 04:04:34] reading in parsed data...
#> [2024-08-22 04:04:34] constructing matrices...
#> [2024-08-22 04:04:34] done
edger_mat <- bsseq_to_edger(bsseq)