Question: Plot Positions On Chromosomes
gravatar for Nicolas Rosewick
5.4 years ago by
Belgium, Brussels
Nicolas Rosewick7.3k wrote:


How can I plot positions on chromosomes using R. I put a little example to better explain. So I've a dataframe for each sample containing positions of interest :

Chr    Pos
1    100
1    300
2    30
10    1000
11    2000

And I want to plot that on chromosomes like that (Here there are 6 samples A,B,C,D,E and F). each point represent the position in the dataframe

Anyone can help me ?



enter image description here

plot position chromosome • 5.1k views
ADD COMMENTlink modified 5.4 years ago by Irsan6.8k • written 5.4 years ago by Nicolas Rosewick7.3k

I've made a post here with an example on how to create a plot that might help with this

ADD REPLYlink written 17 months ago by steve1.9k
gravatar for Sean Davis
5.4 years ago by
Sean Davis25k
National Institutes of Health, Bethesda, MD
Sean Davis25k wrote:

Have a look at the geneplotter bioconductor package as well as the Gviz package. In particular, see section 6 of the vignette.

ADD COMMENTlink written 5.4 years ago by Sean Davis25k
gravatar for Irsan
5.4 years ago by
Irsan6.8k wrote:
ggplot(dataframe) + geom_histogram(aes(x=Start),binwidth=1e6) + facet_grid(Chr ~Sample)

You need a data frame with colums Chr, Start and Sample. If you just want to see points, change geom_histogram(...) for geom_point(aes(x=start, y=0))

ADD COMMENTlink modified 5.4 years ago • written 5.4 years ago by Irsan6.8k
Please log in to add an answer.


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