[R] How to stack two Stack manhattan plots?

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Thu Jun 11 00:22:04 CEST 2020


HI Jim

I run it like this:
Rscript --no-save Manhattan_plot.R

and just in case I added: stringsAsFactors=FALSE

so the script looks like this:
library(qqman)
results_log <- read.table("logistic_results_M3.assoc.logistic.C",
head=TRUE,stringsAsFactors=FALSE)
jpeg("M3.assoc.logistic.jpeg")
manhattan(results_log,chr="CHR",bp="BP",p="P",snp="SNP", main =
"Manhattan plot:logistic")
dev.off()

this code does work with another data set, the jpeg() does work. I
will try now with PNG

On Wed, Jun 10, 2020 at 5:17 PM Jim Lemon <drjimlemon using gmail.com> wrote:
>
> Hi Ana,
> The problem may be that the JPEG device doesn't handle transparency.
> Perhaps PNG?
>
> Jim
>
> On Thu, Jun 11, 2020 at 6:48 AM Ana Marija <sokovic.anamarija using gmail.com> wrote:
> >
> > Hello,
> >
> > I have a data frame like this:
> >
> > > head(tmp1)
> >   CHR      BP   Pold    Pnew
> > 1   1  785989 0.9521 0.09278
> > 2   1 1130727 0.4750 0.19010
> > 3   1 1156131 0.5289 0.48520
> > 4   1 1158631 0.2554 0.18140
> > 5   1 1211292 0.2954 0.48590
> > 6   1 1478153 0.5542 0.68790
> > ...
> >
> > I did:
> > tmp.tidy <- tmp1 %>% gather(key, value, -BP, -CHR)
> > jpeg("over.jpeg")
> > ggplot(tmp.tidy, aes(BP, value, color=key)) + geom_point() +
> > facet_wrap(~CHR, nrow=1)
> > dev.off()
> >
> > but I got this plot in attach which doesn't make sense. Can you please
> > advise how to make this plot?
> >
> > thanks
> > Ana
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list