# Converting SummarizedExperiment into MicrobiomeStat

The Bioconductor package `SummarizedExperiment` provides a convenient representation of experimental data. MicrobiomeStat provides a straightforward method for converting SummarizedExperiment objects.

```r
# Check if the 'airway' package is installed
if (!requireNamespace("airway", quietly = TRUE)) {
  # If not installed, install 'airway'
  BiocManager::install("airway")
}

# Load necessary libraries
library(airway)

# Use the provided 'airway' dataset as an example
data(airway)

# Convert the SummarizedExperiment object 'airway' into a MicrobiomeStat data object
airway_obj <- mStat_convert_SummarizedExperiment_to_data_obj(airway)
```

<figure><img src="/files/VJofEFEQcvhaqqnWOE7d" alt=""><figcaption><p>Structure of the <code>airway_obj</code> data object, converted from the <code>airway</code> SummarizedExperiment dataset. The visualization showcases the primary components of the MicrobiomeStat data object, detailing its matrices and data frames derived from the original dataset.</p></figcaption></figure>

The function `mStat_convert_SummarizedExperiment_to_data_obj` requires:

* **se.obj**: A SummarizedExperiment object for conversion.

Post conversion, the data is organized into a **MicrobiomeStat data object** with the following components:

* **feature.tab**: A matrix derived from assay data.
* **feature.ann**: A matrix consisting of rowData or feature annotations. Only the features present in the assay data are retained.
* **meta.dat**: A data frame containing colData or sample metadata.

For efficient analysis, features with an aggregate count of zero in the assay data are excluded during the conversion process.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.microbiomestat.wiki/setting-up-microbiomestat-installation-and-data-preparation/laying-the-foundation-creating-the-microbiomestat-data-object/inputting-summarizedexperiment-into-microbiomestat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
