Cold Acclimation Green Crab Experiment Part 41
Revising the water temperature analysis
I want to revise the temperature analysis. Since I had some temperature loggers fail during the experiments, there are timepoints with NAs. ANOVAs don’t do well with unbalanced sample sizes, so I am shifting to a Kruskall-Wallis testing approach. Details for conducing this test can be found here.
But first…some figures
Before I get to this…I remade some figures and forgot to post about it!
In this script, I added custom shaded areas highlighting which treatments and timepoints were part of the heat shocks.
Figure 1. TTR plot for Julia’s data
In this script and this script, I modified the temperature labels to reflect the actual temperatures experienced by crabs.
Figure 2. MA TTR
Figure 3. WA TTR
Julia’s temperature analysis
Alright, back to the main event. I conducted Kruskal-Wallis tests in this script. I examined the differences in temperature across conditions for the two heat pulses:
tempPulse1Stats <- kruskal.test(temperature ~ condition, data = tempPulse1Long)
tempPulse2Stats <- kruskal.test(temperature ~ condition, data = tempPulse2Long)
As expected, the conditions at Pulse 1 were different between treatments, but the test also identified significant differences during the second pulse. I investigated this further by looking at temperature differences by tank:
tempPulse2TankStats <- kruskal.test(temperature ~ tank, data = tempPulse2Long) #Investigate differences by tank
tempPulse2TankPairwise <- pairwise.wilcox.test(tempPulse2Long$temperature, tempPulse2Long$tank,
p.adjust.method = "bonferroni") #Control tanks (10 and 12) are not significantly different from eachother. Tanks 11 and 13 (treatment) are significantly different from all other tanks. Tank 13 seems to have the largest difference between all tanks.
Tank 13 being different from all other tanks makes sense based on the [temperature averages I calculated previously])(https://yaaminiv.github.io/Green-Crab-Experiment-2024-Part38/). I saved the statistical output from the temperature-specific tests here and the tank-specific tests here. Since tank temperatures are different during the second pulse, I created a new mulitpanel plot showing the temperatures by tank during the second pulse, and also included vertical lines where TTR was measured. To add the vertical lines, I used geom_vline
, and used as.POSIXct(ymd_hms())
to put in the date and time for the TTR timepoints based on code from this post.
mainPlot <- tempClean[4:395,] %>%
dplyr::select(dateTime,
temp10a, temp10b,
temp11a, temp11b,
temp12a, temp12b,
temp13a, temp13b) %>%
rowwise() %>%
mutate(., controlTemp = mean(c(temp10a, temp10b,
temp12a, temp12b), na.rm = TRUE),
treatmentTemp = mean(c(temp11a, temp11b,
temp13a, temp13b), na.rm = TRUE)) %>%
ggplot(., aes(x = dateTime, y = treatmentTemp)) +
geom_line(color = plotColors[1]) + #Average treatment temperature
geom_segment(aes(x = tempClean$dateTime[31], xend = tempClean$dateTime[108],
y = treatmentTempStatsOverall$meanTempPulse1[2], yend = treatmentTempStatsOverall$meanTempPulse1[2]),
color = plotColors[1], linetype = 3) + #Pulse 1 treatment segment
geom_ribbon(data = tempClean[31:108],
aes(x = dateTime,
y = treatmentTempStatsOverall$meanTempPulse1[2],
ymin = treatmentTempStatsOverall$meanTempPulse1[2] - treatmentTempStatsOverall$sdTempPulse1[2],
ymax = treatmentTempStatsOverall$meanTempPulse1[2] + treatmentTempStatsOverall$sdTempPulse1[2]),
fill = plotColors[1], alpha = 0.10) + #Pulse 1 treatment ribbon
geom_segment(aes(x = tempClean$dateTime[301], xend = tempClean$dateTime[395],
y = treatmentTempStatsOverall$meanTempPulse2[2], yend = treatmentTempStatsOverall$meanTempPulse2[2]),
color = plotColors[1], linetype = 3) + #Pulse 2 treatment segment
geom_ribbon(data = tempClean[301:395],
aes(x = dateTime,
y = treatmentTempStatsOverall$meanTempPulse2[2],
ymin = treatmentTempStatsOverall$meanTempPulse2[2] - treatmentTempStatsOverall$sdTempPulse2[2],
ymax = treatmentTempStatsOverall$meanTempPulse2[2] + treatmentTempStatsOverall$sdTempPulse2[2]),
fill = plotColors[1], alpha = 0.10) + #Pulse 2 treatment ribbon
geom_line(aes(x = dateTime, y = controlTemp), color = plotColors[2]) + #Control treatment temperature
geom_segment(aes(x = tempClean$dateTime[31], xend = tempClean$dateTime[108],
y = treatmentTempStatsOverall$meanTempPulse1[1], yend = treatmentTempStatsOverall$meanTempPulse1[1]),
color = plotColors[2], linetype = 3) + #Pulse 1 control segment
geom_ribbon(data = tempClean[31:108],
aes(x = dateTime,
y = treatmentTempStatsOverall$meanTempPulse1[1],
ymin = treatmentTempStatsOverall$meanTempPulse1[1] - treatmentTempStatsOverall$sdTempPulse1[1],
ymax = treatmentTempStatsOverall$meanTempPulse1[1] + treatmentTempStatsOverall$sdTempPulse1[1]),
fill = plotColors[2], alpha = 0.15) + #Pulse 1 control ribbon
geom_segment(aes(x = tempClean$dateTime[301], xend = tempClean$dateTime[395],
y = treatmentTempStatsOverall$meanTempPulse2[1], yend = treatmentTempStatsOverall$meanTempPulse2[1]),
color = plotColors[2], linetype = 3) + #Pulse 2 control segment
geom_ribbon(data = tempClean[301:395],
aes(x = dateTime,
y = treatmentTempStatsOverall$meanTempPulse2[1],
ymin = treatmentTempStatsOverall$meanTempPulse2[1] - treatmentTempStatsOverall$sdTempPulse2[1],
ymax = treatmentTempStatsOverall$meanTempPulse2[1] + treatmentTempStatsOverall$sdTempPulse2[1]),
fill = plotColors[2], alpha = 0.25) + #Pulse 2 control ribbon
geom_vline(xintercept = as.POSIXct(ymd_hms("2023-07-31 16:00:00")), linetype = 3, color = "black") + #Pre-exposure TTR timepoint
geom_vline(xintercept = as.POSIXct(ymd_hms("2023-08-01 16:50:00")), linetype = 3, color = "black") + #Pulse 1 TTR timepoint
geom_vline(xintercept = as.POSIXct(ymd_hms("2023-08-04 16:00:00")), linetype = 3, color = "black") + #Pulse 2 TTR timepoint
scale_x_datetime(name = "") +
scale_y_continuous(name = "Temperature (ºC)",
limits = c(14.9,33),
breaks = c(seq(15,30,5), seq(31,33,1))) +
ggtitle("A. Overall Experimental Temperature") +
theme_classic(base_size = 15)
tempClean[301:394,] %>%
dplyr::select(dateTime,
temp10a, temp10b,
temp11a, temp11b,
temp12a, temp12b,
temp13a, temp13b) %>%
rowwise() %>%
mutate(., tank10avg = mean(c(temp10a, temp10b), na.rm = TRUE),
tank11avg = mean(c(temp11a, temp11b), na.rm = TRUE),
tank12avg = mean(c(temp12a, temp12b), na.rm = TRUE),
tank13avg = mean(c(temp13a, temp13b), na.rm = TRUE)) %>%
ggplot(., aes(x = dateTime, y = tank10avg)) +
geom_line(color = plotColors[2]) +
geom_line(aes(x = dateTime, y = tank11avg), color = plotColors[1]) +
geom_line(aes(x = dateTime, y = tank12avg), color = plotColors[2]) +
geom_line(aes(x = dateTime, y = tank13avg), color = plotColors[1]) +
scale_x_datetime(name = "") +
scale_y_continuous(name = "Temperature (ºC)",
limits = c(29,32.5)) +
ggtitle("B. Temperatures for Second Heat Stress") +
theme_classic(base_size = 15) + theme(axis.text.x = element_text(angle = 45, vjust = 0.55),
plot.margin = margin(b = 0)) #Average treatment temperature #Take temperature data for the second pulse and average data at each time point for each tank.
mainPlot / pulse2Plot +
plot_layout(heights = c(5, 1)) #Create multipanel plot. Use plot_layout to make the overal experimental temperature plot larger than the pulse 2 plot
Figure 4. Julia’s temperature data multipanel
2024 temperature analysis
I conducted Kruskal-Wallis tests for MA in this script and WA in this script. I used only data after the ramp down for this analysis. As expected, there was a significant difference between temperature treatments in MA (Chi-squared = 2941.37, p = 0) and WA (Chi-squared = 3191.67, p = 0).
Figure 5. 2024 experimental temperature multipanel
Going forward
- Re-analyze Catlin’s TTR data
- Analyze Catlin’s HOBO data
- Add Catlin’s methods and results to manuscript
- Outline introduction
- Outline discussion
- Write introduction
- Write discussion
- Troubleshoot lipid assay protocol
- Conduct lipid assay for crabs of interest