I am using WGBS methylation data from CEEHRC project through DeppBlueR package and visualise it using Gviz. First track is a HM450 probes. Second track is obviously the bases sequence of the genome. Third track is WGBS .
When plotting these data at high resolution I can see that the methylation data are 1 base left of where it should be (aligned with GC instead of the following CG), as I understand the data and as I can see in UCSC genome browser:
I guess that this is because bedgraph data uses 0 based genomic coordinates while R uses 1 based ranges.
Can I convert CEEHRC 0 based into 1 based coordinates easily so the data align properly to the genome?
PS: I also know that my HM450 probe should also align with only one base... work in progress...
library(Gviz) library(DeepBlueR) library(FDb.InfiniumMethylation.hg19) library(BSgenome.Hsapiens.UCSC.hg19) # HM450 methylation assay probes from FDb.InfiniumMethylation.hg19 package hm450 <- get450k() probenames <- "cg23699648" probes <- hm450[probenames] HM450 <- AnnotationTrack(probes, chromosome = "chr6", genome = "hg19", name = "HM450", strand = c("*"), id = 1, cex.title = 0.5, min.width = 2, fill = "darkblue", col = NULL, rotation.title = 0, fontcolor.feature = "darkblue", background.title="darkgrey") # WGBS (Methylation) for Breast Luminal progenitors from CEEHRC project track with DeepBlueR package query_id <- deepblue_select_experiments( experiment_name= c("A34409.3_lanes_dupsFlagged.q5.f0.5mC.CpG.fractional.bedgraph"), chromosome="chr6", start=121756532, end=121756593 ) request_id <- deepblue_get_regions(query_id=query_id, output_format="CHROMOSOME,START,END,VALUE,@BIOSOURCE,@SAMPLE_ID,@NAME,@PROJECT") regions <- deepblue_download_request_data(request_id=request_id) genome(regions) <- "hg19" regions@elementMetadata[["@CELL_TYPE"]] <- t(samples[match(regions@elementMetadata[,"@SAMPLE_ID"], samples[]),"cell_type"]) df <- data.frame(iranges = regions) MethylationProg <- DataTrack(regions, name = "Prog", genome="hg19", type = "h", ylim = c(0,100), background.title = "darkgray", cex.title = 0.5, cex.axis = 0.5, col = "#c49d60", lwd.title = 1) # strack from BSgenome.Hsapiens.UCSC.hg19 package strack <- SequenceTrack(Hsapiens, chromosome = "chr6", cex = 0.5) # Plot the track with Gviz package plotTracks(list(HM450, strack, MethylationProg), from = 121756532, to = 121756593, main = "Probe 3", cex.main = 0.9)