Plot Positions On Chromosomes
2
1
Entering edit mode
11.1 years ago

Hi,

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 ?

Thanks

N.

enter image description here

plot chromosome position • 8.7k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
2
Entering edit mode
11.1 years ago

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

http://www.bioconductor.org/packages/release/bioc/vignettes/Gviz/inst/doc/Gviz.pdf

ADD COMMENT
2
Entering edit mode
11.1 years ago
Irsan ★ 7.8k
library(ggplot2) 
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 COMMENT

Login before adding your answer.

Traffic: 1714 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6