R/ctwas_weights.R
create_predictdb_from_QTLs.Rd
Creates weight files in PredictDB format from QTL data
create_predictdb_from_QTLs(
weight_table,
gene_table = NULL,
cov_table = NULL,
use_top_QTL = TRUE,
outputdir = getwd(),
outname
)
a data frame of the genes, QTLs and weights, with columns:
"gene", "rsid", "varID", "ref_allele", "eff_allele", "weight".
If you want to use multiple eQTLs per gene, you can set use_top_QTL=FALSE
.
But we assume the weights of the eQTLs are learned from multiple regression
(instead of marginal effect sizes).
a data frame (optional) with information of the genes
in weight_table
("gene","genename","gene_type", etc.).
If NULL, create a simple gene_table based on the weight_table
a data frame of covariances between variants, with columns:
"GENE","RSID1","RSID2", "VALUE".
If NULL, do not create covariance files (.txg.gz), unless use_top_QTL=TRUE
.
If TRUE, only keep the top QTL with the largest abs(weight) for each gene (molecular trait), and create a simple cov_table with covariance set to 1.
output directory
name of the output weight file