if(!require(pacman))
install.packages("pacman")
## Loading required package: pacman
library("pacman")
p_load("vroom","dplyr","ggplot2","tidyr")
if(!require(pacman))
install.packages("pacman")
Curvas_amplif <- vroom(file="https://raw.githubusercontent.com/ManuelLaraMVZ/resultados_PCR_practica/refs/heads/main/Amplif_grupo1_24022025.csv")
## `curl` package not installed, falling back to using `url()`
## Rows: 51 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (9): Cycle, A1, B1, C1, D1, E1, F1, G1, Manuel
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Curvas_amplif
## # A tibble: 51 × 9
## Cycle A1 B1 C1 D1 E1 F1 G1 Manuel
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 -732. -450. -50.4 -30.1 -109. -10.7 -5.87 -37.4
## 2 2 -402. -237. -20.8 15.9 -80.6 -10.4 -8.17 1.12
## 3 3 -294. -171. -14.1 11.9 -71.2 -7.35 -5.06 7.85
## 4 4 -322. -143. 8.14 13.6 -60.4 -6.83 -3.26 15.0
## 5 5 -300. -100. 12.1 5.93 -54.7 -3.67 -3.51 8.92
## 6 6 -277. -84.8 17.0 14.6 -41.4 1.04 0.0908 6.62
## 7 7 -232. -78.9 14.0 10.8 -31.2 -2.24 -2.85 -4.64
## 8 8 -197. -61.4 14.8 13.6 -23.1 3.22 4.79 -2.66
## 9 9 -143. -39.9 11.0 10.4 -13.4 4.09 2.17 -4.38
## 10 10 -95.6 -12.9 3.21 8.78 -2.80 2.80 -0.0460 28.3
## # ℹ 41 more rows
Curvas_amplif2 <- Curvas_amplif %>%
mutate(Ciclos=Cycle, PPBA=A1, ZARX=B1, FFSS=C1, LANS=D1, Negativo=E1, D2MI=F1, DR=Manuel) %>% select(-Cycle:-Manuel) %>%
filter(Ciclos >=17)
Curvas_amplif2
## # A tibble: 35 × 8
## Ciclos PPBA ZARX FFSS LANS Negativo D2MI DR
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 17 70.9 30.9 260. 71.9 50.0 5.15 3736.
## 2 18 106. 22.7 497. 143. 51.2 1.37 4655.
## 3 19 128. 40.8 880. 274. 60.5 -2.22 5483.
## 4 20 140. 36.0 1465. 481. 71.1 2.16 6232.
## 5 21 163. 36.1 2080. 773. 79.7 -2.59 6901.
## 6 22 195. 38.4 2720. 875. 85.7 3.39 7497.
## 7 23 206. 34.5 3353. 919. 90.5 0.210 8014.
## 8 24 240. 38.5 3979. 911. 97.0 1.04 8468.
## 9 25 253. 31.4 4604. 904. 97.4 0.195 8849.
## 10 26 250. 39.2 5202. 897. 98.9 2.81 9169.
## # ℹ 25 more rows
Curvas_amplif3 <- Curvas_amplif2 %>%
pivot_longer(cols= -Ciclos,
names_to = "Muestras",
values_to = "Fluorescencias")
Curvas_amplif3
## # A tibble: 245 × 3
## Ciclos Muestras Fluorescencias
## <dbl> <chr> <dbl>
## 1 17 PPBA 70.9
## 2 17 ZARX 30.9
## 3 17 FFSS 260.
## 4 17 LANS 71.9
## 5 17 Negativo 50.0
## 6 17 D2MI 5.15
## 7 17 DR 3736.
## 8 18 PPBA 106.
## 9 18 ZARX 22.7
## 10 18 FFSS 497.
## # ℹ 235 more rows
Grafica_amplif <- ggplot(data = Curvas_amplif3,
mapping = aes(x = Ciclos, y = Fluorescencias, color = Muestras)) +
geom_line (linewidth = 1.5)
Grafica_amplif
Umbral_ciclos <- 500
Grafica_amplif2 <- Grafica_amplif+
geom_hline(yintercept = Umbral_ciclos, linetype = "dashed", color = "black")+
theme_classic()+
labs(title = "Curvas de amplificación RT-qPCR",
subtitle = "Todas las muestras",
caption = "Diseñaron: Lidia, Ana Elena, Nicole y Samantha",
x = "Ciclos",
y = "Fluorescencia (u.a.)")+
theme(axis.line = element_line(size=1.2, color = "black"),
axis.title = element_text(face = "bold"),
axis.text = element_text(face = "bold"),
legend.title = element_text(face = "bold"),
legend.text = element_text(face = "bold")+
scale_x_continuous(breaks = seq(min(Curvas_amplif3$Ciclos),
max(Curvas_amplif3$Ciclos),
by = 2))+
scale_y_continuous(breaks = seq(min(Curvas_amplif3$Fluorescencias),
max(Curvas_amplif3$Fluorescencias),
by = 0.5)))
## Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
Grafica_amplif2
Grafica de los datos del equipo
Grafica_amplif_equipo <- ggplot(Curvas_amplif2,
aes(x = Ciclos,
y = LANS)) +
geom_line(linewidht = 1.2, color = "#B6F393") +
geom_hline(yintercept = Umbral_ciclos, linetype = "dashed", color = "black")+
theme_classic()+
labs(title = "Curvas de amplificación RT-qPCR",
subtitle = "Todas las muestras",
caption = "Diseñaron: Lidia, Ana Elena, Nicole y Samantha",
x = "Ciclos",
y = "Fluorescencia (u.a.)")+
theme(axis.line = element_line(size=1.2, color = "black"),
axis.title = element_text(face = "bold"),
axis.text = element_text(face = "bold"),
legend.title = element_text(face = "bold"),
legend.text = element_text(face = "bold")+
scale_x_continuous(breaks = seq(min(Curvas_amplif3$Ciclos),
max(Curvas_amplif3$Ciclos),
by = 2))+
scale_y_continuous(breaks = seq(min(Curvas_amplif2$LANS),
max(Curvas_amplif2$LANS),
by = 0.005),
labels = scales::number_format(accuracy = 0.005))) + geom_line(aes(x = Ciclos,
y = DR),
color = "#F13577",
linewidth = 1.5)
## Warning in geom_line(linewidht = 1.2, color = "#B6F393"): Ignoring unknown
## parameters: `linewidht`
Grafica_amplif_equipo