fitLogNormal: Computes a log-normal linear model and permutation based...

View source: R/fitLogNormal.R

fitLogNormalR Documentation

Computes a log-normal linear model and permutation based p-values.

Description

Wrapper to perform the permutation test on the t-statistic. This is the original method employed by metastats (for non-sparse large samples). We include CSS normalization though (optional) and log2 transform the data. In this method the null distribution is not assumed to be a t-dist.

Usage

fitLogNormal(obj, mod, useCSSoffset = TRUE, B = 1000, coef = 2, sl = 1000)

Arguments

obj

A MRexperiment object with count data.

mod

The model for the count distribution.

useCSSoffset

Boolean, whether to include the default scaling parameters in the model or not.

B

Number of permutations.

coef

The coefficient of interest.

sl

The value to scale by (default=1000).

Value

Call made, fit object from lmFit, t-statistics and p-values for each feature.

Examples


# This is a simple demonstration
data(lungData)
k = grep("Extraction.Control",pData(lungData)$SampleType)
lungTrim = lungData[,-k]
k = which(rowSums(MRcounts(lungTrim)>0)<30)
lungTrim = cumNorm(lungTrim)
lungTrim = lungTrim[-k,]
smokingStatus = pData(lungTrim)$SmokingStatus
mod = model.matrix(~smokingStatus)
fit = fitLogNormal(obj = lungTrim,mod=mod,B=1)


HCBravoLab/metagenomeSeq documentation built on March 17, 2024, 3:21 p.m.