run_conditional: Set up conditional analysis for specified variant(s) by...

Description Usage Arguments Value

View source: R/conditional.R

Description

For specified variant(s) (passed by index), set-up and run conditional analysis. The function uses a data.table of lead SNPs to identify possible SNPs for conditional analysis, and determines which SNPs will be conditioned on based on specified criteria. Returns the association pattern with the highest posterior probability for each specified variant after conditional analysis.

Usage

1
2
3
run_conditional(Primo_obj, IDs, idx, leadsnps_region, snp_col = "SNP",
  pheno_cols, snp_info, LD_mat, LD_thresh = 1, dist_thresh = 0,
  pval_thresh = 1, suffices = 1:length(pheno_cols))

Arguments

Primo_obj

list returned by running the t-statistic version of Primo (i.e. Primo_tstat)

IDs

data.table of the SNP and phenotype IDs corresponding to each row of the Primo results stored in Primo_obj.

idx

integer of the index of the genetic variant (e.g. row of Tstat_mod) on which one wants to perform conditional analysis.

leadsnps_region

data.table that stores the lead SNP of each phenotype in each region of the Primo results. Also includes P-values for the lead SNPs. See Details for format.

snp_col

string of the column name of SNPs/variants.

pheno_cols

character vector of the column names of the phenotype ID columns.

snp_info

data.table reporting the chromosome and position of each SNP. Columns must include: SNP, CHR, POS.

LD_mat

matrix of genotype correlation coefficients (e.g. Pearson r). Row and column names should be SNP/variant names (e.g. in snp_col).

LD_thresh

scalar corresponding to the LD r^2 threshold to be used for conditional analysis. Lead SNPs with r^2 < LD_thresh with the idx variant will be conditioned on. Default value (1) signifies no consideration of LD in conditional analyses.

dist_thresh

scalar of the minimum number of base pairs away from the idx variant that a lead SNP must be in order to be conditioned on. Default value (0) signifies no consideration of chromosomal distance in conditional analyses.

pval_thresh

scalar of the P-value threshold a lead SNP must be below with the phenotype for which it is lead SNP in order to be conditioned on. Default value (1) signifies no consideration of strength of effect in conditional analyses.

suffices

character vector of the suffices corresponding to columns in leadsnps_region.

Value

An integer vector corresponding to the association pattern with the highest posterior probabilities for each variant represented by idx, following conditional analysis. Each value returned, k, corresponds to the k-th column of pis from the Primo output, and the k-th row of the Q matrix produced by make_qmat.


kjgleason/primo documentation built on Sept. 7, 2021, 5:21 p.m.