getAllCor: Computes the association statistics between RER from...

View source: R/RERfuncs.R

getAllCorR Documentation

Computes the association statistics between RER from getAllResiduals and a phenotype paths vector made with tree2Paths or char2Paths

Description

Computes the association statistics between RER from getAllResiduals and a phenotype paths vector made with tree2Paths or char2Paths

Usage

getAllCor(
  RERmat,
  charP,
  method = "auto",
  min.sp = 10,
  min.pos = 2,
  winsorizeRER = NULL,
  winsorizetrait = NULL,
  weighted = F
)

Arguments

RERmat

RER matrix returned by getAllResiduals

charP

phenotype vector returned by tree2Paths or char2Paths

method

Method used to compute correlations. Accepts the same arguments as cor. Set to "auto" to select automatically based on the number of unique values in charP. This will also auto set the winsorization for Pearson correlation. Set winsorizetrait=some number and winsorizeRER=some number to override

min.sp

Minimum number of species that must be present for a gene

min.pos

Minimum number of species that must be present in the foreground (non-zero phenotype values)

winsorizeRER

Winsorize RER values before computing Pearson correlation. winsorizeRER=3 will set the 3 most extreme RER values at each end of each row to the value closest to 0.

winsorizetrait

Winsorize trait values before computing Pearson correlation. winsorizetrait=3 will set the 3 most extreme trait values at each end to the value closest to 0.

weighted

perform weighted correlation. This option needs to be set if the clade weights computed in foreground2Tree(wholeClade=T) are to be used. This setting will treat the clade a single observation for the purpose of p-value estimation.

Value

A list object with correlation values, p-values, and the number of data points used for each tree

Note

winsorize is in terms of number of observations at each end, NOT quantiles


nclark-lab/RERconverge documentation built on March 2, 2024, 8:51 a.m.