Compute isoTWAS model for a set of isoforms/transcripts
compute_isotwas.RdThe function runs multivariate regression models for a set of transcripts and outputs the best model based on cross-validated R-squared.
Usage
compute_isotwas(
X,
Y,
gene_exp = NULL,
Y.rep,
R = NULL,
id,
omega_est = "replicates",
omega_nlambda = 10,
method = c("mrce_lasso", "multi_enet", "joinet", "spls", "sgl", "mtlasso", "stacking",
"graph_reg", "univariate"),
similarity_matrix = NULL,
predict_nlambda = 20,
family = "gaussian",
scale = FALSE,
alpha = 0.5,
nfolds = 5,
verbose = TRUE,
par = FALSE,
n.cores = NULL,
tx_names = NULL,
seed = NULL,
run_all = TRUE,
return_all = FALSE,
tol.in = 0.001,
maxit.in = 1000
)Arguments
- X
matrix, design matrix of SNP dosages
- Y
matrix, matrix of G isoform expression across columns
- gene_exp
vector, vector of total gene expression
- Y.rep
matrix, matrix of G isoform expression with replicates
- R
int, number of replicates
- id
vector, vector of sample ids showing rep to id
- omega_est
character, 'replicates' or 'mean' to use Y.rep or Y
- omega_nlambda
int, number of omegas to generate
- method
character, vector of methods to use. Available methods:
"mrce_lasso": MRCE with lasso penalty
"multi_enet": Multivariate elastic net
"joinet": Joinet stacked elastic net
"spls": Sparse partial least squares
"sgl": Sparse group lasso
"mtlasso": Multi-task lasso (L21 regularization)
"stacking": Super learner stacking of multiple methods
"graph_reg": Graph-regularized regression (requires similarity_matrix)
"univariate": Best of univariate elastic net, BLUP, SuSiE
- similarity_matrix
matrix, optional similarity matrix for graph_reg method. Can be created using
similarity_from_gtforcreate_similarity_from_exons. If NULL, graph_reg is skipped.- predict_nlambda
int, number of lambdas in MRCE
- family
character, glmnet family
- scale
logical, T/F to scale Y by Omega
- alpha
numeric, elastic net mixing parameter
- nfolds
int, number of CV folds
- verbose
logical, print progress messages
- par
logical, uses mclapply to parallelize model fit
- n.cores
int, number of parallel cores
- tx_names
vector, character vector of tx names - order of columns of Y
- seed
int, random seed
- run_all
logical, run all methods
- return_all
logical, return R2 for all models?
- tol.in
numeric, tolerance for objective difference
- maxit.in
int, maximum number of iterations