R/ctwas_weights.R
create_predictdb_from_QTLs.Rd
Creates weight files in PredictDB format from QTL data
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 per gene (molecular trait), and create a simple cov_table with covariance set to 1.
Select the top SNP by the column:
"pval": choose the top SNP with the smallest p-value per gene (molecular trait).
"weight": choose the top SNP with the largest abs(weight) per gene (molecular trait),
Only used when use_top_QTL=TRUE
.
output directory
name of the output weight file