T50 curves

Author

Marina Scalon

Working directory and packages

setwd("C:/Marina/PDS/Curso Ecofisiologia/R")
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.4.3
Warning: package 'ggplot2' was built under R version 4.4.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.2     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Warning: package 'drc' was built under R version 4.4.3
Loading required package: MASS

Attaching package: 'MASS'

The following object is masked from 'package:dplyr':

    select


'drc' has been loaded.

Please cite R and 'drc' if used for a publication,
for references type 'citation()' and 'citation('drc')'.


Attaching package: 'drc'

The following objects are masked from 'package:stats':

    gaussian, getInitial

Data organization

dados <- read.csv("Termotolerancia.csv", sep=";")
str(dados)
'data.frame':   12 obs. of  8 variables:
 $ Especie: chr  "Lig01" "Lig02" "Lig03" "Pl01" ...
 $ X20    : num  0.842 0.788 0.836 0.8 0.797 0.828 0.525 0.664 0.651 0.817 ...
 $ X30    : num  0.796 0.78 0.828 0.796 0.79 0.797 0.546 0.659 0.687 0.772 ...
 $ X40    : num  0.689 0.564 0.67 0.657 0.782 0.711 0.261 0.499 0.376 0.743 ...
 $ X45    : num  0.797 0.826 0.785 0.861 0.812 0.853 0.519 0.287 0.474 0.725 ...
 $ X50    : num  0.016 0 0.203 0.109 362 0.739 0.084 0.222 0.215 0.158 ...
 $ X55    : num  0.027 0.1 0.289 0.273 0.002 0.208 0.182 0.199 0.118 0.453 ...
 $ X60    : num  0 0.121 0.191 0.001 0 0 0.039 0.9 0.06 0 ...
dados2 <- dados %>% 
  pivot_longer(cols=2:8, names_to ="temp", values_to="FvFm") %>% 
  separate(Especie, c("sp", "ind"), sep="0") %>% 
  mutate(FvFm = ifelse(FvFm>1,FvFm/1000, FvFm)) %>% 
  mutate(temp = as.numeric(str_remove_all(temp, "X")))

str(dados2)
tibble [84 × 4] (S3: tbl_df/tbl/data.frame)
 $ sp  : chr [1:84] "Lig" "Lig" "Lig" "Lig" ...
 $ ind : chr [1:84] "1" "1" "1" "1" ...
 $ temp: num [1:84] 20 30 40 45 50 55 60 20 30 40 ...
 $ FvFm: num [1:84] 0.842 0.796 0.689 0.797 0.016 0.027 0 0.788 0.78 0.564 ...

Filtrar espécies

ligustrum <- dados2 %>% filter(sp=="Lig") %>% 
  group_by(temp) %>%
  summarise(FvFm = mean(FvFm))

platano <- dados2 %>% filter(sp=="Pl") %>% 
  group_by(temp) %>%
  summarise(FvFm = mean(FvFm))

amora <- dados2 %>% filter(sp=="Am") %>% 
  group_by(temp) %>%
  summarise(FvFm = mean(FvFm))

tropi <- dados2 %>% filter(sp=="Tr") %>% 
  group_by(temp) %>%
  summarise(FvFm = mean(FvFm))

Ajustar modelo logístico (curva térmica)

modelo.lig <- drm(FvFm ~ temp, data = ligustrum, fct = LL.4())
modelo.plat <- drm(FvFm ~ temp, data = platano, fct = LL.4())
modelo.amora <- drm(FvFm ~ temp, data = amora, fct = LL.4())
modelo.tropi <- drm(FvFm ~ temp, data = tropi, fct = LL.4())

Extrair T50 e T05

T50.lig <- ED(modelo.lig, 50, type = "relative", display = FALSE)
T50.lig
       Estimate Std. Error
e:1:50 47.44936   11.90219
T50.pla <- ED(modelo.plat, 50, type = "relative", display = FALSE)
T50.pla
       Estimate Std. Error
e:1:50 50.06463   1.359365
T50.amo <- ED(modelo.amora, 50, type = "relative", display = FALSE)
T50.amo
       Estimate Std. Error
e:1:50 39.79625   5.248662
T50.tro <- ED(modelo.tropi, 50, type = "relative", display = FALSE)
T50.tro
       Estimate Std. Error
e:1:50 54.87703    2.80379
#T05 <- ED(modelo, 5, type = "relative", display = FALSE)

Fazer predições para plotar

pred.lig <- data.frame(temp = seq(min(ligustrum$temp), max(ligustrum$temp), length.out = 300))
pred.lig$FvFm_pred <- predict(modelo.lig, newdata = pred.lig)

pred.pla <- data.frame(temp = seq(min(platano$temp), max(platano$temp), length.out = 300))
pred.pla$FvFm_pred <- predict(modelo.plat, newdata = pred.pla)

pred.amo <- data.frame(temp = seq(min(amora$temp), max(amora$temp), length.out = 300))
pred.amo$FvFm_pred <- predict(modelo.amora, newdata = pred.amo)

pred.tro <- data.frame(temp = seq(min(tropi$temp), max(tropi$temp), length.out = 300))
pred.tro$FvFm_pred <- predict(modelo.tropi, newdata = pred.tro)

Plotar a curva

ggplot() +
  geom_line(data = pred.lig, aes(x = temp, y = FvFm_pred), color = "#EA542F", size = 1.2) +
  geom_point(data = ligustrum, aes(x = temp, y = FvFm), color = "black", size = 2) +
  geom_vline(xintercept = T50.lig[1], linetype = 2, color = "gray60") +
  annotate("text", x = T50.lig[1]+1, y = 0.9, label = "T50", color = "gray60") +
  labs(
    title = "Curva de tolerância térmica - Ligustrum",
    x = "Temperatura (°C)",
    y = expression(F[v]/F[m])
  ) +
  theme_minimal()
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.

ggplot() +
  geom_line(data = pred.pla, aes(x = temp, y = FvFm_pred), color = "#EA542F", size = 1.2) +
  geom_point(data = platano, aes(x = temp, y = FvFm), color = "black", size = 2) +
  geom_vline(xintercept = T50.pla[1], linetype = 2, color = "gray60") +
  annotate("text", x = T50.pla[1]+1, y = 0.9, label = "T50", color = "gray60") +
  labs(
    title = "Curva de tolerância térmica - Platano",
    x = "Temperatura (°C)",
    y = expression(F[v]/F[m])
  ) +
  theme_minimal()

ggplot() +
  geom_line(data = pred.amo, aes(x = temp, y = FvFm_pred), color = "#EA542F", size = 1.2) +
  geom_point(data = amora, aes(x = temp, y = FvFm), color = "black", size = 2) +
  geom_vline(xintercept = T50.amo[1], linetype = 2, color = "gray60") +
  annotate("text", x = T50.amo[1]+1, y = 0.9, label = "T50", color = "gray60") +
  labs(
    title = "Curva de tolerância térmica - Amora",
    x = "Temperatura (°C)",
    y = expression(F[v]/F[m])
  ) +
  theme_minimal()

ggplot() +
  geom_line(data = pred.tro, aes(x = temp, y = FvFm_pred), color = "#EA542F", size = 1.2) +
  geom_point(data = tropi, aes(x = temp, y = FvFm), color = "black", size = 2) +
  geom_vline(xintercept = T50.tro[1], linetype = 2, color = "gray60") +
  annotate("text", x = T50.tro[1]+1, y = 0.9, label = "T50", color = "gray60") +
  labs(
    title = "Curva de tolerância térmica - Ligustrum",
    x = "Temperatura (°C)",
    y = expression(F[v]/F[m])
  ) +
  theme_minimal()