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

Change symbol and sizes for 384 and 96-well plates? #31

Open
imkidd57 opened this issue Nov 6, 2021 · 5 comments
Open

Change symbol and sizes for 384 and 96-well plates? #31

imkidd57 opened this issue Nov 6, 2021 · 5 comments

Comments

@imkidd57
Copy link

imkidd57 commented Nov 6, 2021

Hi Scott - is there any way to pass parameters to change the size of the squares in 384-well maps, and swap the circles for squares in 96-well maps? Basically I am considering to reduce the whitespace between the squares in raw_map, and change the symbols in z_grid to also be squares.

I'm not new to R but also not at a particularly advanced level. Looking at the source code for plt384 it seems possible, but wondered if there was a simpler way than trying to adapt it.

Kind regards

mike

@Swarchal
Copy link
Owner

Swarchal commented Nov 6, 2021

Hi Mike,

It should be possible without making any changes. Any additional arguments you give to the plotting functions are passed to ggplot2's geom_point(), so you can use any valid size and shape values. I also added a little helper so you can use shape="square" or shape="circle" rather than shape=22 or shape=21`.

e.g

library(platetools)

df = data.frame(val = rnorm(96), well = num_to_well(1:96))

raw_map(df$val, df$well, shape = "square", size = 15)

image

@imkidd57
Copy link
Author

imkidd57 commented Nov 7, 2021

Hi Scott

Thanks so much for this advice and helper code. Using this, it works a treat.

Our 384-well plates are convoluted by interwoven four 96-well plate quadrants, and all now break out nicely into images that make viewing easier (Q4 is a blank). The values scale is wrong - should be 12-14 max - but I think I know how to fix that.

Snippet and .png using platetools z_grid:

z_grid(main_table$n_FAM, main_table$96-coord, shape = "square", size = 14, plate_id = main_table$Quadrant) + scale_fill_gradientn(colours = c("white", "tomato3"))

Thanks again for the quick response!

n_FAM_quad

@imkidd57 imkidd57 closed this as completed Nov 7, 2021
@imkidd57 imkidd57 reopened this Nov 7, 2021
@imkidd57
Copy link
Author

imkidd57 commented Nov 7, 2021

sorry closed by mistake!

@Swarchal
Copy link
Owner

Swarchal commented Nov 9, 2021

Unless I've misunderstood, your values are unexpected because you're using z_grid which returns z-scored values, if you want to see the raw values then raw_grid() is the function you want.

@imkidd57
Copy link
Author

imkidd57 commented Nov 9, 2021

Thanks Scott - I had somehow overlooked raw_grid. Of course it turned out that I did not know a way to fix the previous legend scale, but using raw_grid does return the expected range to it.
Much appreciated!

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

No branches or pull requests

2 participants