Repository navigation
R GWAS VI: Plots
Bioinformatics Core Facility Gothenburg edited this page Sep 19, 2017
·
6 revisions
We will do two different plots: Manhattan plot and QQ plot. For this we will use a package called qqman. It has two very easy to use functions that will do the job:
- The
manhattan()function takes a data frame as first argument. If this data frame is from a PLINK output we don’t need to specify anything else. If it is from somewhere else or if we have changed the column names, we need to specify the names of the columns where chromosome, position, SNP name and p-value is. - The
qq()function takes a vector of p-values.
OBS: If it takes a long time for R to produce the plots. You may consider only plotting SNPs with P-value lower than a threshold, 0.1 say. This will reduce the plotting time considerably, and still show us the interesting parts.
- Install and load the qqman package.
- Create one QQ plot for each analysis by giving the
qq()function the p-value column from your results as argument. Export the plots to files that you can paste in to your report. - Create one manhattan plot for each analysis using the
manhattan()function. Export the plots to files that you can paste in to your report.
If you have time you can try to do a regional association plot using this page: http://locuszoom.sph.umich.edu//