Creates weight files in PredictDB format from QTL data
Source:R/ctwas_weights.R
create_predictdb_from_QTLs.RdCreates weight files in PredictDB format from QTL data
Arguments
- weight_table
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).- gene_table
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- cov_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.- use_top_QTL
If TRUE, only keep the top QTL per gene (molecular trait), and create a simple cov_table with covariance set to 1.
- select_by
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.- outputdir
output directory.
- outname
name of the output weight file.