Instalar y correr la paquetería
install.packages("pacman")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
library("pacman")
p_load("readr", "dplyr", "ggplot2")
Cargar la base de datos
PCR <- read_csv(file = "https://raw.githubusercontent.com/ManuelLaraMVZ/Transcript-mica/main/datos_miRNAs.csv")
## Rows: 363 Columns: 8
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): Gen, Condicion
## dbl (6): Cx1, Cx2, Cx3, T1, T2, T3
##
## ℹ 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.
head(PCR)
Genref <- PCR %>%
filter(Condicion == "Control") %>%
select(-2) %>%
filter(Gen == "U6 snRNA-001973")
Genref
Selección de datos
Genint <- PCR %>%
filter(Condicion == "Target") %>%
select(-2)
Promedios
Meanref <- Genref %>%
mutate(Prom_Cx = (Cx1+Cx2+Cx3)/3,
Prom_Tx = (T1+T2+T3)/3) %>%
select("Gen","Prom_Cx","Prom_Tx")
Meanint <- Genint %>%
mutate(Prom_Cx = (Cx1+Cx2+Cx3)/3,
Prom_Tx = (T1+T2+T3)/3) %>%
select("Gen","Prom_Cx","Prom_Tx")
Análisis de datos
Analisis <- Meanint %>%
mutate(DCT_Cx = Meanint$Prom_Cx - Meanref$Prom_Cx,
DCT_Tx = Meanint$Prom_Tx - Meanref$Prom_Tx,
DosDCT_Cx = 2^-(DCT_Cx),
DosDCT_Tx = 2^-(DCT_Tx)) %>%
mutate(DosDDCT = DosDCT_Tx / DosDCT_Cx)
Graficar
Gráfica1 <- ggplot(Analisis,
mapping = aes (x = DosDCT_Cx,
y = DosDCT_Tx))+
geom_point(color = "#663399")+
theme_bw() +
labs(title = "Cambios de expresión de miRNAs",
subtitle = "Gráfica de dispersión",
caption = "Creado por: Regina Hernández",
x = "Condición control (2^-DCT",
y = "Tratamiento (2^-DCT)") +
geom_smooth(method = "lm",
color = "#66CDAA",
alpha = 0.005,
linewidth = 0.2)
Gráfica1
## `geom_smooth()` using formula = 'y ~ x'