Sitagliptin / Metformin Interaction Report

Libraries were retrieved for the following 4 conditions:

library(magrittr)
conditionTable <- function(c, x, y, xy) {
  this_tbl <- data.frame(c("C", "X", "Y", "X + Y"), c(c, x, y, xy))
  colnames(this_tbl) <- c("Generic", "Signal")
  return(this_tbl)
}
datatable(conditionTable("None", "Sitagliptin", "Metformin", "Sitagliptin / Metformin"), options = list(paging = FALSE), caption = "Conditions for interaction profile") %>% formatStyle('Signal', backgroundColor = "orange", fontWeight = 'bold')
set.seed(252)
suppressPackageStartupMessages(library(dplyr))
library(xtable)
library(limma)
library(edgeR)
library(sitt)
data("sit_met_edgeR", package = "sitt")
data("null_edgeR", package = "sitt")
metadata <- sit_met_edgeR$metadata
metadata <- Filter(function(x)!all(is.na(x)), metadata)
library(shiny)
library(DT)

datatable(metadata, class = 'cell-border stripe',
          caption = "Libraries retrieved for Sitagliptin / Metformin at Mid concentration", extensions = 'ColReorder', options = list(dom = 'Rlfrtip'))

Metadata

this_metadata <- dplyr::select(metadata, donor_id, cell_name, treatment_name,
              alternate_treatment_name, donor_age, donor_sex)

this_metadata <- xtable(this_metadata,
                        caption = "Metadata for interaction mode classification.",
                        label = "Metadata", align = rep("c", 7),
                        digits = c(1, 2, 0, 0, 2, 1, 1),
                        display = c("f", "f", "s", "s", "s", "f", "f"))
print(this_metadata, type = "html")

Design Matrix

Design matrix was constructed with stats::model.matrix

sit_met_edgeR$design$design_matrix

Contrasts

Contrasts map to the 6-d pairwise comparisons vectors and were generated with limma::makeContrasts()

sit_met_edgeR$design$contrasts
plotMDS(sit_met_edgeR$voom)

6-d Pairwise Comparison Outcome Vectors

There 75 theoretically enumerated outcome vectors * LINK *. r unique(length(sit_met_edgeR$outcome.vectors.s)) unique outcome vectors were coded with p-values and log-fold changes from likelihood ratio tests edgeR::glmLRT

ov_table <- ovTable(sit_met_edgeR$outcome.vectors.s)
ov_table$Log.Freq <- round(ov_table$Log.Freq, 3)
ov_table$Prop <- round(ov_table$Prop, 4)
datatable(ov_table)
library(ggplot2)
pw_s <- ovTable(sit_met_edgeR$outcome.vectors.s)
p1 <- qplot(x = 1:nrow(pw_s), y = Freq, data = pw_s,
      geom = "bar", stat = "identity", xlab = "Outcome Vector",
      ylab = "Frequency", main = "Frequency Distribution of Outcome Vectors",
      log = "y", caption = "Testing") + scale_x_discrete(breaks = 1:nrow(pw_s))
p1

The null distribution was generated by permuting the columns of the counts marix, before *EList objects were created with limma and edgeR

null_s <- ovTable(null_edgeR$outcome.vectors.s)
p2 <- qplot(x = 1:nrow(null_s), y = Freq, data = null_s,
      geom = "bar", stat = "identity", xlab = "Outcome Vector",
      ylab = "Frequency", main = "Null Distribution of Outcome Vectors",
      log = "y") + scale_x_discrete(breaks = 1:nrow(null_s))
p2

Interaction Mode Classification

library(dplyr)
modes_tbl <- table(sit_met_edgeR$modes) %>% as.data.frame
colnames(modes_tbl) <- c("Mode", "Freq")
modes_tbl$Prop <- modes_tbl$Freq / sum(modes_tbl$Freq)
modes_tbl$Prop <- round(modes_tbl$Prop, digits = 3)
modes_tbl$Perc <- modes_tbl$Prop * 100
datatable(modes_tbl, caption = "Frequency Distribution of Interaction Modes") %>% formatStyle('Mode', backgroundColor = "orange", fontWeight = 'bold')
my_modes <- sit_met_edgeR$modes[which(sit_met_edgeR$modes != "NI"
                                             & sit_met_edgeR$modes != "A" &
                            sit_met_edgeR$modes != "UC")]

Distribution of Genes Classified into a Defined Interaction Mode

r length(my_modes) genes were classified into 1/10 mathematically defined interaction modes.

library(dplyr)
this_levels <- levels(sit_met_edgeR$modes)
this_levels <- this_levels[this_levels != "NI" & this_levels != "A" & this_levels != "UC"]
my_modes <- factor(my_modes, levels = this_levels)
modes_tbl <- table(my_modes) %>% as.data.frame
colnames(modes_tbl) <- c("Mode", "Freq")
modes_tbl$Prop <- modes_tbl$Freq / sum(modes_tbl$Freq)
modes_tbl$Prop <- round(modes_tbl$Prop, digits = 3)
modes_tbl$Perc <- modes_tbl$Prop * 100
datatable(modes_tbl, caption = "Frequency Distribution of Defined Interaction Modes (Exclude NI, A, and UC vectors)") %>% formatStyle('Mode', backgroundColor = "orange", fontWeight = 'bold')


taylo5jm/interactions documentation built on May 31, 2019, 3:57 a.m.