Created
April 13, 2018 16:48
-
-
Save edgararuiz-zz/6a6b7d3b89a99b55e9962d8aff919505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Immunogenicity - Tiered Approuch to Assess ADA Positive Samples" | |
output: | |
flexdashboard::flex_dashboard: | |
orientation: rows | |
vertical_layout: fill | |
params: | |
screening: "Sample_ADA_Data_05062017_Screening.csv" | |
confirmatory: "Sample_ADA_Data_05062017_Confirmatory.csv" | |
screening_cut_point: 200 | |
confirmatory_cut_point: 20 | |
--- | |
```{r setup, include=FALSE} | |
library(flexdashboard) | |
library(tidyverse) | |
library(metricsgraphics) | |
library(RColorBrewer) | |
screening <- read_csv(params$screening) | |
confirmatory <- read_csv(params$confirmatory) | |
samples <- screening %>% | |
left_join(confirmatory, by = "Sample_Number") %>% | |
mutate(Signal_Response_Difference = Signal_Response_No_Drug - Signal_Response_Drug) %>% | |
mutate(Signal_Response_Divide = Signal_Response_Difference / Signal_Response_No_Drug) %>% | |
mutate(Percent_Signal_Inhibition_Drug = Signal_Response_Divide * 100) %>% | |
mutate(Screening_Result_Drug = ifelse(Signal_Response_No_Drug > params$screening_cut_point, "Positive", "Negative")) %>% | |
mutate(Confirmatory_Result_Drug = ifelse(Percent_Signal_Inhibition_Drug > params$confirmatory_cut_point, "Positive", "Negative")) %>% | |
mutate(True_Positive = Screening_Result_Drug == Confirmatory_Result_Drug) %>% | |
mutate_if(is.integer, as.numeric) | |
samples | |
``` | |
Row | |
----------------------------------------------------------------------- | |
### Observations | |
```{r} | |
valueBox(nrow(samples), "Observations", icon = "fa-flask") | |
``` | |
### Screening | |
```{r} | |
valueBox(params$screening_cut_point, "Screening Cut Point", icon = "fa-filter") | |
``` | |
### Confirmatory | |
```{r} | |
valueBox(params$confirmatory_cut_point, "Confirmatory Cut Point", icon = "fa-check") | |
``` | |
### Confirmatory | |
```{r} | |
samples %>% | |
filter(True_Positive) %>% | |
tally() %>% | |
pull %>% | |
gauge(., min = 0, max = nrow(samples), label = "True Positives") | |
``` | |
Row {data-width=650} | |
----------------------------------------------------------------------- | |
### Drug vs No-Drug Signals | |
```{r} | |
samples %>% | |
mjs_plot(x = Signal_Response_Drug, y = Signal_Response_No_Drug) %>% | |
mjs_point(color_accessor = True_Positive) %>% | |
mjs_labs("Signal Response Drug", "Signal Response No Drug") %>% | |
mjs_add_legend("color_accessor") | |
``` | |
Row | |
----------------------------------------------------------------------- | |
### True Positive - Drug Signals | |
```{r} | |
samples %>% | |
filter(True_Positive) %>% | |
mjs_plot(x = Signal_Response_Drug) %>% | |
mjs_histogram() | |
``` | |
### True Positive - No Drug Signals | |
```{r} | |
samples %>% | |
filter(True_Positive) %>% | |
mjs_plot(x = Signal_Response_No_Drug) %>% | |
mjs_histogram() | |
``` | |
### True Positive - Signal Inhbition | |
```{r} | |
samples %>% | |
filter(True_Positive) %>% | |
mjs_plot(x = Percent_Signal_Inhibition_Drug) %>% | |
mjs_histogram() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment