View source: R/ukb_estimate_gxe.R
| ukb_estimate_gxe | R Documentation | 
Estimate contribution of GRSxE to variance in outcome phenotype in UK Biobank
phenotype_name | 
 A string containing the column name of the phenotype to use as outcome, e.g. '21001-0.0'  | 
ukb_filename | 
 A string or character vector containing the path to the file(s) containing the UK Biobank data  | 
bgens_path | 
 path to the folder containing the   | 
snps | 
 a character vector of SNP RSIDs or a data.frame-type structure containing a column named 'rsid' with SNP RSIDs, as well as an optional column named 'beta' containing the effect estimates of the alternate allele on the outcome  | 
covariate_names | 
 a string or character vector containing the names of any covariates to adjust for before estimating GxE  | 
covariate_factor_names | 
 a string or character vector containing the names of covariates to be considered as factors when adjusting for them  | 
correct_age2_sex | 
 logical indicating whether to adjust for age, age^2, and sex (in addition to any other covariates)  | 
sample_ids | 
 a data.frame containing the individual ids under the column
name 'eid'. Any other included columns (e.g. genetic PCs) will be adjusted
for. Required if   | 
sqc_filename | 
 path to the UK Biobank sqc file (e.g. ukb_sqc_v2.txt).
Required if   | 
fam_filename | 
 path to any   | 
imp_sample_filename | 
 path to a   | 
ids_to_remove | 
 vector containing the ids of any samples to remove before analysis  | 
npcs | 
 number of genetic principal components to correct for before analysis  | 
betas | 
 vector of effects of SNPs on outcome. Ignored if   | 
sim_num | 
 Number of permutations for bootstrap and fake GRSs  | 
ukb_estimate_gxe returns a list containing parameter estimates
for alpha1, alpha2, beta, and gamma (xopt), their standard error
(SExopt), and the associated p-values (Pxopt). The
corresponding estimates for the fake GRS are stored in the xopt0,
SExopt0, and Pxopt0, respectively.
In addition, the Xopt and Xopt0 matrices contain the
estimates for each bootstrap and fake GRS.
The tdiff contains the t-statistic for the difference between the
real data estimates and those from the fake GRS.
## Not run: 
  library( GxE )
  # Load GWAS results from the Neale lab
  snps = get_betas_from_neale( neale_filename = '21001_irnt.gwas.imputed_v3.both_sexes.tsv.gz',
                               variants_filename = 'variants.tsv.gz' )
  # UK Biobank files not provided
  gxe  =  ukb_gxe_interaction( phenotype_name = '21001-0.0',
                               ukb_filename   = 'uk_biobank/pheno/ukb21067.csv',
                               bgens_path     = 'uk_biobank/imp',
                               snps           = snps,
                               sqc_filename   = 'uk_biobank/geno/ukb_sqc_v2.txt',
                               fam_filename   = 'uk_biobank/plink/ukb1638_cal_chr1_v2_s488366.fam' )
  print( gxe )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.