
# 1 - Loaded Data

<br>


* **Experimental design:**

```{r design, out.width = "70%", fig.align='left'}

bioFact   <- getBioFactors(rflomics.MAE)
batchFact <- getBatchFactors(rflomics.MAE)
metaFact  <- getMetaFactors(rflomics.MAE)

datatable(getDesignMat(rflomics.MAE)[c("samples", bioFact, batchFact, metaFact)], 
              options = list(pageLength = 6, scrollX = T, dom = 'tip'),
              rownames = FALSE, class = 'cell-border stripe')

              # caption = htmltools::tags$caption(style = 'caption-side: top;
              #                                   text-align: left;
              #                                   color:black;
              #                                   font-size:20px;
              #                                   font-weight: bold;', "User-provided experimental plan"),
```

<br>

* **Dataset(s) overview:**


```{r data.over.view, out.width = "90%", fig.cap="Overview of the input omics data. Each color represents a distinct dataset, with their respective samples on the x-axis and the number of features on the y-axis. It illustrates the samples overlap across dataset.", fig.align='left'}

plotDataOverview(object = rflomics.MAE)
#plotConditionsOverview(object = raw.rflomics.MAE)
#fig.left: Overview of the input omics data. Each color represents a distinct dataset, with their respective samples on the x-axis and the number of features on the y-axis. It illustrates the samples overlap across dataset. fig.right: Number of Datasets per Condition. Each axis represents a distinct biological factor, and each cell value signifies the count of datasets associated with that specific condition.
```


<br>
<br>

---

# 2 - Statistical setting

<br>

* **Types of factors and modality of reference:**

```{r factors}

fact.types <- getFactorTypes(rflomics.MAE)
fact.names <- getFactorNames(rflomics.MAE)
fact.ref <- vector()
for(i in 1:length(fact.names)){
  fact.ref[i] <- getFactorModalities(rflomics.MAE, fact.names[i])[1]
}

df <- data.frame("Factor_names" = fact.names ,
           "Factor_type" = fact.types,
           "Factor_reference" = fact.ref)

datatable(df , rownames = FALSE , class = 'cell-border stripe',
              options = list( pageLength = 6, scrollX = F, dom = 'tip'))

# caption= htmltools::tags$caption(style = 'caption-side: top;
#                                                 text-align: left;
#                                                 color:black;
#                                                 font-size:20px;
#                                                 font-weight: bold;', "Factor settings")
```

<br>

* **The selected model formula:**
*The contrasts are a statistical translation of biological questions*

```
`r getModelFormula(rflomics.MAE)`
````

<br>

* **The selected contrasts (hypothesis):**

```{r contrastSel, results="asis"}

df <- getSelectedContrasts(rflomics.MAE)[,c("tag", "groupComparison", "contrastName", "type")]
names(df) <- c("tag","Comparison", "Contrast_names", "Type")
datatable(df, rownames = FALSE,
              options = list( pageLength = 6, scrollX = F, dom = 'tip'),
              class = 'cell-border stripe')
```

