The goal of geneJAM is to help clustering outcome components (traits) that share some feature (genetic component) using polygenic risk scores (PRS).
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("abuchardt/geneJAM")This is a basic example on simulated data:
library(geneJAM)
N <- 1000 #
q <- 10 #
p <- 5000 #
set.seed(1)
# Sample 1
X0 <- matrix(rbinom(n = N*p, size = 2, prob = 0.3), nrow=N, ncol=p)
B <- matrix(0, nrow = p, ncol = q)
B[1, 1:2] <- 1
B[3, 3] <- 2
Y0 <- X0 %*% B + matrix(rnorm(N*q), nrow = N, ncol = q)Compute polygenic scores and coefficients
psobj <- ps.geneJAM(X0, Y0)
ps <- psobj$PS
beta <- psobj$betaCreate new sample
X <- matrix(rbinom(n = N*p, size = 2, prob = 0.3), nrow=N, ncol=p)
Y <- X %*% B + matrix(rnorm(N*q), nrow = N, ncol = q)
PS <- X %*% betaRun geneJAM
fit <- geneJAM(PS, Y)Plot mean standard error curve
plot(fit, 1)Plot estimated optimal adjacency matrix
plot(fit, 2)
