---  
title: "ExpHunterSuite: Functional Report"
author: "SysBioLab"
output: 
  html_document:
    toc: true
    toc_float: true
    df_print: paged
    fig_width: 12
---

<style type='text/css'>
    body .main-container {
        max-width: 90%;

    }

    .plot_real_size {
      overflow: scroll;
      max-height: 600px;
    }

    .plot_real_size img{
      max-width: none;
      max-height: none;
    }

    embed {
   
  }   
</style>

```{r config, include=FALSE, message=FALSE}
require(ggplot2)
require(knitr)
require(clusterProfiler)
require(enrichplot)
require(DOSE)
```

```{r child="func_initial_details.Rmd"}
```
```{r child="func_deg_details.Rmd"}
```
```{r child="func_top_genes.Rmd"}
```

```{r ORA_analysis, echo=FALSE, results='asis', message=FALSE, warning=FALSE}


res_ora <- list()
for(funsys in names(flags_ora)) {
  if(flags_ora[[funsys]] == TRUE) {
    enrich_obj <- func_results$ORA[[funsys]]
    exp_res <- knitr::knit_expand("ora_plots_all_objects.Rmd")
    res_ora[[funsys]] <- knitr::knit(text=exp_res, quiet=TRUE)
  } else {
    res_ora[[funsys]] <- paste0("## **No ORA enrichment found for ", funsys, "**\n")
  }
}
cat(unlist(res_ora), sep = '\n')


res_gsea <- list()
for(funsys in names(flags_gsea)) {
  if(flags_gsea[[funsys]] == TRUE) {
    enrich_obj <- func_results$GSEA[[funsys]]
    exp_res <- knitr::knit_expand("gsea_plots_all_objects.Rmd")
    res_gsea[[funsys]] <- knitr::knit(text=exp_res, quiet=TRUE)
  } else {
    res_gsea[[funsys]] <- paste0("## **No GSEA enrichment found for ", funsys, "**\n")
  }
}
cat(unlist(res_gsea), sep = '\n')


```

## **Values of options passed to the Functional Hunter main function**
First column contains the option names; second column contains the given values for each option.
Note that large data objects (e.g. expression results, 
  organism table and custom annotation files) are not shown.
```{r opt_vals, echo = FALSE, results='asis'}
final_main_params <- func_results$final_main_params[! sapply(func_results$final_main_params, is.list)]
print(knitr::kable(cbind(final_main_params)))
```