Skip to contents

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

Usage

mStat_convert_DESeqDataSet_to_data_obj(dds.obj)

Arguments

dds.obj

A DESeqDataSet 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.

  • feature.ann: A matrix containing feature annotations.

Details

The function first checks if each component (counts, samples, feature annotations) of the DESeqDataSet 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 and feature annotations are 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)

  # Load dataset
  # data("airway")
  # dds <- DESeqDataSet(airway, design = ~ cell + dex)

  # Convert to MicrobiomeStat data object
  # data.obj <- mStat_convert_DESeqDataSet_to_data_obj(dds)
} # }