direct_influence: Calculate the significance of direct influences of variant...

Description Usage Arguments Value Examples

View source: R/direct_influence.R

Description

This function rotates the variant-to-eigentrait effects back to variant-to-phenotype effects. It multiplies the β-coefficient matrices of each variant (i) and each phenotype (j) (β_{i}^{j}) by the singular value matrices (V \cdot W^{T}) obtained from the singular value decomposition performed in get_eigentraits. β_{i}^{j} = V \cdot W^{T}. It also uses the permutation data from the pairwise scan (pairscan) to calculate an empirical p value for the influence of each marker pair on each phenotype. The empirical p values are then adjusted for multiple testing using Holm's step-down procedure.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
direct_influence(
  data_obj,
  pairscan_obj,
  transform_to_phenospace = TRUE,
  pval_correction = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
    "none"),
  perm_data = NULL,
  save_permutations = FALSE,
  n_cores = 4,
  path = ".",
  verbose = FALSE
)

Arguments

data_obj

a Cape object

pairscan_obj

a pairscan object

transform_to_phenospace

A logical value. If TRUE, the influence of each marker on each eigentrait is transformed to the influence of each marker on each of the original phenotypes. If FALSE, no transformation is made. If the pair scan was done on eigentraits, the influence of each marker on each eigentrait is calculated. If the pair scan was done on raw phenotypes, the influence of each marker on each phenotype is calculated. The default behavior is to transform variant influences on eigentraits to variant influences on phenotypes.

pval_correction

One of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none", indicating whether the p value correction method used should be the Holm step-down procedure, false discovery rate or local false discovery rate respectively.

perm_data

The permutation data generated by pairscan.

save_permutations

A logical value indicating whether the data from permutations should be saved. Saving the permutations requires more memory but can be helpful in diagnostics. If save_permutations is TRUE all permutation data are saved in an object called "permutation.data.RData".

n_cores

The number of cores to use if using parallel computing

path

The path in which to write output data

verbose

A logical value indicating whether to write progress to standard out.

Value

This function returns data_obj with an additional list called max_var_to_pheno_influence. This list has one element for each trait. Each element is a table with eight columns: marker: the marker name conditioning_marker: the marker whose effect was conditioned on to achieve the maximum main effect of marker. coef: the direct influence coefficient. se: the standard error of the direct influence coefficient t_stat: the t statistic for the direct influence coefficient |t_stat|: the absolute value of the t statistic emp_p: the empirical p value of the direct influence coefficient p_adjusted: the adjusted p value of the direct influence coefficient.

Examples

1
2
3
4
## Not run: 
data_obj <- direct_influence(data_obj, pairscan_obj)

## End(Not run)

cape documentation built on Feb. 10, 2021, 5:06 p.m.