Question: How to plot read coverage using genomic ranges
0
gravatar for MAPK
2.2 years ago by
MAPK1.5k
United States
MAPK1.5k wrote:

I have a dataframe mydf with chromosome, start position, and number of reads at that position. I was using genomicranges to follow the method discussed here, but I was not able to plot it as in the figure below. Could you please help me plot this. Thank you for your help.

mydf<- structure(list(chr = structure(c(2L, 2L, 2L, 4L, 4L, 4L, 5L, 
5L, 5L), .Label = c("Ch1", "Ch10", "Ch11", "Ch12", "Ch13", "Ch14", 
"Ch15", "Ch16", "Ch2", "Ch3", "Ch4", "Ch5", "Ch6", "Ch7", "Ch8", 
"Ch9"), class = "factor"), start = c(1000940, 1001133, 1001566, 
1060328, 1060590, 1060887, 1495099, 1497788, 1497980), read.counts = c(7, 
2, 1, 14, 8, 6, 62, 15, 7)), .Names = c("chr", "start", "read.counts"
), class = "data.frame", row.names = c(NA, -9L))

This is how I want my plot to look like(but for all chromosomes):https://ibb.co/nrbLLG

R coverage plot • 923 views
ADD COMMENTlink modified 2.2 years ago • written 2.2 years ago by MAPK1.5k
1

Just do a simple plot like this using base R code: C: Histogram showing overlap between 2 bed files

The tutorial that you're following uses a custom plotCoverage function that behaves unusually and doesn't fit well with most objects in R. Your mydf certainly won't be compatible with it.

ADD REPLYlink written 2.2 years ago by Kevin Blighe54k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1746 users visited in the last hour