Sys.getenv("PATH")
knitr::opts_chunk$set(echo=FALSE, include=TRUE, warning=FALSE, message=FALSE, results = 'asis', fig.width = 10, fig.height = 6)

library(DT)
#library(dplyr)
#library(eulerr)
#library(ggplot2)
library(htmltools)
library(kableExtra)
#library(UpSetR)

This report is generated by the NetworkEval R package. Its purpose is to evaluate the accuracy of predicted TF-gene interactions, by comparing them against a set of positive and negative regulatory interactions (RIs) generated using various strategies.

Summary

Summary table

summary_df <- read.delim(paste0(params$results_dir, "/summary_report/summary_table.tsv"))
datatable(summary_df, rownames= FALSE, options = list(searching = FALSE, pageLength = 25)) %>% 
  formatCurrency(c("RIs_input", "RIs_TFfiltered", "RIs_RIfiltered", "TP", "FP"), currency='') %>%
  formatRound(c("RIs_input", "RIs_TFfiltered", "RIs_RIfiltered", "TP", "FP"), digits=0) %>%
  formatRound(c("Sensitivity", "Specificity", "Precision"), digits=3) %>%
  formatStyle('Sensitivity',  background = styleColorBar(range(summary_df$Sensitivity), 'burlywood')) %>%
  formatStyle('Specificity',  background = styleColorBar(range(summary_df$Specificity), 'burlywood')) %>%
  formatStyle('Precision',  background = styleColorBar(range(summary_df$Precision), 'burlywood')) #%>% 
  #formatStyle(  'Set_ID', 'group',  backgroundColor = styleEqual(c("control", "expression", "physical"), c('lightcoral', 'lightgreen', "lightblue")))

Histograms

cat(paste0("![](", results_dir, "/summary_report/histogram.png)"), "\n")

Upset plot

cat(paste0("![](", results_dir, "/summary_report/upset.png)"), "\n")

Datasets

for(s in set_ids) {
     cat(paste0("\n## ", s, " {.tabset}"))
     cat(paste0("\n **Stats**\n"))

     cat(kable(summary_df %>% filter(Set_ID==s), digits=3, format.args = list(big.mark = ',')) %>% kable_styling(full_width = T, font_size = 12, bootstrap_options = c("striped", "hover")))

     confusion <- read.delim(file = paste0(results_dir, "/", s, "/", s, "_confusion_matrix.tsv"), header=T, stringsAsFactors=FALSE)
     rownames(confusion) <- c("predicted_positive", "predicted_negative", "total")
     cat(kable(confusion, digits=3, format.args = list(big.mark = ',')) %>% kable_styling(full_width = T, font_size = 12, bootstrap_options = c("striped", "hover")))

     cat(paste0("\n### ROC curve\n"))

     cat(paste0("![](", results_dir, "/", s, "/", s, "_roc.png)"), "\n")

     cat(paste0("\n### Precision-recall curve\n"))

     cat(paste0("![](", results_dir, "/", s, "/", s, "_prc.png)"), "\n")

     cat(paste0("\n### Venn diagram\n"))

     cat(paste0("![](", results_dir, "/", s, "/", s, "_venn.png)"), "\n")
}


rioualen/NetworkEval documentation built on April 10, 2021, 5:22 a.m.