MRcoefs: Table of top-ranked features from fitZig or fitFeatureModel

View source: R/MRcoefs.R

MRcoefsR Documentation

Table of top-ranked features from fitZig or fitFeatureModel

Description

Extract a table of the top-ranked features from a linear model fit. This function will be updated soon to provide better flexibility similar to limma's topTable.

Usage

MRcoefs(
  obj,
  by = 2,
  coef = NULL,
  number = 10,
  taxa = obj@taxa,
  uniqueNames = FALSE,
  adjustMethod = "fdr",
  alpha = 0.1,
  group = 0,
  eff = 0,
  numberEff = FALSE,
  counts = 0,
  file = NULL
)

Arguments

obj

Output of fitFeatureModel or fitZig.

by

Column number or column name specifying which coefficient or contrast of the linear model is of interest.

coef

Column number(s) or column name(s) specifying which coefficient or contrast of the linear model to display.

number

The number of bacterial features to pick out.

taxa

Taxa list.

uniqueNames

Number the various taxa.

adjustMethod

Method to adjust p-values by. Default is "FDR". Options include "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". See p.adjust for more details. Additionally, options using independent hypothesis weighting (IHW) are available. See MRihw for more details.

alpha

Value for p-value significance threshold when running IHW. The default is set to 0.1

group

One of five choices, 0,1,2,3,4. 0: the sort is ordered by a decreasing absolute value coefficient fit. 1: the sort is ordered by the raw coefficient fit in decreasing order. 2: the sort is ordered by the raw coefficient fit in increasing order. 3: the sort is ordered by the p-value of the coefficient fit in increasing order. 4: no sorting.

eff

Filter features to have at least a "eff" quantile or number of effective samples.

numberEff

Boolean, whether eff should represent quantile (default/FALSE) or number.

counts

Filter features to have at least 'counts' counts.

file

Name of output file, including location, to save the table.

Value

Table of the top-ranked features determined by the linear fit's coefficient.

See Also

fitZig fitFeatureModel MRtable MRfulltable

Examples


data(lungData)
k = grep("Extraction.Control",pData(lungData)$SampleType)
lungTrim = lungData[,-k]
lungTrim=filterData(lungTrim,present=30)
lungTrim=cumNorm(lungTrim,p=0.5)
smokingStatus = pData(lungTrim)$SmokingStatus
mod = model.matrix(~smokingStatus)
fit = fitZig(obj = lungTrim,mod=mod)
head(MRcoefs(fit))
####
fit = fitFeatureModel(obj = lungTrim,mod=mod)
head(MRcoefs(fit))


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