Hermann Norpois
unread,Oct 5, 2012, 3:59:47 PM10/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggp...@googlegroups.com
Dear list,
I would like to combine two datasets via facet_grid. Both data sets have the same x axis (chromosomal coordinates) and the y axis should refer to signals from different experiments (array and precipitation experiments). I wish to have two coordinate systems, one directy above the other (the x axis parallel and identical in terms of sizing). I feel that facet_grid should work (see below - marked with ????) but actually I do not know how to vary the syntay. Could anybody help me?
adata: array data with transcript start sites on chromosome 11 (transcript.start) and the foldchanges.
pdata: histone precipitation data from chromosome 11, start and end are the precipitated DNA coordinates and peak ... the peak.
> dput (adata)
structure(list(transcript.start = c(3125936L, 3142378L, 3187355L,
3189052L, 3193421L, 3193421L), foldchange = c(0.8656, 0.7751,
0.8779, 0.9557, 1.0108, 0.9307)), .Names = c("transcript.start",
"foldchange"), row.names = c(NA, 6L), class = "data.frame")
> dput (pdata)
structure(list(start = c(5390998L, 11088023L, 11867948L, 11940898L,
12367448L, 12376673L), end = c(5391923L, 11088523L, 11868673L,
11941848L, 12368073L, 12377048L), peak = c(8L, 7L, 8L, 8L, 12L,
7L)), .Names = c("start", "end", "peak"), row.names = c(NA, 6L
), class = "data.frame")
This is my idea. But: What is the correct syntax for facet_grid?
> p <- ggplot (adata, aes (x=transcript.start, y=foldchange))+ geom_point() + geom_segment (data=pdata, aes (x=start, xend=end, yend=0, y=peak), color="red")
> p+facet_grid() ?????
Thanks
Hermann