Skip to content

Instantly share code, notes, and snippets.

@soh-i
Created April 5, 2018 01:38
Show Gist options
  • Select an option

  • Save soh-i/6735bcbdc726272129ebb996f7096aab to your computer and use it in GitHub Desktop.

Select an option

Save soh-i/6735bcbdc726272129ebb996f7096aab to your computer and use it in GitHub Desktop.
Plotting gated FACS data
library(ggplot2)
library(RColorBrewer)
d <- read.csv('BC4-R1-1.fcs_spill_applied_AID_BC_Cell_P1.txt', sep='\t', header=T, skip=1)
names(d) <- c('Event', 'FSC', 'SCC', 'FITC')
myPalette <- colorRampPalette(rev(brewer.pal(11, "Spectral")), space="Lab")
g <- ggplot(d, aes(y=FSC, x=FITC)) +
geom_hex(bins=128) +
scale_x_continuous(trans=logiclescale::logicle_trans()) +
scale_fill_gradientn(colours=myPalette(10)) +
theme_bw() +
labs(x='GFP', y='FSC-A') +
ylim(0, 200000)
ggsave(plot=g, filename='BC4-R1-1.pdf', h=5, w=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment