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")

Tooltip shows the relevant data for well when you hover over it

Or, use mtp_plot() which is best for saving and printing and plays nice with ggplot2.

One plate

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))

add lineplots

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))

Multiple Plates

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

Roadmap



npjc/mtpview1 documentation built on Oct. 29, 2019, 9:41 a.m.