Question: Plot Positions On Chromosomes
gravatar for Nicolas Rosewick
4.0 years ago by
Belgium, Brussels, Université Libre de Bruxelles / Université de Liège
Nicolas Rosewick5.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 • 3.5k views
ADD COMMENTlink modified 4.0 years ago by Irsan6.3k • written 4.0 years ago by Nicolas Rosewick5.3k

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

ADD REPLYlink written 24 days ago by steve880
gravatar for Sean Davis
4.0 years ago by
Sean Davis23k
National Institutes of Health, Bethesda, MD
Sean Davis23k 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 4.0 years ago by Sean Davis23k
gravatar for Irsan
4.0 years ago by
Irsan6.3k 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 4.0 years ago • written 4.0 years ago by Irsan6.3k
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: 684 users visited in the last hour