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

View source: R/RERfuncs.R

correlateWithBinaryPhenotypeR Documentation

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

Description

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

Usage

correlateWithBinaryPhenotype(
  RERmat,
  charP,
  min.sp = 10,
  min.pos = 2,
  weighted = "auto",
  winsorizeRER = NULL,
  winsorizetrait = NULL,
  bootstrap = F,
  bootn = 1000
)

Arguments

RERmat

RER matrix returned by getAllResiduals

charP

phenotype vector returned by tree2Paths or char2Paths

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)

weighted

perform weighted correlation. This option turns on weighted correlation that uses the weights computed by foreground2Tree(wholeClade=T). This setting will treat each clade a single observation for the purpose of p-value estimation. The function will guess automatically if the charP vector is of "weighted" type and there should be not need to set this parameter.

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 4th most extreme value.

winsorizetrait

Winsorize phenotype vector values before computing Pearson correlation. winsorizeRER=3 will set the 3 most extreme RER values at each end of each row to the 4th most extreme value.

bootstrap

toggle bootstrapping (for weighted pearson correlation)

bootn

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


nclark-lab/RERconverge documentation built on June 9, 2025, 6:02 a.m.