findModes: Use the multiple modes of the robust profile likelihood...

View source: R/showModes.R

findModesR Documentation

Use the multiple modes of the robust profile likelihood function to find out multiple pathways in MR and their marker SNPs.

Description

THis function can be run only for k = 1 when there is only one risk factor

Usage

findModes(
  data,
  p.thres = NULL,
  marker.data = NULL,
  marker.p.thres = NULL,
  mode.lmts = c(-5, 5),
  cor.mat = NULL,
  loss.function = c("tukey", "huber", "l2"),
  k.findmodes = switch(loss.function[1], l2 = NA, huber = 1.345, tukey = 3),
  include.thres = 1,
  exclude.thres = 2,
  map.marker = T,
  ldThres = 0.9,
  npoints = 10000
)

Arguments

data

A data frame containing the information of the selected genetic instruments. One can simply take the data element from the output of function getInput, or provide their own data frame. The required columns include SNP for the SNP rsID, the columns gamma_exp1 to gamma_expk for the estimated effect sizes of the SNPs on risk factors 1 to k, the columns se_exp1 to se_expk for their standard deviations, the columns gamma_out1 to gamma_outm for the estimated effect sizes of the SNPs on diseases 1 to m,the columns se_out1 to se_outm for their standard deviations.

p.thres

The p-value threshold for SNP selection. The SNPs whose selection_pvals are less than p.thres are selected. The default value is NULL, which is to include all SNPs in data. If it is not NULL, then data should have a column selection_pvals that stores the selection p-value of each SNP.

marker.data

A data frame containing the information of candidate marker genes. Default is NULL, which sets marker.data to data. Another choice is to use the marker.data element in the output of getInput.

marker.p.thres

P-value threshold for marker SNP selection. See p.thres

cor.mat

Either NULL or a k + 1 by k + 1 symmetric matrix. The shared correlation matrix for (b_exp[j], b_out[j]) across SNP j. Used only when input.list is NULL and the default value is NULL, for the identity matrix.

loss.function

Loss function used, one of "tukey", "huber" or "l2". Default is "tukey", which is robust to outlier SNPs with large pleiotropic effects

k.findmodes

Tuning parameters of the loss function, for loss "l2", it is NA, for loss "huber", default is 1.345 and for loss "tukey", default is 3.

include.thres

Absolute value upper threshold of the standardized test statistics of one SNP on one mode for the SNP to be included as a marker for that mode, default is 1.4

exclude.thres

Absolute value lower threshold of the standardized test statistics of one SNP on other modes for the SNP to be included as a marker for that mode, default is qnorm(0.975)

map.marker

Whether map each marker to the earist gene or not. Default is TRUE if multiple markers are found. It is always FALSE if there is just one mode.

ldThres

the parameter passed to the queryhaploReg function. Increase to 1 when there is a "timeout" error.

npoints

Number of equally spaced points chosen for grid search of modes within the range mode.lmts.

mode_lmts

The range of beta that the modes are searched from. Default is c(-5, 5)

Value

A list containing the following elements:

fun

The profile likelihood function with argument beta

modes

The position of modes. Only include modes where marker genes can be detected

p

The profile likelihood plot with gene markers when there are multiple modes. The range of the x.axis depends on the distance between the maximum mode and minimum mode when there are multiple modes.

markers

A data frame of marker information

raw.modes

All modes of the profile likelihood function within the range of mode_lmts

supp_gwas

More information about the markers.


jingshuw/GRAPPLE-beta- documentation built on March 29, 2024, 1:26 p.m.