knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",fig.width=12, fig.height=9, message=FALSE, tidy=TRUE, dpi=75)

iPheGWAS module is developed to bring intelligence into PheGWAS by incorporating a new heuristic approach developed by our team to order traits based on its genetic correlation quickly and efficiently. As a result, the iPheGWAS module is integrated seamlessly into the PheGWAS module. We also improved the previous PheGWAS codebase for faster landscape visualization.

This package is packaged with datasets used in PheGWAS and some datasets to demonstrate iPheGWAS. If you are looking for the entire data used for studies 1 and 2 in iPheGWAS, please download it from here. Checkout the individual datasets here.

Here are the datasets that are available from iPheGWAS study2 within the package.

library(iphegwas)

To run PheGWAS, pass the dataframe names available in your environment to fastprocessphegwas as vector of dataframe names.

Before passing the dataframe makes sure your preprocess your GWAS summarystats dataframe to have columns named in this way.

CHR     BP       rsid A1 A2    beta     se P.value gene
head(ibd,3)
head(bmi,3)
head(Wasisthipratio,3)
head(CrohnsDisease,3)
head(UlcerativeColitis,3)
## Bringing all package data to the environment
ibd <- ibd
bmi <- bmi
Wasisthipratio <- Wasisthipratio
CrohnsDisease <- CrohnsDisease
UlcerativeColitis <- UlcerativeColitis

The gene column is optional. There is an option to map genes to rsid if you want this, please set genemap = TRUE (By default it is set to FALSE). If TRUE it will take some time as it is using Gene BioMart Module to map genes internally.

phenos <- c("ibd","bmi","CrohnsDisease","UlcerativeColitis","Wasisthipratio")
yy <- fastprocessphegwas(phenos)

Once the processing is done, pass the dataframe that you got from fastprocessphegwas to landscapefast to see the landscape; Here, the landscape orders in the order that we are passing the phenos.

print(phenos)
landscapefast(yy,sliceval = 7,phenos =phenos)

If you want to order the traits in the landscape based on the genetic correlation, then you pass the order what you get from the iphegwas module.

landscapefast(yy,sliceval = 7,phenos = iphegwas(phenos))

You can also run the iPheGWAS module independently to examine the dendrograms.

iphegwas(phenos,dentogram = TRUE)

In addition to the heuristic approach that we developed, all the functionalities outlined in the PheGWAS are also available in iphegwas package. Considering performance in mind, the entire codebase is rewritten, and you will notice that the iphegwas package is faster than the PheGWAS package. Adding here the code from the PheGWAS vignette.

Following processed summary data are from the lipid consortium:

head(hdl,3)
head(ldl,3)
head(trig,3)
head(tchol,3)
## I am changing the name of the dataframe to something meaningful, as the name of the dataframe will be used as phenotype names in the landscape. This also bring all package data to the environment.
HDL <- hdl
LDL <- ldl
TRIGS <- trig
TOTALCHOLESTROL <- tchol

The dataframe’s are passed to processphegwas function as a list of dataframe’s.

phenos <- c("HDL", "LDL", "TRIGS", "TOTALCHOLESTROL")
y <- fastprocessphegwas(phenos)

3D landscape visualization of all the phenotypes across the base pair positions(above a threshold of -log10 (p) 6)

landscapefast(y,sliceval = 10,phenos =phenos)

3D landscape visualization of chromosome number 19 (above a threshold of -log10 (p) 10)

landscapefast(y,sliceval = 7.5,chromosome = 19,phenos =phenos)

3D landscape visualization of chromosome number 19, gene view active (above a threshold of -log10 (p) 10)

landscapefast(y,sliceval = 7.5,chromosome = 19, geneview = TRUE,phenos =phenos)

3D visualization with LD block (for european population) passing externally, parameter to pass LD and also calculate the mutualLD block

landscapefast(y, sliceval = 30, chromosome = 19,calculateLD= TRUE,mutualLD = TRUE,phenos =phenos)


georgeg0/iphegwas documentation built on Oct. 15, 2022, 9:53 a.m.