phylolmFit: Phylogenetic COmparative Method using LIMMA

View source: R/phylolmFit.R

phylolmFitR Documentation

Phylogenetic COmparative Method using LIMMA

Description

This function applies lmFit to the normalized data, in order to take the phylogeny into account. TODO: explain more.

Usage

phylolmFit(
  object,
  design = NULL,
  phy,
  col_species = NULL,
  model = c("BM", "lambda", "OUfixedRoot", "OUrandomRoot", "delta"),
  measurement_error = FALSE,
  use_consensus = TRUE,
  consensus_tree = NULL,
  ddf_method = c("Satterthwaite", "Species", "Samples"),
  REML = TRUE,
  ...
)

Arguments

object

A matrix data object containing normalized expression values, with rows corresponding to genes and columns to samples (species).

design

the design matrix of the experiment, with rows corresponding to samples and columns to coefficients to be estimated. Defaults to the unit vector (intercept).

phy

an object of class phylo. It must be either a tree with tips having the same names as the columns of object (including replicates), or a tree such that tip labels match with species names in 'col_species'.

col_species

a character vector with same length as columns in the expression matrix, specifying the species for the corresponding column. If left 'NULL', an automatic parsing of species names with sample ids is attempted.

model

the phylogenetic model used to correct for the phylogeny. Must be one of "BM", "lambda", "OUfixedRoot", "OUrandomRoot" or "delta". See phylolm for more details.

measurement_error

a logical value indicating whether there is measurement error. Default to TRUE. See phylolm for more details.

use_consensus

If TRUE, one consensus tree is used to represent the correlation structure. see phylogeneticCorrelations. If FALSE, each gene will use its own model parameters and will have its own correlation structure accordingly. Default to TRUE.

consensus_tree

If not NULL, the consensus tree containing the correlation structure, result of function phylogeneticCorrelations. If provided, arguments phy, model and measurement_error will be ignored.

ddf_method

the method for the computation of the degrees of freedom of the t statistics (before moderation). Default to ddf_method="Satterthwaite". If ddf_method="Species", then the number of species is taken for the computation of the degrees of freedom, while if ddf_method="Samples" the total number of individuals is used.

REML

Use REML (default) or ML for estimating the parameters.

...

further parameters to be passed to lmFit or phylolm.

Details

The default bounds on the phylogenetic parameters are the same as in phylolm, except for the alpha parameter of the OU.

Value

An object of class MArrayLM-class, with list components coefficients, stdev.unscaled, sigma and df.residual. These quantities take the phylogenetic model into account. The object can be passed to eBayes.


pbastide/phylolimma documentation built on Nov. 17, 2024, 1:34 p.m.