Skip to contents

This function is a part of the MicrobiomeStat package. It converts a DGEList object into a list (MicrobiomeStat data object) containing the counts and samples data. The returned list represents a microbiome dataset with features (OTUs or taxa) and metadata.

Usage

mStat_convert_DGEList_to_data_obj(dge.obj)

Arguments

dge.obj

A DGEList object to be converted.

Value

A MicrobiomeStat data object (a list) containing the following elements:

  • feature.tab: A matrix containing the counts data with rows as features and columns as samples.

  • meta.dat: A data frame containing the samples data.

Details

The function first checks if each component (counts, samples) of the DGEList object is not null. If a component is not null, it is converted to the appropriate format and added to the output list. The counts data is converted to a matrix, while the samples data is converted to a data frame. Note that only the rows (features) in the counts data that have a sum > 0 are retained.

Author

Caffery Yang

Examples

if (FALSE) { # \dontrun{
  # Load necessary packages
  # library(airway)
  # library(DESeq2)
  # library(edgeR)

  # Load dataset
  # data("airway")
  # dds <- DESeqDataSet(airway, design = ~ cell + dex)
  # dge <- DGEList(counts = counts(dds), group = dds$dex)

  # Convert to MicrobiomeStat data object
  # data.obj <- mStat_convert_DGEList_to_data_obj(dge)
} # }