5.2 Load Results from Differential Expression Analysis

This script reads the DE results produced by 02_differential_expression_ecoli.Rmd. Make sure you have run that script first — it saves two files to results/:

  • results/DE_treatment_vs_control_all.tsv — all tested genes with shrunken LFC
  • results/DE_treatment_vs_control_significant.tsv — significant DE genes (padj < 0.05, |LFC| >= 1)
git_root <- system("git rev-parse --show-toplevel", intern = TRUE)

res_df <- read.table(
  file.path(git_root, "results", "DE_treatment_vs_control_all.tsv"),
  header      = TRUE,
  sep         = "\t",
  check.names = TRUE
)

res_sig <- read.table(
  file.path(git_root, "results", "DE_treatment_vs_control_significant.tsv"),
  header      = TRUE,
  sep         = "\t",
  check.names = TRUE
)

cat("All tested genes     :", nrow(res_df), "\n")
## All tested genes     : 3698
cat("Significant DE genes :", nrow(res_sig), "\n")
## Significant DE genes : 646
cat("  Upregulated        :", sum(res_sig$log2FoldChange >= 1), "\n")
##   Upregulated        : 258
cat("  Downregulated      :", sum(res_sig$log2FoldChange <= -1), "\n")
##   Downregulated      : 388