Instalación de paquetes

Pacman

if (!require(pacman))
  install.packages("pacman")
## Loading required package: pacman

Llamar a pacman

library("pacman")

Llamar paqueteria necesaria

p_load("vroom",
       "dplyr", 
       "ggplot2",
       "tidyr") 

Llamar a base de datos

Curvas_amplif <- read.csv(file="https://raw.githubusercontent.com/ManuelLaraMVZ/resultados_PCR_practica/refs/heads/main/Amplif_grupo1_17022025.csv")

Curvas_amplif
##    Cycle           A1          B1           C1           D1           E1
## 1      1 -102.1907317 -96.3081705  -30.1902907 -57.49941467 -60.70614105
## 2      2  -46.9310818 -39.8228782   -0.9708719 -16.84427271 -11.98263548
## 3      3  -25.5583757 -31.7634630   -3.1014248  -2.28175061  -4.90210638
## 4      4   -9.6537446 -18.2874341   -0.3290020  -2.68985210   2.27037028
## 5      5    0.2179559  -7.1378981   -2.2617579  -1.21900399  -4.60781326
## 6      6   -4.1200219   5.1813475    2.7581364   2.04006562   1.98639373
## 7      7   -3.3182042   9.8501660    4.4008480   3.23531495   2.75839346
## 8      8    2.0966005  12.9936793   -1.2663933   1.94602903  -2.92398402
## 9      9    8.6157516   9.4079483    3.2023033  -1.28927698  -1.79712037
## 10    10   12.4403757  20.2028643    3.0438671   1.77297119   1.56428848
## 11    11    9.9557433  17.6153280    6.1969503   2.32404545   1.20458164
## 12    12   17.9484946  22.8755867    2.0694037  -1.52879714   4.39526584
## 13    13   12.5181164  18.3567800    5.3011326   2.43956708   5.18023593
## 14    14    6.6682433  12.7728940    0.4500124   7.64349134   3.25677713
## 15    15    2.0939378   9.9887802    4.6550050   1.73994484   1.30786564
## 16    16   -0.1802196   9.8204741   -7.5702679  -3.58430241  -1.31170693
## 17    17    7.0632928  12.5444920    1.2619136   4.01239941   2.77186829
## 18    18    4.7093867   4.0030464   -0.5009047   3.26181832   4.88377121
## 19    19   -3.5589267   3.1245829   -1.8555791  -6.29513306  -2.12533925
## 20    20   -9.9351195  -2.2354096   -0.3579283  -0.03929913  -0.94697063
## 21    21   -6.6875458  -5.5584681    3.5183526  -2.05197080   0.21867182
## 22    22   -3.2041238  -0.3119260   18.9619232   0.39219877   4.71023613
## 23    23   -3.0739867  -6.1582987   33.9458111  -2.39556408  -1.47163366
## 24    24   -9.6987027 -10.8476443   67.5289585   0.32401481   1.37735656
## 25    25   -1.4054760  -5.9561518  127.4542281  -2.34594786   2.71372407
## 26    26   12.4104578 -13.3668525  221.3191223  -5.75100321  -0.16852097
## 27    27   28.8272636 -10.5379608  384.0598114  -0.74468608   4.04724411
## 28    28   51.7633221 -17.2264952  604.1772408  -2.03397200   0.62550835
## 29    29  107.0371177 -16.1058282  937.1844041  -4.19029658   0.05585417
## 30    30  175.0723566 -14.2100701 1300.9627690  -1.06317293   0.55225512
## 31    31  254.9117418 -16.4292126 1693.2558650   1.34061896   4.50392670
## 32    32  341.0221327 -17.1626757 2082.1712100  -3.89149093  -2.12430912
## 33    33  422.8813741 -16.8973405 2436.2403920   6.91191251   7.55855541
## 34    34  501.2969432  -8.8108532 2741.7315320   4.54584019   5.76724255
## 35    35  577.4695817 -10.6879285 2987.7350040   1.63924755   4.05515283
## 36    36  645.5579892   0.3953255 3181.2565000   0.70439179  -1.81132167
## 37    37  711.8411723   5.9182563 3319.9389250   1.97866236  -2.52584813
## 38    38  776.1173738  19.5133048 3415.8446320  -1.41346668   0.38923702
## 39    39  830.9472846  31.5957306 3480.4793890  -0.11334348  -1.74474513
## 40    40  876.9882770  49.1854981 3532.1886440   2.18552045  -7.65101614
##              F1
## 1   -99.9848412
## 2   -34.5095126
## 3    -3.9208442
## 4     6.5844774
## 5     2.0260084
## 6     2.5273379
## 7     3.7259568
## 8     1.9276218
## 9    -3.5637369
## 10   -4.3901594
## 11   -5.3471192
## 12    0.6096033
## 13   -2.6613016
## 14    3.5981455
## 15    6.7288285
## 16    8.1903638
## 17   22.0082364
## 18   32.8812959
## 19   58.9094665
## 20   99.3309629
## 21  149.4668993
## 22  216.6777226
## 23  289.0930188
## 24  392.2929432
## 25  503.2401201
## 26  622.9500377
## 27  752.8598744
## 28  886.1609583
## 29 1021.7269930
## 30 1153.3672430
## 31 1277.4935700
## 32 1387.6471200
## 33 1490.1376470
## 34 1578.7734480
## 35 1655.6102750
## 36 1716.1079160
## 37 1759.5529710
## 38 1792.8986840
## 39 1813.5905920
## 40 1831.6050460

Modificar base de datos

Curvas_amplif2 <- Curvas_amplif %>%  
  mutate(Ciclos = Cycle, PPDA = A1, ZAXR =B1, FSS = C1, LANS = D1, Negativo = E1, DDMI= F1) %>% 
  select(-1:-7)
Curvas_amplif2
##    Ciclos         PPDA        ZAXR          FSS         LANS     Negativo
## 1       1 -102.1907317 -96.3081705  -30.1902907 -57.49941467 -60.70614105
## 2       2  -46.9310818 -39.8228782   -0.9708719 -16.84427271 -11.98263548
## 3       3  -25.5583757 -31.7634630   -3.1014248  -2.28175061  -4.90210638
## 4       4   -9.6537446 -18.2874341   -0.3290020  -2.68985210   2.27037028
## 5       5    0.2179559  -7.1378981   -2.2617579  -1.21900399  -4.60781326
## 6       6   -4.1200219   5.1813475    2.7581364   2.04006562   1.98639373
## 7       7   -3.3182042   9.8501660    4.4008480   3.23531495   2.75839346
## 8       8    2.0966005  12.9936793   -1.2663933   1.94602903  -2.92398402
## 9       9    8.6157516   9.4079483    3.2023033  -1.28927698  -1.79712037
## 10     10   12.4403757  20.2028643    3.0438671   1.77297119   1.56428848
## 11     11    9.9557433  17.6153280    6.1969503   2.32404545   1.20458164
## 12     12   17.9484946  22.8755867    2.0694037  -1.52879714   4.39526584
## 13     13   12.5181164  18.3567800    5.3011326   2.43956708   5.18023593
## 14     14    6.6682433  12.7728940    0.4500124   7.64349134   3.25677713
## 15     15    2.0939378   9.9887802    4.6550050   1.73994484   1.30786564
## 16     16   -0.1802196   9.8204741   -7.5702679  -3.58430241  -1.31170693
## 17     17    7.0632928  12.5444920    1.2619136   4.01239941   2.77186829
## 18     18    4.7093867   4.0030464   -0.5009047   3.26181832   4.88377121
## 19     19   -3.5589267   3.1245829   -1.8555791  -6.29513306  -2.12533925
## 20     20   -9.9351195  -2.2354096   -0.3579283  -0.03929913  -0.94697063
## 21     21   -6.6875458  -5.5584681    3.5183526  -2.05197080   0.21867182
## 22     22   -3.2041238  -0.3119260   18.9619232   0.39219877   4.71023613
## 23     23   -3.0739867  -6.1582987   33.9458111  -2.39556408  -1.47163366
## 24     24   -9.6987027 -10.8476443   67.5289585   0.32401481   1.37735656
## 25     25   -1.4054760  -5.9561518  127.4542281  -2.34594786   2.71372407
## 26     26   12.4104578 -13.3668525  221.3191223  -5.75100321  -0.16852097
## 27     27   28.8272636 -10.5379608  384.0598114  -0.74468608   4.04724411
## 28     28   51.7633221 -17.2264952  604.1772408  -2.03397200   0.62550835
## 29     29  107.0371177 -16.1058282  937.1844041  -4.19029658   0.05585417
## 30     30  175.0723566 -14.2100701 1300.9627690  -1.06317293   0.55225512
## 31     31  254.9117418 -16.4292126 1693.2558650   1.34061896   4.50392670
## 32     32  341.0221327 -17.1626757 2082.1712100  -3.89149093  -2.12430912
## 33     33  422.8813741 -16.8973405 2436.2403920   6.91191251   7.55855541
## 34     34  501.2969432  -8.8108532 2741.7315320   4.54584019   5.76724255
## 35     35  577.4695817 -10.6879285 2987.7350040   1.63924755   4.05515283
## 36     36  645.5579892   0.3953255 3181.2565000   0.70439179  -1.81132167
## 37     37  711.8411723   5.9182563 3319.9389250   1.97866236  -2.52584813
## 38     38  776.1173738  19.5133048 3415.8446320  -1.41346668   0.38923702
## 39     39  830.9472846  31.5957306 3480.4793890  -0.11334348  -1.74474513
## 40     40  876.9882770  49.1854981 3532.1886440   2.18552045  -7.65101614
##            DDMI
## 1   -99.9848412
## 2   -34.5095126
## 3    -3.9208442
## 4     6.5844774
## 5     2.0260084
## 6     2.5273379
## 7     3.7259568
## 8     1.9276218
## 9    -3.5637369
## 10   -4.3901594
## 11   -5.3471192
## 12    0.6096033
## 13   -2.6613016
## 14    3.5981455
## 15    6.7288285
## 16    8.1903638
## 17   22.0082364
## 18   32.8812959
## 19   58.9094665
## 20   99.3309629
## 21  149.4668993
## 22  216.6777226
## 23  289.0930188
## 24  392.2929432
## 25  503.2401201
## 26  622.9500377
## 27  752.8598744
## 28  886.1609583
## 29 1021.7269930
## 30 1153.3672430
## 31 1277.4935700
## 32 1387.6471200
## 33 1490.1376470
## 34 1578.7734480
## 35 1655.6102750
## 36 1716.1079160
## 37 1759.5529710
## 38 1792.8986840
## 39 1813.5905920
## 40 1831.6050460

Reordenamiento de datos

  1. Selecciónar los datos a reordenar (Variables dependientes ).
  2. Agrupare todas las variables por nombre
  3. Agrupare todas las variable por ciclo
Curvas_amplif3 <- Curvas_amplif2 %>% 
  pivot_longer(cols = -Ciclos,
               names_to = "Muestras",
               values_to = "Flourescencias")
Curvas_amplif3
## # A tibble: 240 × 3
##    Ciclos Muestras Flourescencias
##     <int> <chr>             <dbl>
##  1      1 PPDA           -102.   
##  2      1 ZAXR            -96.3  
##  3      1 FSS             -30.2  
##  4      1 LANS            -57.5  
##  5      1 Negativo        -60.7  
##  6      1 DDMI           -100.   
##  7      2 PPDA            -46.9  
##  8      2 ZAXR            -39.8  
##  9      2 FSS              -0.971
## 10      2 LANS            -16.8  
## # ℹ 230 more rows

Grafica

Grafica_amplif <- ggplot(data = Curvas_amplif3,
                         mapping = aes (x =Ciclos, 
                                       y = Flourescencias,
                                       color = Muestras)) +
  geom_line(size =1.5)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
Grafica_amplif