yes all in one plot. So I want key (and therefore color)to be "Pold" and "Pnew" as those I am comparing per CHR so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) On the end x-axis would have two strikes of Pold and Pnew (different colors) per one chromosome, and CHR would go from 1 to 22 On Thu, Jun 11, 2020 at 9:26 AM <cpolwart at chemo.org.uk> wrote:> > On 2020-06-11 14:54, Ana Marija wrote: > > Hello, > > > > I expected it to look like this: > > https://imgur.com/a/pj40c > > > > Ah - so all on the one plot? - so you don't want a facet. It puts two > plots side by side (or 22) > > > where x-axis would be CHR, there is 22 of them > >> unique(tmp.tidy$CHR) > > [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 > > > > You have 22 plots all appearing side by size as part of the facet > > I think you want color=CHR - but I don't know what your current color > setting is doing. > > > I also have two phenotypes (keys) which I would like to compare > >> unique(tmp.tidy$key) > > [1] "Pold" "Pnew" > > > > So did you want to Facet those?
cpoiw@rt m@iii@g oii chemo@org@uk
2020-Jun-11 16:52 UTC
[R] How to stack two Stack manhattan plots?
On 2020-06-11 15:59, Ana Marija wrote:> yes all in one plot. > So I want key (and therefore color)to be "Pold" and "Pnew" as those I > am comparing per CHR > so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) > On the end x-axis would have two strikes of Pold and Pnew (different > colors) per one chromosome, and CHR would go from 1 to 22 >ggplot( data = tmp.tidy) + geom_point( aes( y = BP, x = CHR, color=key) ) ?
Hello, I tried your code and this is what I got I really need two groups side by side shown per chromosome as it is here: https://imgur.com/a/pj40c on the image there are 4 groups I do have only two On Thu, Jun 11, 2020 at 11:52 AM <cpolwart at chemo.org.uk> wrote:> > On 2020-06-11 15:59, Ana Marija wrote: > > yes all in one plot. > > So I want key (and therefore color)to be "Pold" and "Pnew" as those I > > am comparing per CHR > > so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) > > On the end x-axis would have two strikes of Pold and Pnew (different > > colors) per one chromosome, and CHR would go from 1 to 22 > > > > > ggplot( data = tmp.tidy) + > geom_point( aes( > y = BP, > x = CHR, > color=key) ) > > ?
I tried it, ggplot( data = tmp.tidy) +geom_point( aes(y = BP,x = CHR,color=key) ,position = "jitter" ) I got the attached On Thu, Jun 11, 2020 at 4:18 PM <cpolwart at chemo.org.uk> wrote:> > Try adding > position = "jitter" to the geom_point(... > > > > On 11 Jun 2020 21:41, Ana Marija <sokovic.anamarija at gmail.com> wrote: > > Hello, > > I tried your code and this is what I got > > I really need two groups side by side shown per chromosome as it is here: > https://imgur.com/a/pj40c > on the image there are 4 groups I do have only two > > On Thu, Jun 11, 2020 at 11:52 AM <cpolwart at chemo.org.uk> wrote: > > > > On 2020-06-11 15:59, Ana Marija wrote: > > > yes all in one plot. > > > So I want key (and therefore color)to be "Pold" and "Pnew" as those I > > > am comparing per CHR > > > so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) > > > On the end x-axis would have two strikes of Pold and Pnew (different > > > colors) per one chromosome, and CHR would go from 1 to 22 > > > > > > > > > ggplot( data = tmp.tidy) + > > geom_point( aes( > > y = BP, > > x = CHR, > > color=key) ) > > > > ? > >
Thank you so much it is getting better (see attach) when I do: ggplot( data = tmp.tidy) +geom_point( aes(y = -log10(value),x CHR,color=key) ,position = "jitter", size=0.5 ) is there is a way to have separation between every chromosome shown better and also every number of chromosome shown on the x-axis? On Thu, Jun 11, 2020 at 4:39 PM <cpolwart at chemo.org.uk> wrote:> > Your dots are too big! > > Add > > geom_points(... , size = 1 > > May need to play... 0.5 or 0.1? > > On 11 Jun 2020 22:26, Ana Marija <sokovic.anamarija at gmail.com> wrote: > > I tried it, > ggplot( data = tmp.tidy) +geom_point( aes(y = BP,x = CHR,color=key) > ,position = "jitter" ) > I got the attached > > On Thu, Jun 11, 2020 at 4:18 PM <cpolwart at chemo.org.uk> wrote: > > > > Try adding > > position = "jitter" to the geom_point(... > > > > > > > > On 11 Jun 2020 21:41, Ana Marija <sokovic.anamarija at gmail.com> wrote: > > > > Hello, > > > > I tried your code and this is what I got > > > > I really need two groups side by side shown per chromosome as it is here: > > https://imgur.com/a/pj40c > > on the image there are 4 groups I do have only two > > > > On Thu, Jun 11, 2020 at 11:52 AM <cpolwart at chemo.org.uk> wrote: > > > > > > On 2020-06-11 15:59, Ana Marija wrote: > > > > yes all in one plot. > > > > So I want key (and therefore color)to be "Pold" and "Pnew" as those I > > > > am comparing per CHR > > > > so I used facet_wrap(~CHR) to create a graph per chromosome (on x-axis) > > > > On the end x-axis would have two strikes of Pold and Pnew (different > > > > colors) per one chromosome, and CHR would go from 1 to 22 > > > > > > > > > > > > > ggplot( data = tmp.tidy) + > > > geom_point( aes( > > > y = BP, > > > x = CHR, > > > color=key) ) > > > > > > ? > > > > > >