# Converting DGEList Data into MicrobiomeStat

This guide will assist you in converting DGEList data format into MicrobiomeStat format.

Before we proceed with the conversion, let's examine the original structure of our DGEList data:

<figure><img src="https://3375851868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhFAmY4z7d1R15Cv49vXQ%2Fuploads%2Fhqopy7ieuODsbtrbr05n%2FScreenshot%202023-10-10%20at%2014.45.38.png?alt=media&#x26;token=e71dc761-bf02-4f22-aa94-ed94d5f6fb06" alt=""><figcaption><p>Original structure of the DGEList data.</p></figcaption></figure>

Now, follow the steps below to convert the DGEList data:

```r
# 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 DGEList to MicrobiomeStat data object
data.obj <- mStat_convert_DGEList_to_data_obj(dge)
```

After conversion, let's take a look at the transformed data structure:

<figure><img src="https://3375851868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhFAmY4z7d1R15Cv49vXQ%2Fuploads%2FeBeXOXf7TdFPVsZ57F58%2FScreenshot%202023-10-10%20at%2014.46.16.png?alt=media&#x26;token=42839408-5b08-41d9-a4ad-728f39d21678" alt=""><figcaption><p>Structure of the MicrobiomeStat data object after importing DGEList data.</p></figcaption></figure>

By using the `mStat_convert_DGEList_to_data_obj` function, you can effectively convert:

* **dge.obj**: Your existing DGEList object.

The resultant **MicrobiomeStat data object** includes:

* **feature.tab**: A matrix populated with counts data.
* **meta.dat**: A data frame detailing the sample information.

As part of the conversion process, features with a sum of zero from the counts data are filtered out to maintain data relevance.
