hunt: Estimate collider bias

View source: R/hunt.R

huntR Documentation

Estimate collider bias

Description

Estimate collider bias

Usage

hunt(
  dat,
  snp_col = "SNP",
  xbeta_col = "BETA.incidence",
  xse_col = "SE.incidence",
  xp_col = "Pval.incidence",
  ybeta_col = "BETA.prognosis",
  yse_col = "SE.prognosis",
  yp_col = "Pval.prognosis",
  xp_thresh = 0.001,
  init_pi = 0.6,
  init_sigmaIP = 1e-05,
  Bootstrapping = TRUE,
  M = 100,
  seed = 777,
  Plot = TRUE,
  show_adjustments = FALSE
)

Arguments

dat

Data frame. Must have header with at least the xbeta, xse, ybeta and yse columns present.

snp_col

Name of column with SNP IDs.

xbeta_col

Required name of column with effects on the incidence trait.

xse_col

Required name of column with standard errors of xbeta.

xp_col

Name of column with p-value for xbeta (optional). If not given, It will be inferred from xbeta and xse.

ybeta_col

Required name of column with unadjusted effects on the prognosis trait.

yse_col

Required name of column with standard errors of ybeta.

yp_col

Name of column with p-value for ybeta (optional). If not given, It will be inferred from ybeta and yse.

xp_thresh

p-value threshold for SNP-incidence associations. Effects with p-values larger than xp.thresh will be excluded prior to fitting the main model-based clustering.

init_pi

initial value for the weight of the mixture component that represents the cluster of SNPs affecting x only.

init_sigmaIP

initial value for the covariance between x and y.

Bootstrapping

Logical, if TRUE estimate the standard error of the adjustment factor using the Bootstrap method.

M

Number of bootstrap samples drawn to estimate the standard error of the adjustment factor.

seed

Random number seed used for drawing the bootstrap samples.

Plot

Logical, if TRUE (the default), calling the function should plot the final clusters.

show_adjustments

Logical indicating whether to show adjusted effects of the given SNPs in the outputs.

Value

List of the following:

  • est: estimated adjusted associations, their standard errors and p-values (only if show_adjustments is TRUE).

  • b: The estimated slope (adjustment factor).

  • bse: Standard error of the estimated slope.

  • b_CI: 95\

  • pi: Estimated probability of the mixture component of SNPs affecting only incidence.

  • entropy: The entropy of the estimated clusters.

  • plot: Generated plot of the SlopeHunter fitted model.

  • Fit: a Data frame summarising the fitted model-based clustering with the following columns:

    • cluster: cluster of the variants defined as follows:

      • Hunted = assigned to the cluster of SNPs affecting only incidence.

      • Pleiotropic = assigned to the cluster affecting both incidence and prognosis - i.e. variants that affect incidence and have direct effect on prognosis.

    • pt and p0: membership probabilities of the variants for the hunted and pleiotropic clusters respectively.

    • associations of variants with x and y, their standard errors and p-values.

  • iter: Number of the EM algorithm's iterations.

  • Bts.est: Details on the bootstrap estimate of the standard error of the adjustment factor, if Bootstrapping is TRUE.


Osmahmoud/SlopeHunter documentation built on Oct. 7, 2022, 4:38 p.m.