Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view_plate visualization enhancements: more than just text #3

Open
seaaan opened this issue Mar 26, 2015 · 4 comments
Open

view_plate visualization enhancements: more than just text #3

seaaan opened this issue Mar 26, 2015 · 4 comments

Comments

@seaaan
Copy link
Collaborator

seaaan commented Mar 26, 2015

http://www.r-bloggers.com/plotting-microtiter-plate-maps/

@seaaan
Copy link
Collaborator Author

seaaan commented Sep 25, 2016

page 9

splots

@seaaan seaaan changed the title displayAsPlate ggplot view_plate visualization enhancements: more than just text Sep 25, 2016
@seaaan
Copy link
Collaborator Author

seaaan commented Sep 26, 2016

library(plateR)
library(dplyr)
library(ggplot2)

plot_plate <- function(plate, column) {
  to_plot <- plate %>% 
    mutate(RowId = substr(Wells, 1, 1), 
      ColId = as.numeric(substr(Wells, 2, 3))) %>% 
    mutate(RowId = factor(RowId, levels = rev(unique(RowId)))) 

  ggplot(to_plot, aes(x = ColId, y = RowId)) + 
    geom_tile(aes_string(fill = column), height = 0.9, width = 0.9) +
    scale_x_continuous(breaks = 1:max(to_plot$ColId)) +
    xlab(NULL) + ylab(NULL)
}

d <- read_plate(system.file("extdata", "example-1.csv", package = "plateR"))

plot_plate(d, "Killing")
plot_plate(d, "log10(Concentration)") + labs(fill = "Concentration")
plot_plate(d, "log10(Concentration)") + scale_fill_distiller(direction = 1) + 
  labs(fill = "Concentration")

Output from third example call:
image

@jooolia
Copy link
Member

jooolia commented Sep 27, 2016

I think this is great! Indeed this way you could get a quick view of the data in plate format which could be very helpful for troubleshooting.

@seaaan
Copy link
Collaborator Author

seaaan commented Sep 27, 2016

Mapped to size instead:

plot_bubbles <- function(plate, column) {
   to_plot <- plate %>% 
      mutate(RowId = substr(Wells, 1, 1), 
         ColId = as.numeric(substr(Wells, 2, 3))) %>% 
      mutate(RowId = factor(RowId, levels = rev(unique(RowId)))) 

   ggplot(to_plot, aes(x = ColId, y = RowId)) + 
      geom_point(aes_string(size = column), shape = 1) +
      scale_x_continuous(breaks = 1:max(to_plot$ColId)) +
      xlab(NULL) + ylab(NULL)
}

d <- read_plate(system.file("extdata", "example-1.csv", package = "plateR"))

plot_bubbles(d, "Killing")

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants