MyNixOS website logo
Description

Assessing Predisposition Between Phenotypes using Polygenic Scores.

Using polygenic scores (PGS, or PRS/GRS for binary outcomes), this package allows to investigate shared predisposition between different conditions, and do fast association analysis, export plots and views of the PGS distribution using 'ggplot2' object.

comorbidPGS

GitHubtag CRAN_Status_Badge

comorbidPGS is a tool for analysing an already computed Polygenic Score (PGS, also named PRS/GRS for binary outcomes) distribution to investigate shared genetic aetiology in multiple conditions.

comorbidPGS is under GPL-3 license, and is freely available for download.

Prerequisite

  • R version 3.5 or higher with the following packages:
    • stats
    • utils
    • ggplot2

Installation

comorbidPGS is available on CRAN, you can download it using the following command:

install.packages("comorbidPGS")

If you prefer the latest stable development version, you can download it from GitHub with:

if (!require("devtools", quietly = TRUE)) install.packages("devtools")
devtools::install_github("VP-biostat/comorbidPGS")

Example

Building an Association Table of PGS

This is a basic example which shows you how to do basic association with the example dataset:

library(comorbidPGS)
#> 
#> Attaching package: 'comorbidPGS'
#> The following object is masked from 'package:graphics':
#> 
#>     assocplot

# use the demo dataset
dataset <- comorbidData
# NOTE: The dataset must have at least 3 different columns:
# - an ID column (the first one)
# - a PGS column (must be numeric, by default it is the column named "SCORESUM" or the second column if "SCORESUM" is not present)
# - a Phenotype column, can be factors, numbers or characters

# do an association of one PGS with one Phenotype
result_1 <- assoc(dataset, prs_col = "t2d_PGS", phenotype_col = "t2d")
PGSPhenotypePhenotype_typeStatistical_methodCovarN_casesN_controlsNEffectSElower_CIupper_CIP_value
t2d_PGSt2dCases/ControlsBinary logistic regressionNA7309270100001.688258NA1.5618211.8249310
# do multiple associations
assoc <- expand.grid(c("t2d_PGS", "ldl_PGS"), c("ethnicity","brc","t2d","log_ldl","sbp_cat"))
result_2 <- multiassoc(df = dataset, assoc_table = assoc, covar = c("age", "sex", "gen_array"))
#> Warning in phenotype_type(df = df, phenotype_col = phenotype_col): Phenotype
#> column log_ldl is continuous and not normal, please normalise prior association

#> Warning in phenotype_type(df = df, phenotype_col = phenotype_col): Phenotype
#> column log_ldl is continuous and not normal, please normalise prior association
PGSPhenotypePhenotype_typeStatistical_methodCovarN_casesN_controlsNEffectSElower_CIupper_CIP_value
2t2d_PGSethnicity 1 ~ 2CategoricalMultinomial logistic regressionage+sex+gen_array2142638185230.9814174NA0.93451501.03067390.4528020
3t2d_PGSethnicity 1 ~ 3CategoricalMultinomial logistic regressionage+sex+gen_array1205638175861.0178971NA0.95709311.08256400.5724292
4t2d_PGSethnicity 1 ~ 4CategoricalMultinomial logistic regressionage+sex+gen_array272638166530.9434640NA0.83559801.06525420.3474694
21ldl_PGSethnicity 1 ~ 2CategoricalMultinomial logistic regressionage+sex+gen_array2142638185230.9925623NA0.94516781.04233340.7648927
31ldl_PGSethnicity 1 ~ 3CategoricalMultinomial logistic regressionage+sex+gen_array1205638175861.0083869NA0.94812151.07248300.7905175
41ldl_PGSethnicity 1 ~ 4CategoricalMultinomial logistic regressionage+sex+gen_array272638166530.9760204NA0.86472261.10164330.6943783
1t2d_PGSbrcCases/ControlsBinary logistic regressionage+sex+gen_array402504154431.0061678NA0.90875431.11402350.9057882
11ldl_PGSbrcCases/ControlsBinary logistic regressionage+sex+gen_array402504154431.1037106NA0.99563701.22351530.0605407
12t2d_PGSt2dCases/ControlsBinary logistic regressionage+sex+gen_array7309270100001.7359738NA1.60298671.87999380.0000000
13ldl_PGSt2dCases/ControlsBinary logistic regressionage+sex+gen_array7309270100000.9823272NA0.91024111.06012230.6465580
14t2d_PGSlog_ldlContinuousLinear regressionage+sex+gen_arrayNANA100000.00599610.00227470.00153780.01045440.0084010
15ldl_PGSlog_ldlContinuousLinear regressionage+sex+gen_arrayNANA100000.08285450.00211830.07870270.08700640.0000000
16t2d_PGSsbp_catOrdered CategoricalOrdinal logistic regressionage+sex+gen_arrayNANA100001.0628744NA1.02360441.10365090.0015002
17ldl_PGSsbp_catOrdered CategoricalOrdinal logistic regressionage+sex+gen_arrayNANA100001.0078855NA0.97073301.04645980.6818849

Extension of association analysis: one-sample MR using the Wald Ratio and 2SLS methods

# MR using Wald ratio method
mr1 <- mr_ratio(df = dataset, prs_col = "ldl_PGS", exposure_col = "log_ldl", outcome_col = "sbp") 
#> Warning in phenotype_type(df = df, phenotype_col = exposure_col): Phenotype
#> column log_ldl is continuous and not normal, please normalise prior association
#> Warning in phenotype_type(df = df, phenotype_col = outcome_col): Phenotype
#> column sbp is continuous and not normal, please normalise prior association
PGSExposureOutcomeMethodN_casesN_controlsNMR_estimateSEF_stat
ldl_PGSldl_PGSlog_ldlsbpRatioNANA100000.03210992.3876911449.37
# MR using 2-stage least square method (2SLS)
mr2 <- mr_2sls(df = dataset, prs_col = "ldl_PGS", exposure_col = "log_ldl", outcome_col = "sbp") 
#> Warning in phenotype_type(df = df, phenotype_col = exposure_col): Phenotype
#> column log_ldl is continuous and not normal, please normalise prior association
#> Warning in phenotype_type(df = df, phenotype_col = outcome_col): Phenotype
#> column sbp is continuous and not normal, please normalise prior association
PGSExposureOutcomeMethodN_casesN_controlsNMR_estimateSEF_stat
valueldl_PGSlog_ldlsbp2SLSNANA100000.03210992.3875321449.37

Examples of data visualisation using comorbidPGS

densityplot(dataset, prs_col = "ldl_PGS", phenotype_col = "sbp_cat")
# show multiple associations in a plot
assoplot <- assocplot(score_table = result_2)
assoplot$continuous_phenotype
assoplot$discrete_phenotype

NOTE: The score_table should have the assoc() output format

centileplot(dataset, prs_col = "brc_PGS", phenotype_col = "brc")
#> Warning in centileplot(dataset, prs_col = "brc_PGS", phenotype_col = "brc"):
#> The dataset has less than 10,000 individuals, centiles plot may not look good!
#> Use the argument decile = TRUE to adapt to small datasets

As those graphical functions use ggplot2, you can fully customize your plot:

library(ggplot2)
centileplot(dataset, prs_col = "t2d_PGS", phenotype_col = "t2d") + 
  scale_color_gradient(low = "green", high = "red")
decileboxplot(dataset, prs_col = "ldl_PGS", phenotype_col = "ldl")

Citation

To cite comorbidPGS in publications, please use:

Pascat V, Zudina L, Ulrich A, Maina JG, Kaakinen M, Pupko I, Bonnefond A, Demirkan A, Balkhiyarova Z, Froguel P, Prokopenko I (2024). “comorbidPGS: an R package assessing shared predisposition between Phenotypes using Polygenic Scores.” Human Heredity. doi: 10.1159/000539325.

Metadata

Version

1.0.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows