Entering edit mode
                    5.7 years ago
        sinha.puja
        
    
        ▴
    
    20
    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.
Please save your data in plain text format (csv/tsv). Excel does not play well with bioinformatics and has a lot of room for errors that are invisible to the untrained eye.
A few quick questions:
data1object to ensure it looks accurate?genomeobject to the track you're plotting?librarycalls? You're only usingGviz,readxlandBSgenome.Thanks for your suggestion, I will save my data in .csv format. Reply for quick questions as follows:
head (data1), it looks fine to me.Thanks.
It should automatically load required packages. I'm not sure why or how "it's asking" for those
I think you can save a copy of your data as bedgraph and use it as a datatrack, so there will be a plot under your chromosome track. If you search bedgraph in the following link you can see an example:
https://www.bioconductor.org/packages/devel/bioc/vignettes/Gviz/inst/doc/Gviz.html#8_bioconductor_integration_and_file_support
If you'd like to use a function that processes Grange object you can use this script:
https://rdrr.io/github/davetang/bedr/src/R/bed_to_granges.R