A hierarchical Forward and Backward Stagewise (HierFabs) algorithm for identifying hierachical interaction of genomics data
HierFabs uses coordinate descent with a fixed step size which consists of both forward and backward steps. At each step, the first-order Taylor’s expansion is used to reflect the main part of the increment.
Check out our Package Website for a more complete description of the methods and analyses.
Installation
#install Rtools 3.5 (http://cran.r-project.org/bin/windows/Rtools)
#install.packages("devtools")
#install.packages("Rcpp")
library(devtools)
install_github("XiaoZhangryy/HierFabs")
Usage
- HierFabs-manual ———— Details of the usage of the package.
Example
library(HierFabs)
set.seed(0)
= 500
n = 100
p = matrix(rnorm(n*p),n,p)
x = x[,1:4] %*% rep(1,4) + 3*x[,1]*x[,2] + 3*x[,1]*x[,4]
eta = eta + rnorm(n)
y = matrix(rnorm(n*p),n,p)
xtest = xtest[,1:4] %*% rep(1,4) + 3*xtest[,1]*xtest[,2] + 3*xtest[,1]*xtest[,4]
eta.test = eta.test + rnorm(n)
ytest = HierFabs(x, y)
fit.gg.strong = predict(fit.gg.strong, xtest, ytest)
y.pred.gg.s $mse
y.pred.gg.sprint(fit.gg.strong)
## Weak hierarchy
= HierFabs(x, y, hier="weak")
fit.gg.weak = predict(fit.gg.weak, xtest, ytest)
y.pred.gg.w $mse
y.pred.gg.wprint(fit.gg.weak)
## Cox model with Gene-Environment interactions
= 10
pz = matrix(rnorm(n*pz),n,pz)
z = x[,1:4] %*% rep(1,4) + z[,1] + z[,2] + 3*x[,1]*z[,1] + 3*x[,2]*z[,2]
eta.ge = log(rweibull(n, shape = 1, scale = 1))
err = exp(-eta.ge + err)
y0 = quantile(y0, 0.9)
cens = pmin(y0, cens)
y.ge = 1 * (y0<=cens)
status = matrix(rnorm(n*pz),n,pz)
ztest = rowSums(xtest[,1:4]) + ztest[,1] + ztest[,2]
eta.ge.test = eta.ge.test + 3*xtest[,1]*ztest[,1] + 3*xtest[,2]*ztest[,2]
eta.ge.test = log(rweibull(n, shape = 1, scale = 1))
err.test = exp(-eta.ge.test + err.test)
y0.test = quantile(y0.test, 0.9)
cens = pmin(y0.test, cens)
y.ge.test = 1 * (y0.test<=cens)
status.test = HierFabs(x, y.ge, z, model="cox", status=status)
fit.ge.strong = predict(fit.ge.strong, xtest, y.ge.test, ztest, status.test)
y.pred.ge.s $c.index
y.pred.ge.sprint(fit.ge.strong)
## Weak hierarchy
= HierFabs(x, y.ge, z, model="cox", status=status, hier="weak")
fit.ge.weak = predict(fit.ge.weak, xtest, y.ge.test, ztest, status.test)
y.pred.ge.w $c.index
y.pred.ge.wprint(fit.ge.weak)
References
A General Framework for Identifying Hierachical Interaction of Genomics Data. Manuscript.
Development
The R-package is developed by Xiao Zhang (zhangxiao_0422@163.com).