knitr::opts_chunk$set(echo = TRUE)
suppressPackageStartupMessages(library(tidyverse)) library(mtpview1) mtp_example1
View your data in place interactively with mtp_view()
.
library(tidyverse) # mtp_example1 %>% mtp_view() # mtp_example1 %>% mtp_view(fillVar = "drug") mtp_example1 %>% mtp_view(fillVar = "drug", fillOpacityVar = "conc")
Or, use mtp_plot()
which is best for saving and printing and plays nice with ggplot2
.
mtp_example1 %>% mutate(plate = 1) %>% mtp_ggplot(aes(plate = plate, well = well)) + mtp_spec_96well() + geom_footprint() + geom_notched_border() + geom_col_label() + geom_row_label() + geom_well_rect(aes(fill = drug, alpha = conc))
You can also add lineplots to if you have repeated measures for each well:
library(tidyverse) library(mtpview1) mtp_example2 %>% mutate(plate = 1) %>% unnest() %>% mtp_ggplot(aes(plate = plate, well = well)) + mtp_spec_96well() + geom_footprint() + geom_notched_border() + geom_col_label() + geom_row_label() + geom_well_rect(aes(fill = cond)) + geom_well_line(aes(x = runtime, y = measure))
Another example:
mtp_example3 %>% mutate(plate = 1) %>% unnest() %>% mtp_ggplot(aes(plate = plate, well = well)) + mtp_spec_96well() + geom_footprint() + geom_notched_border() + geom_col_label() + geom_row_label() + geom_well_rect(aes(fill = drug, alpha = dose_um)) + geom_well_line(aes(x = runtime, y = measure)) + geom_well_text(aes(label = strain))
data <- mtp_example4 %>% filter(run == 1) %>% unnest() plot <- data %>% mtp_ggplot(aes(plate = plate, well = well)) + mtp_spec_96well() + geom_footprint(aes(fill = strain), alpha = 0.25) + geom_notched_border() + geom_col_label(size = 2) + geom_row_label(size = 2) + geom_well_rect(fill = "grey96", size = 0.1) + geom_well_line(aes(x = runtime, y = measure), size = 0.2) + facet_wrap(~plate) plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.