Add ticks to scale_x_flowjo_biexp()?
1
0
Entering edit mode
Marissa • 0
@marissa-24334
Last seen 4.0 years ago

Hi! I am working on developing some flow cytometry dot plots for publication and am a fan of making them using ggcyto. However, I need to add tick marks and a better scale for my current plots because they are sorely lacking under the default setting of scale_x_flowjo_biexp. Does anyone know how to change the limits and breaks and add a nicer scale (say with 10^3, 10^4, etc) to the x and y axes?

library(ggcyto)
library(viridis)
library(CytoML)
library(RColorBrewer)
library(colorspace)

ws <- open_flowjo_xml("Figure 23.wsp")
gs <- flowjo_to_gatingset(ws, name = "R")
plot(gs)

attr(gs, "subset") <- "CD8+"
df <- fortify(gs)

cols <- rev(brewer.pal(10, "Spectral"))

df$d <- densCols(df[,`Comp-PE-Cy7-A`], df[,`Comp-Alexa Fluor 700-A`], 
                 colramp = colorRampPalette(cols))

ggplot(df, aes(x = `Comp-PE-Cy7-A`, y = `Comp-Alexa Fluor 700-A`)) + 
  geom_point(aes(color = d), shape = '.') +
  scale_color_identity() +
  theme_mf() +
  scale_x_flowjo_biexp() +
  scale_y_flowjo_biexp(widthBasis = -100) +
  labs(title = "Flow Cytometry Color Dot Plot #1", 
       subtitle = "Color Palette = 'Reverse Spectral'",
       x = "PE-Cy7 :: CD45RA", 
       y = "Alexa Fluor 700 :: TNFa")

Example dot plot, scales lacking

R CytoML ggycto • 1.2k views
ADD COMMENT
0
Entering edit mode

BTW, the data within gs parsed from flowjo_to_gatingset is typically already biexp scale, I wonder if you need/should add extra scale_*_flowjo_biexp layers?

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

Does the 'equal.spaceargument toscale_x_flowjo_biexp` do what you want?

ADD COMMENT

Login before adding your answer.

Traffic: 589 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6