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,
  bootstrap = F,
  bootn = 1000,
  sort = 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.

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.

bootstrap

toggle bootstrapping (for weighted pearson correlation)

bootn

number of runs to use when bootstrapping. Will be ignored if bootstrap is false.

sort

whether to sort by p-value and sign of rho

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 June 9, 2025, 6:02 a.m.