The aim of this experiment is to determine the effect of Syk inhibition or Mincle KO on the response to time arrested spores.
Begin by importing the gMFI table exported from flowjo.
#Import the dataset
df <- read_csv("C:/Users/gv272/University of Exeter/Cook, Peter - Projects/E01 Immune cells/E01 D and A/E01_021/George analysis/E01_021 gMFI.csv")
Set up the dataframe so it can easily be analysed.
The first line of code turns the data from a wide format, where gMFI values for 1 sample are found on the same row, to a long format, where there is only 1 gMFI value per row with an extra column stating the corresponding marker.
The Marker and Condition columns are then converted to factors and the order of the levels specified. This is useful as the graphs will then display the levels in this order.
Finally, the Mouse column is originally stored as a numeric value. Converting to a factor will allow us to plot the values from different mice as shapes.
dfw <- df %>%
pivot_longer(cols=c(2:5), names_to="Marker", values_to="gMFI")
dfw$Marker <- factor(dfw$Marker, levels = c("CD40", "CD86",
"PDL2", "MHCII"))
dfw$Condition <- factor(dfw$Condition, levels=c("Media", "0h", "4h-", "4h+",
"DZym", "Zym", "LPS"))
dfw$Mouse <- as.factor(dfw$Mouse)
Filter the FMOs, only include DMSO or Syk and remove mouse 4 (low number of cells)
dfw_syk <- dfw %>%
filter(FMO=="N") %>%
filter(Group=="DMSO" | Group=="Syk") %>%
filter(Mouse != 4)
We are now ready to plot! There is quite a lot going on here, however, the basics aren’t too difficult. This is uing the ggplot package.
ggplot(dfw_syk,
aes(x=Condition,
y= gMFI/1000)) +
ggbeeswarm::geom_beeswarm(aes(group=Group,
colour=Group,
shape=Mouse),
dodge.width = 0.8,
size=1.5,
show.legend = T) +
stat_summary(aes(group=Group,
color=Group),
geom="bar",
fun = mean,
position = position_dodge2(preserve = 'single', width=0.8),
fill="NA",
size = 1, width = 0.8,
show.legend = T) +
ylab(expression(paste("gMFI x ", 10^3))) +
scale_y_continuous(expand=c(0,0)) +
facet_wrap(vars(Marker), nrow=1, scales = "free_y") +
theme_prism(base_line_size=0.2) +
theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) +
theme(legend.position = "bottom",
text=element_text(face="plain"),
strip.text = element_text(face="bold"),
axis.title.x=element_blank())
Let’s break down the code now:
One consideration is the Media/Spore stages have a much lower gMFI than Zym/DZym/LPS. We could generate two separate plots which would more clearly show the difference between 4h- spores and 4h+ spores.
First, let’s subset the dataframe into spore/strong stimuli conditions:
Spores <- c("Media", "0h", "4h-", "4h+")
Stimuli <- c("Media", "DZym", "Zym", "LPS")
dfw_spores <- dfw_syk[dfw_syk$Condition %in% Spores ,]
dfw_stim <- dfw_syk[dfw_syk$Condition %in% Stimuli ,]
Now we can plot these separately:
Inhibition of Syk decreases the response to all spore stages with CD40 and CD86 compared with DMSO treatment. Media+Syk does not activate DCs (unlike what Dan saw). CD40 is decreased with DZym under syk inhibition, but Zym and LPS do not affect. For CD86, DZym is strongly inhibited by Syk but it also decreases expression in response to Zym and LPS.
Now let’s select the data for the Mincle experiment.
dfw_mincle <- dfw %>%
filter(FMO=="N") %>%
filter(Group=="DMSO" | Group=="Mincle") %>%
filter(Mouse != 4)
First, let’s subset the dataframe into spore/strong stimuli conditions:
Spores <- c("Media", "0h", "4h-", "4h+")
Stimuli <- c("Media", "DZym", "Zym", "LPS")
dfw_mincle_spores <- dfw_mincle[dfw_mincle$Condition %in% Spores ,]
dfw_mincle_stim <- dfw_mincle[dfw_mincle$Condition %in% Stimuli ,]
Now we can plot these separately:
There appears to be no difference in the response to the spore stages in WT or Mincle KO.
Replicate 1 for Mincle KO shows low CD40 activation for LPS - this is due to low cell numbers observed.