Entering edit mode
sinha.puja
▴
10
@sinhapuja-18708
Last seen 4.7 years ago
Hi All,
I have a file list consisting of Chromosome, Start , End & Methylation Difference in the following format in excel:
Chrom Start End Meth. Diff
chr1 38565900 38566000 -0.20276818
chr1 38870400 38870500 -0.342342342
chr1 39469400 39469500 -0.250260552
chr1 52013600 52013700 -0.37797619
chr1 52751700 52751800 0.257575758
chr1 75505100 75505200 -0.262847308
I need help in plotting the DMRs using Gviz package in R. I tried a code below but it doesn't turn out correct.
library(Gviz)
library(GenomicRanges)
library(BSgenome)
library(Biostrings)
library(XVector)
library(readxl)
library(BSgenome.Rnorvegicus.UCSC.rn6)
genome <- getBSgenome("BSgenome.Rnorvegicus.UCSC.rn6")
genome
data1 <- read_excel("DMRs_plots.xlsx")
library(rtracklayer)
track1 <- DataTrack(data = data1, from = "38565900" , to = "75505200", chromosome = Chrom$chr1, name = "DMRs")
plotTracks(track1)
If anyone know how to plot and correct my code including how to add methylation difference values, then that will be of great help.
Thanks.
Thanks James. I modified the code below as:
But the quoted last step gives me error as below: Error: 'range' must be an object of class 'character' of length 1
Thanks.
You should compare what I did with what you did. It's quite different.
Hi, This time I exactly followed your code but again the same step gives following error: Error in .fillWithDefaults(range, defaults[missing], args[missing], len = nrow(range)) : The mandatory argument 'NA' is missing with no default. I don't know how to troubleshoot this.
Thanks.
You couldn't have followed my code and got that error, because the code I show doesn't generate an error! This is a deterministic process - if you do what I have done, and it works for me, then by definition it will work for you. So you must have done something different.
If you plan to learn R, you need to pay better attention. For example, I said I did
And then you did
Seeming to think that those were the same things. They aren't even remotely close to the same thing! Do you see why not? I also showed you the help page for how to create a
data.frame
that will work forDataTrack
. It's quite clear, if you read and try to understand.