Expresión diferencial RNA-seq: G1E vs MK

Code
library(tidyverse)
library(RColorBrewer)
library(pheatmap)
library(factoextra)
library(kableExtra)
library(plotly)

library(DESeq2)
library(PoiClaClu)
library(vsn)
library(Glimma)
library(EnhancedVolcano)

Este flujo de trabajo está basado y es un complemento del Tutorial de Análisis de Expresión Diferencial en Galaxy de la Dra. Alejandra Rougon Cardozo, para llevar a cabo el DESeq con R.

También está basado en:

Analyzing RNA-seq data with DESeq2 de Michael I. Love, Simon Anders y Wolfgang Huber.

RNA-seq workflow: gene-level exploratory analysis and differential expression de Michael I.Love, Simon Anders, Vladislav Kim y Wolfgang Huber.

Panorama general de análisis de datos de RNA-seq con R de la Red Mexicana de Bioinformática.

Importar datos

Se cargan los archivos con las cuentas crudas y se crea una tabla que indica la línea celular de cada muestra.

Code
# Se leen los archivos

G1E_rep1 <- read.table("./data/G1E_rep1.tabular", header = TRUE, sep="\t")
G1E_rep2 <- read.table("./data/G1E_rep2.tabular", header = TRUE, sep="\t")
MK_rep1 <- read.table("./data/MK_rep1.tabular", header = TRUE, sep="\t")
MK_rep2 <- read.table("./data/MK_rep2.tabular", header = TRUE, sep="\t")

# Se unen con left_join

countdata_df <- left_join(G1E_rep1, G1E_rep2) |> left_join(MK_rep1) |> 
                left_join(MK_rep2)

# Se transforma en una matriz

countdata <- as.matrix(dplyr::select(countdata_df, -Geneid))
row.names(countdata) <- countdata_df$Geneid

# Es necesario que la columna que contiene los nombres de las muestras se llame "names"

coldata <- data.frame(names = factor(colnames(countdata)),
                      cell = factor(c("G1E", "G1E", "MK", "MK")))
row.names(coldata) <- coldata$names

Matriz de conteos

En este caso, como son pocos transcritos se muestra la matriz.

Code
kable(countdata, align = "c") %>% kable_styling(c("striped", "hover"), full_width = F)%>% scroll_box(width="100%", height="300px", fixed_thead = TRUE)
G1E_rep1 G1E_rep2 MK_rep1 MK_rep2
NM_001024952 9 8 0 1
NM_080844 0 0 0 0
MSTRG.7.1 7 22 27 0
MSTRG.8.1 8 10 40 0
MSTRG.1.1 10 8 4 0
MSTRG.9.1 18 6 0 0
MSTRG.26.1 4 51 0 0
MSTRG.27.1 18 41 5 0
NR_002840 9 22 15 0
NR_028543 0 0 0 0
MSTRG.20.2 0 0 0 0
MSTRG.20.1 6 11 0 0
NR_131029 0 0 0 0
NR_131030 0 0 0 0
NR_131028 0 0 0 0
NM_001159930 0 0 0 0
MSTRG.22.1 112 334 119 3
MSTRG.23.1 245 400 119 0
MSTRG.31.1 19 15 0 0
MSTRG.32.1 213 291 48 5
MSTRG.32.2 0 0 0 0
MSTRG.33.1 70 139 15 0
MSTRG.34.1 61 101 79 1
NM_173424 1 0 0 0
MSTRG.28.1 1 3 0 0
MSTRG.28.2 0 0 0 0
MSTRG.28.3 0 5 0 0
NM_172644 4 5 0 0
MSTRG.3.1 671 939 173 3
MSTRG.4.1 3 7 0 0
MSTRG.5.1 3 18 14 0
NM_001039482 4 1 10 0
MSTRG.24.1 0 0 0 7
NM_199028 7 2 1 0
MSTRG.11.1 375 607 531 6
NM_009846 87 126 0 0
NR_033558 0 0 0 0
MSTRG.14.1 105 154 29 1
MSTRG.14.2 1405 1564 210 1
MSTRG.16.1 225 286 45 0
MSTRG.17.1 166 182 265 5
MSTRG.18.1 111 126 55 0
MSTRG.6.1 104 56 119 18
NM_026411 2 0 16 0
MSTRG.12.1 22681 31970 79 6
MSTRG.37.1 2 13 0 0
MSTRG.39.1 269 490 3 0
NM_030093 5 1 0 2
MSTRG.41.2 0 0 0 0
MSTRG.41.1 2 1 9 0
MSTRG.41.3 0 1 1 0
MSTRG.42.1 0 1 1 0
MSTRG.42.2 0 0 0 0
MSTRG.43.1 0 0 8 0
MSTRG.43.2 0 0 0 0
NM_010822 2 14 3 0
MSTRG.46.1 5053 6558 808 149
NM_010405 0 0 0 0
NM_001083955 28 21 54 4
NM_001033981 4 1 0 0
NM_175000 0 0 0 0
NM_177364 0 0 0 0
NM_172799 0 0 0 1
MSTRG.47.1 19 17 0 0
NM_008267 25 13 0 0
MSTRG.59.3 61 113 0 0
MSTRG.59.4 0 0 0 0
MSTRG.59.1 18 21 0 0
MSTRG.59.2 0 0 0 0
NR_108029 68 127 0 0
NR_037977 0 0 0 0
NR_029721 0 0 0 0
NM_008270 0 0 0 0
NM_010461 0 1 0 0
NM_010460 1 0 0 0
MSTRG.62.1 0 0 0 0
MSTRG.62.2 0 0 0 0
MSTRG.62.3 3 2 0 0
NM_008374 0 0 0 0
NM_001134458 0 0 0 0
MSTRG.36.1 1857 2110 1375 19
NM_010117 0 0 0 0
NM_001291818 0 0 0 0
MSTRG.45.1 0 0 0 0
MSTRG.45.2 2 1 0 0
NR_104306 0 0 0 0
NM_181569 0 0 0 0
NM_001284360 0 0 0 0
NM_001284359 0 0 0 0
MSTRG.52.1 1 0 0 0
MSTRG.52.5 0 0 0 0
MSTRG.52.3 3 5 6 1
MSTRG.52.2 0 0 0 0
MSTRG.52.4 273 417 165 64
MSTRG.52.7 0 1 0 1
MSTRG.52.6 0 2 0 0
NM_001271018 0 0 0 0
MSTRG.48.1 11092 14273 2 1
MSTRG.50.1 71 98 0 0
MSTRG.60.1 502 690 2 0
MSTRG.55.1 171 186 2 0
MSTRG.56.1 394 1195 567 22
MSTRG.58.1 18 9 0 0
NR_131758 2 1 0 0
MSTRG.63.1 6 13 0 0
NM_001177354 77 50 16 7
NR_003368 0 0 0 0
NR_132747 0 0 0 0
NR_132746 0 0 0 0
MSTRG.68.1 1 7 46 0
MSTRG.69.1 5 11 132 2
MSTRG.70.1 11 44 2 0
MSTRG.71.1 99 205 279 3
NM_010463 0 0 0 0
NM_001024842 1 0 0 0
NM_010462 0 0 0 0
NR_029722 0 0 0 0
MSTRG.77.1 154 174 0 0
NM_008272 9 8 0 0
MSTRG.78.2 140 151 0 0
NM_010466 17 10 0 0
MSTRG.81.1 7 12 0 0
NM_010465 24 55 0 0
MSTRG.80.1 11 12 0 0
NM_175730 20 19 0 0
NR_030526 21 32 0 0
MSTRG.89.1 6 17 0 0
NM_013553 68 104 0 0
MSTRG.92.1 39 97 17 0
MSTRG.65.3 0 0 0 0
MSTRG.65.2 0 0 0 0
MSTRG.65.1 0 0 0 0
MSTRG.66.1 4 11 48 2
NR_047528 0 0 0 0
MSTRG.73.1 8 20 5 0
MSTRG.79.1 1793 1751 2 4
MSTRG.74.1 1 7 0 0
MSTRG.75.1 1516 1618 4 1
MSTRG.82.2 0 2 0 0
MSTRG.82.1 0 0 0 0
MSTRG.82.3 0 0 0 0
MSTRG.82.5 0 0 0 0
MSTRG.82.4 5 0 0 0
MSTRG.82.6 0 0 0 0
MSTRG.87.1 1980 2517 0 0
MSTRG.88.1 44 159 0 0
MSTRG.90.1 21 66 0 0
MSTRG.85.1 100 218 1 0
MSTRG.84.1 82 99 0 0
MSTRG.91.1 89 231 0 1
MSTRG.95.1 758 963 1 1
MSTRG.97.1 8 7 0 0
MSTRG.97.2 217 284 0 0
MSTRG.93.1 132 85 6 1
NR_045743 0 4 0 0
MSTRG.94.1 46 95 39 0
NM_007757 634 495 17 2
NM_171826 0 0 0 0
NM_001252451 0 0 0 0
NM_001252450 0 0 0 0
NM_172469 0 0 0 0
MSTRG.108.1 142 246 1347 15
MSTRG.110.1 249 199 659 49
MSTRG.111.1 24 36 56 2
MSTRG.112.1 41 98 41 2
MSTRG.113.1 20066 23364 27300 3946
MSTRG.104.1 1 0 170 21
NM_001271687 0 0 0 0
NM_001271690 0 0 0 0
NM_001271692 0 0 0 0
NM_001271694 0 0 0 0
NM_019664 0 0 0 0
NM_001271695 0 0 0 0
NM_001271693 0 0 0 0
NM_001271691 0 0 0 0
NM_001271689 0 0 0 0
NM_001039057 0 0 0 0
NM_001039056 0 0 0 0
MSTRG.106.1 181 251 246 0
MSTRG.107.1 9 23 40 1
MSTRG.98.1 0 0 1 0
MSTRG.99.1 0 0 2 0
NM_001033404 1 0 0 0
NM_175011 0 0 0 0
MSTRG.100.1 68667 77846 2722 86
NM_001162955 0 0 0 0
MSTRG.103.1 226 358 80 8
NM_147001 0 0 0 0
NM_009821 0 0 0 0
NM_001111023 0 0 0 0
NM_001111022 0 0 0 0
NM_001111021 0 0 0 0
NM_001302154 0 0 0 0
NM_001302153 0 0 0 0
NM_133659 0 0 0 0
NM_001302183 0 0 0 0
NM_001302179 0 0 0 0
NM_001302152 0 0 0 0
MSTRG.115.1 1 6 70 0
NM_178652 0 0 0 0
NM_001271631 0 0 0 0
NM_001271630 0 0 0 0
NM_001145920 0 0 0 0
NM_009820 0 0 0 0
NM_001271627 0 0 0 0
NM_001146038 0 0 0 0
MSTRG.116.1 445 449 236 6
NM_029257 1 0 0 0
NM_010721 38 32 10 3
MSTRG.122.1 31 40 19 0
MSTRG.122.2 10 31 2 0
MSTRG.124.1 305 247 42 6
MSTRG.124.2 0 0 0 0
MSTRG.126.1 851 1401 208 15
NM_177115 0 4 0 0
MSTRG.119.1 27 58 39 1
MSTRG.120.1 5 4 1 1
MSTRG.123.1 2 22 2 0
NM_008275 0 0 2 0
NM_008274 0 0 0 0
NR_073086 0 0 0 1
NM_008273 0 0 0 0
NM_013554 0 0 0 1
NM_013555 0 0 0 0
MSTRG.129.1 16 15 0 0
MSTRG.129.2 4 2 0 0
NM_010468 0 0 0 0
NM_001290731 7 4 0 0
NM_008276 0 0 0 0
NM_001290730 0 0 0 0
NM_010469 0 2 0 0
NR_029566 0 0 0 0
NR_110447 0 0 0 0
NM_010467 0 0 0 0
NM_001077514 0 0 0 0
NM_011393 0 0 0 0
NM_001077515 0 0 0 0
MSTRG.128.1 0 0 0 5
MSTRG.137.1 229 467 1266 19
MSTRG.138.1 396 729 750 25
MSTRG.140.1 5 18 1 0
MSTRG.139.1 3 5 4 1
NM_007967 0 0 6 3
NR_027899 0 0 0 0
MSTRG.131.2 13 11 0 0
MSTRG.131.3 113 163 0 0
MSTRG.134.1 987 952 0 0
MSTRG.135.1 13 14 0 0
NR_110445 1 0 0 0
NM_001177785 0 0 0 0
NM_001177787 0 0 0 0
NM_009851 0 0 0 0
NM_001177786 0 0 0 0
NM_001039151 0 0 0 0
NM_001039150 0 0 0 0
NM_001111026 0 0 0 0
NM_001111027 0 0 0 0
NM_009822 0 0 0 0
MSTRG.142.1 909 1635 552 1
MSTRG.142.2 1 0 0 0
MSTRG.142.3 0 0 0 0
NM_001304555 0 0 0 0
NM_009185 0 0 0 0
NM_001304559 0 0 0 0
NM_001304553 0 0 0 0
NM_001304551 0 0 0 0
NM_011527 14 18 26 11
MSTRG.150.2 47 69 68 8
NM_001287388 0 0 0 0
MSTRG.152.1 1 2 0 0
NM_026018 0 0 0 0
NM_001164558 0 0 0 0
NM_001164557 0 0 0 0
NR_131922 2 0 57 0
NM_025647 17 36 14 0
MSTRG.144.1 340 635 18 0
MSTRG.145.1 13 14 1 0
MSTRG.146.1 373 493 100 0
MSTRG.151.1 42554 41020 7676 617
MSTRG.153.1 1008 1529 393 12
MSTRG.154.1 2865 2689 820 17
MSTRG.149.2 0 0 0 0
MSTRG.149.1 0 1 2 0
NM_001003947 0 0 1 0
MSTRG.155.1 0 0 0 0
MSTRG.155.3 0 0 0 0
NM_009141 2 2 48 0
NM_023785 0 0 194 4
NM_019932 1 3 505 3
NM_203320 3 1 0 0
NM_011339 0 0 8 0
MSTRG.162.1 0 0 0 6
MSTRG.166.1 1721 3043 2152 55
NM_031408 264 230 164 5
MSTRG.169.1 34298 39464 18665 1336
NM_031404 4 7 0 0
NM_015799 0 0 0 0
NM_001289509 0 0 0 0
NM_001289511 0 0 0 0
NM_001289507 0 2 0 0
MSTRG.179.1 2195 2118 40 2
MSTRG.172.1 11 17 12 0
MSTRG.175.1 54 47 17 0
MSTRG.176.1 29 63 59 2
MSTRG.183.1 357 459 171 8
MSTRG.181.1 93 140 3 2
MSTRG.182.1 677 620 114 23
MSTRG.187.1 228 363 43 2
MSTRG.187.3 1 2 0 0
MSTRG.187.2 0 0 0 0
MSTRG.187.4 1 5 0 0
MSTRG.187.5 17 25 1 0
MSTRG.184.1 3 1 29 0
MSTRG.189.1 1 9 27 1
MSTRG.191.1 8218 37329 101935 754
MSTRG.192.1 85704 188296 253635 11114
NM_007984 1 0 0 0
MSTRG.197.1 1644 1591 1460 147
MSTRG.198.1 4480 6473 1174 93
NR_040686 0 0 0 0
NR_040429 0 0 6 0
MSTRG.201.1 8 36 31 0
MSTRG.202.1 22 79 47 0
MSTRG.203.1 16249 22268 6590 13
MSTRG.147.1 0 0 43 0
MSTRG.157.1 0 0 0 0
MSTRG.157.2 28 37 19266 468
MSTRG.161.1 73 160 63261 856
MSTRG.163.1 18 42 800 41
NM_011741 1 1 0 2
NM_007942 0 0 0 0
NM_001312875 0 0 0 0
NM_028753 15 13 7 0
MSTRG.167.2 111 86 0 0
MSTRG.167.1 0 0 0 0
MSTRG.167.3 0 0 0 0
NM_010312 41 18 2 7
NR_105846 0 0 0 0
MSTRG.186.1 31 54 0 1
MSTRG.186.2 1 4 0 0
MSTRG.186.3 0 0 0 0
NM_001122730 0 0 0 0
NM_178242 0 0 0 0
MSTRG.180.1 3 7 0 0
MSTRG.171.1 156 133 38 1
MSTRG.173.1 10 20 5 0
MSTRG.174.1 11 13 1 0
MSTRG.177.1 0 0 0 6
NM_001033312 1 0 0 9
NM_007393 121 133 486 7
MSTRG.194.1 1 0 31 0
MSTRG.195.1 1 0 97 16
NM_207110 0 0 0 0
NM_080561 0 0 0 0
NR_102383 0 0 0 0
NR_102384 0 0 0 0
NM_001313894 0 0 1 6
NM_010439 1 2 0 0
NR_015478 0 0 0 0
NM_133933 11 6 3 0
MSTRG.199.1 1 8 0 0
MSTRG.204.1 26 35 0 0
MSTRG.208.1 4 14 0 0
MSTRG.209.1 21 28 0 0
MSTRG.210.1 15 24 0 9
MSTRG.211.1 14 18 3 0
MSTRG.212.1 21 37 0 0
MSTRG.213.1 21 32 1 1
MSTRG.214.1 326 376 0 0
MSTRG.215.1 378 702 18 1
MSTRG.215.2 11 15 15 0
MSTRG.215.3 3 11 0 0
NM_008090 316 224 17 2
NM_019964 2 0 0 0
MSTRG.223.1 2633 3146 728 14
MSTRG.206.1 1795 2847 3755 41
NR_105795 0 6 0 0
MSTRG.216.1 65 48 0 0
MSTRG.221.1 233983 233798 13104 1015
NM_023060 4 0 1 0
MSTRG.217.1 7 0 0 0
MSTRG.219.1 3 12 2 0
MSTRG.229.2 58 49 32 1
MSTRG.229.1 4674 7074 15880 994
MSTRG.225.1 2 0 0 0
MSTRG.227.1 2 5 73 5
MSTRG.231.1 0 0 0 0
MSTRG.231.2 0 0 0 0
NM_013616 0 0 0 0
NM_147119 0 0 0 0
MSTRG.218.1 83 599 162 0
NM_146821 0 0 0 0
NM_147098 0 0 0 0
NM_013621 0 0 0 0
NM_013620 0 0 0 0
NM_013619 0 0 0 0
NM_016956 2 0 15 0
NM_001278161 11 8 17 7
NM_001127686 0 0 0 0
NM_008219 0 0 0 0
NM_008221 0 0 1 0
NM_013618 0 0 0 0
NM_013617 1 0 0 0
MSTRG.234.1 20 36 32 2
MSTRG.235.1 45 71 21 0
MSTRG.232.1 7 12 13 0
MSTRG.237.1 154 292 15 0
MSTRG.238.1 168 241 30 0
MSTRG.239.1 43 55 0 0
MSTRG.240.1 0 2 0 0
NM_133224 22 15 15 0
NM_198101 19 15 0 0
NM_020028 1 2 0 0
NM_001024954 0 0 0 0
MSTRG.242.1 4 0 31 1
MSTRG.248.1 0 0 0 0
MSTRG.248.2 9 13 9 2
MSTRG.255.1 7627 12787 8783 73
NM_032004 33 19 274 23
MSTRG.258.1 12 8 8 3
MSTRG.258.3 0 0 0 0
MSTRG.258.2 0 0 0 0
MSTRG.258.4 0 0 0 0
MSTRG.259.1 23 57 0 0
MSTRG.263.1 1434 1415 14 4
NM_026014 59 54 0 2
MSTRG.270.1 7639 18610 9063 381
MSTRG.272.1 3 2 0 0
MSTRG.272.2 44 64 100 10
MSTRG.273.2 0 0 0 0
MSTRG.273.1 0 0 0 0
NM_021502 5 2 0 0
MSTRG.276.1 0 1 57 0
MSTRG.280.1 1115 1680 2242 207
MSTRG.280.2 6 7 0 0
MSTRG.280.3 0 0 0 0
MSTRG.278.1 3 14 0 0
NM_144932 0 0 0 0
NM_001200023 7 0 0 0
NM_177899 4 1 0 3
MSTRG.244.1 704 576 118 22
MSTRG.244.3 1 6 0 0
MSTRG.244.2 0 0 0 0
MSTRG.244.4 0 0 0 0
MSTRG.245.1 203 642 197 9
MSTRG.249.2 1 6 0 0
MSTRG.249.1 0 0 0 0
MSTRG.249.3 15 24 1 0
MSTRG.251.2 0 0 0 0
MSTRG.251.1 2 5 1 0
MSTRG.253.1 30 47 14 0
MSTRG.246.1 108 84 5 1
MSTRG.246.2 7 11 5 0
NM_026818 0 0 9 1
NM_023312 9 18 44 0
NM_001113346 0 0 0 0
NM_145596 0 0 0 0
NM_001286450 0 0 0 0
NM_001037298 23 13 143 13
MSTRG.264.1 0 4 29 0
MSTRG.265.1 0 2 26 0
MSTRG.260.1 0 0 8 0
MSTRG.261.1 0 6 5 0
MSTRG.266.1 38325 39909 2392 156
MSTRG.268.1 31413 32063 3343 337
NM_009698 1 3 0 0
MSTRG.269.1 0 8 0 0
NM_016722 0 0 0 0
NM_001193645 0 0 0 0
MSTRG.275.1 45 85 86 0
NM_001007462 0 1 0 2
NR_105821 0 0 0 0
NM_177289 0 0 0 0
NM_001109873 0 0 0 0
NM_009824 8 2 2 0
MSTRG.277.1 6 6 14 0
MSTRG.282.1 12 17 79 0
MSTRG.283.1 109 175 136 0
MSTRG.284.3 0 0 0 0
MSTRG.284.2 0 0 0 0
MSTRG.284.1 0 0 0 0
MSTRG.288.3 0 0 0 0
MSTRG.288.2 0 0 0 0
MSTRG.288.1 0 0 0 0
NM_025977 0 0 0 0
NM_001164614 0 0 0 0
NM_001290299 0 0 0 0
NM_144935 0 0 0 0
NM_025870 101 102 85 0
MSTRG.294.1 12420 16940 11883 715
MSTRG.296.1 0 0 69 0
NM_008925 0 0 0 0
NM_001293651 0 0 0 0
NM_001293650 0 0 0 0
MSTRG.306.2 0 0 0 0
MSTRG.306.1 0 0 0 0
MSTRG.306.3 0 0 0 0
MSTRG.301.1 0 0 41 0
MSTRG.302.1 0 0 77 0
NM_019659 0 0 0 0
NM_001168354 0 0 0 0
MSTRG.308.1 3 15 133 12
MSTRG.309.1 287 420 5268 111
MSTRG.310.1 1 0 0 11
MSTRG.311.1 207 407 2999 46
MSTRG.313.1 2 0 65 0
MSTRG.314.1 2 4 178 9
NM_031874 1 0 5 1
NM_001253869 0 0 0 0
NM_178577 0 0 0 0
NR_045606 0 0 0 2
NM_001253870 0 0 0 0
NM_001253868 0 0 0 0
NM_001253867 0 0 0 0
MSTRG.290.1 0 4 0 0
MSTRG.291.1 15 3 0 1
MSTRG.292.1 7 12 20 9
MSTRG.298.1 0 1 0 0
MSTRG.298.4 0 0 0 0
MSTRG.298.3 0 0 0 0
MSTRG.298.2 0 0 0 0
MSTRG.299.1 322 295 148 6
NR_132099 0 0 0 0
MSTRG.285.1 110 143 16 0
MSTRG.287.1 62 83 54 3
NM_010149 15 16 43 0
NM_023622 0 0 1 0
NM_029939 0 0 0 0
NM_001163787 0 0 0 0
MSTRG.304.1 0 0 0 0
MSTRG.304.2 0 0 0 0
MSTRG.304.3 0 0 0 0
MSTRG.304.4 0 0 0 0
NM_010487 0 1 0 2
NM_177318 0 0 0 0
NM_001310759 0 0 0 0
NR_030448 0 0 0 0
NM_010605 0 0 0 0
NM_008026 5 8 23 7
MSTRG.312.1 6 15 500 49
NM_138604 0 0 0 0
NM_001290536 0 0 0 0
NM_001290537 0 0 0 0
NM_138606 4 3 6 0
NM_001083937 0 0 0 0
NM_078484 0 0 0 0
MSTRG.328.1 9891 11411 9337 283
MSTRG.329.1 51 144 12 0
NR_132589 0 0 0 0
NM_011591 0 0 0 0
NM_001313693 0 0 0 0
NM_013892 0 0 1 0
MSTRG.333.1 359 639 105 48
MSTRG.334.1 43 99 16 0
MSTRG.335.1 102 191 0 0
MSTRG.335.2 0 0 0 0
MSTRG.340.1 5064 6160 16401 3518
MSTRG.338.1 1 5 12 0
MSTRG.343.1 30 22 3 0
MSTRG.343.2 0 0 0 0
NR_131207 1 0 0 0
MSTRG.353.1 2 4 0 0
MSTRG.353.2 7 4 4 0
MSTRG.355.1 159 421 106 1
MSTRG.356.1 220 251 89 15
MSTRG.356.2 2 5 0 0
MSTRG.356.4 0 1 0 0
MSTRG.356.3 0 0 0 0
MSTRG.356.5 22 59 4 0
MSTRG.356.7 0 0 0 0
MSTRG.356.6 5 8 0 0
MSTRG.356.10 0 0 0 0
MSTRG.356.12 0 0 0 0
MSTRG.356.8 21 31 0 0
MSTRG.356.9 0 0 0 0
MSTRG.356.11 0 0 0 0
MSTRG.356.13 0 0 0 0
MSTRG.356.15 0 0 0 0
MSTRG.356.14 0 0 0 0
NM_009767 0 0 0 0
NM_009440 0 0 0 0
NR_002844 1 7 145 0
MSTRG.347.1 0 2 618 3
MSTRG.348.1 0 0 52 0
MSTRG.349.1 1 1 89 0
MSTRG.350.1 0 2 155 10
NR_015508 0 0 0 2
NR_033398 4 0 0 0
NR_037298 0 0 0 0
MSTRG.316.1 9047 11590 7512 644
MSTRG.317.1 25 39 3 0
MSTRG.318.3 0 0 0 0
MSTRG.318.2 0 0 0 0
MSTRG.318.1 16 16 82 1
MSTRG.320.1 25 27 286 13
MSTRG.325.1 1121 1148 639 36
MSTRG.325.2 55 93 88 2
MSTRG.325.3 0 0 0 0
NM_019478 0 0 0 0
NM_001252528 0 0 0 0
NM_001252529 0 0 0 0
MSTRG.331.1 9107 11549 7682 576
MSTRG.322.1 0 0 52 6
MSTRG.323.1 0 0 83 9
NM_181548 0 0 0 0
NM_010413 0 0 0 0
NM_001130416 0 0 0 0
NM_008089 13 14 15 3
MSTRG.341.1 20 39 19 1
MSTRG.336.1 10 14 6 0
NM_027227 0 2 0 0
NM_001290716 0 0 0 0
NM_011514 0 0 0 0
MSTRG.352.1 9 18 0 0
NR_015505 9 8 0 0
MSTRG.346.2 0 0 0 0
MSTRG.346.1 1 2 0 0
NR_001570 0 0 0 0
NR_001463 0 5 0 0
MSTRG.344.1 29 95 0 0
MSTRG.357.1 5 12 1 0
MSTRG.361.1 17 7 79 5
MSTRG.362.1 0 1 23 0
MSTRG.358.1 0 0 33 0
MSTRG.359.1 0 0 27 0
NR_028381 0 0 1 0
NR_028380 0 0 0 0
NR_030558 0 0 0 0
NR_030418 0 0 0 0

Información de la condición experimental

Code
kable(coldata, align = "c") %>% kable_styling(c("striped", "hover"), full_width = F)%>% scroll_box(width="50%", height="200px", fixed_thead = TRUE)
names cell
G1E_rep1 G1E_rep1 G1E
G1E_rep2 G1E_rep2 G1E
MK_rep1 MK_rep1 MK
MK_rep2 MK_rep2 MK

DESeqDataSet

Con la matriz de conteos y la tabla con la información de la condición experimental (en este caso línea celular) se crea un objeto de la clase DESeqDataSet, el cual tiene una fórmula de diseño asociada. La formula de diseño indica qué columnas de la tabla de información de las muestras especifican el diseño experimental y cómo se deben utilizar estos factores en el análisis. Aquí se usa la formula design = ~ cell. A continuación se muestra la información del objeto generado.

Code
dds <- DESeqDataSetFromMatrix(countData = countdata,
                              colData = coldata,
                              design = ~ cell)

dds$cell <- relevel(dds$cell, "MK")
dds
class: DESeqDataSet 
dim: 629 4 
metadata(1): version
assays(1): counts
rownames(629): NM_001024952 NM_080844 ... NR_030558 NR_030418
rowData names(0):
colnames(4): G1E_rep1 G1E_rep2 MK_rep1 MK_rep2
colData names(2): names cell

A partir de este objeto se puede acceder a la matriz de conteos por medio de las funciones counts(dds) o assay(dds); y a la tabla con la información de las muestras con colData(dds).

Filtro preliminar

Dado que en la matriz de conteos existen muchas filas que sólo contienen ceros, estas se eliminan.

# Número inicial de filas 
nrow(dds)
[1] 629
keep <- rowSums(counts(dds))>1
dds <- dds[keep, ]
# Número de filas después del filtro
nrow(dds)
[1] 359

Normalización y transformaciones

La normalización en DESeq es crucial ya que los datos de cuentas crudas de RNA-seq pueden estar sujetos a variaciones técnicas y biológicas que pueden dificultar la comparación entre las muestras. La normalización tiene como objetivo corregir estas variaciones para que los datos sean más comparables y se puedan realizar análisis de expresión diferencial más confiables.

DESeq utiliza un enfoque llamado “normalización de factores de tamaño” para lograr esto. El proceso general de normalización en DESeq involucra los siguientes pasos:

1. Cálculo de factores de tamaño (size factor): Para cada muestra, se calcula un “factor de tamaño” que ajusta los conteos brutos para reflejar la cantidad total de lecturas secuenciadas en esa muestra en relación con la cantidad total de lecturas en todas las muestras. Los factores de tamaño son esenciales para tener en cuenta las diferencias en la profundidad de secuenciación entre las muestras. El factor de tamaño para la \(j\)-ésima columna (muestra) está dado por:

\[\begin{equation} s_j=\underset{i: K_i^{R} \neq 0}{mediana} \frac{K_{i j}}{K_i^{R}} \quad \text{ donde } \quad K_i^{R}=\left(\prod_{j=1}^m K_{i j}\right)^{1 / m} \end{equation}\]

2. Aplicación de factores de tamaño: Se aplican los factores de tamaño a los datos de conteo de cada muestra, dividiendo las cuents crudas por el factor de tamaño correspondiente. Esto tiene el efecto de normalizar los datos para que sean comparables entre todas las muestras.

A menudo, después de la normalización, a los datos se les aplica alguna transformación para reducir la heterocedasticidad y hacer que los datos sean más adecuados para análisis estadísticos posteriores. DESeq2 cuenta con dos transformaciones para datos de conteo que estabilizan la varianza: variance stabilizing transformation (VST) y la regularized-logarithm transformation (rlog).

Gráfica de medias y desviación estándar, alta heterocedasticidad.

Code
meanSdPlot(counts(dds), ranks = FALSE)

A continuación se aplica la normalización a la matriz de cuentas crudas, además de aplicar las transformaciones VST y rlog (el diseño del experimento no contribuye a la tendencia esperada media-varianza). Para mostrar los efectos de las transformaciones se hace un scatterplot de las primeras dos muestras con los valores obtenidos.

Code
# Normalización 
dds <- estimateSizeFactors(dds)
# variance stabilizing transformation (VST), la función vst() se utiliza para conjuntos con muchos datos, en esta caso utilizamos la siguiente función:
vsd <- varianceStabilizingTransformation(dds, blind = FALSE)
# regularized-log transformation (rlog)
rld <- rlog(dds, blind=FALSE)
Code
# Juntar los datos de las tres normalizaciones
df <- bind_rows(
  as_tibble(log2(counts(dds, normalized=TRUE)[, 1:2]+1)) %>%
         mutate(transformation = "log2(x + 1)"),
  as_tibble(assay(vsd)[, 1:2]) %>% mutate(transformation = "vst"),
  as_tibble(assay(rld)[, 1:2]) %>% mutate(transformation = "rlog"))

# Renombrar columnas
colnames(df)[1:2] <- c("x", "y")  

# Nombre de las graficas
lvls <- c("log2(x + 1)", "vst", "rlog")

# Agrupar los tres tipos de normalizacion en grupos como factores
df$transformation <- factor(df$transformation, levels=lvls)

# Plotear los datos
ggplot(df, aes(x = x, y = y)) + 
  geom_hex(bins = 80) +
  coord_fixed() + 
  facet_grid( . ~ transformation)

Exploración de datos

Distancia entre las muestras

Inicialmente se evalúa la similitud general entre las muestras visualizando las matrices de distancias con la función pheatmat(). Al calcular la matriz de distancias es necesario brindar la matriz transpuesta de los conteos, pues las funciones dist() y PoissonDistance() calculan las distancias entre las filas. A continuación se muestran los heatmaps para las métricas Euclidiana, basada en la correlación de Pearson y la distancia de Poisson.

Heatmap con la métrica Euclidiana sobre las cuentas crudas.

Code
# Se encuentra la matriz de distancias
sample_dist_euc_raw <- dist(t(assay(dds)))

sampleDistMatrix_euc_raw <- as.matrix(sample_dist_euc_raw)
colors <- colorRampPalette( rev(brewer.pal(9, "Blues")) )(255)
pheatmap(sampleDistMatrix_euc_raw,
         clustering_distance_rows = sample_dist_euc_raw,
         clustering_distance_cols = sample_dist_euc_raw,
         col = colors)

Para que se tenga una contribución approximadamente igual de todos los genes, se consideran los datos transformados por VST (almacenados en el objeto vsd) y se calcula la distancia Euclidiana.

Code
# Se encuentra la matriz de distancias
sample_dist_euc_vst <- dist(t(assay(vsd)))

sampleDistMatrix_euc_vst <- as.matrix(sample_dist_euc_vst)
colors <- colorRampPalette( rev(brewer.pal(9, "Blues")) )(255)
pheatmap(sampleDistMatrix_euc_vst,
         clustering_distance_rows = sample_dist_euc_vst,
         clustering_distance_cols = sample_dist_euc_vst,
         col = colors)

Code
# Se encuentra la matriz de distancias
sample_dist_pear_vst <- get_dist(t(assay(vsd)), method = "pearson")

sampleDistMatrix_pear_vst <- as.matrix(sample_dist_pear_vst)
colors <- colorRampPalette( rev(brewer.pal(9, "Blues")) )(255)
pheatmap(sampleDistMatrix_pear_vst,
         clustering_distance_rows = sample_dist_pear_vst,
         clustering_distance_cols = sample_dist_pear_vst,
         col = colors)

Otra opción para calcular distancias de muestra es utilizar la distancia de Poisson, implementada en el package PoiClaClu. Esta medida de disimilitud entre conteos también tiene en cuenta la estructura de varianza inherente de las cuentas al calcular las distancias entre muestras. La función PoissonDistance toma la matriz de conteos original (no normalizada) con las muestras como filas en lugar de columnas.

Code
# Se encuentra la matriz de distancias
sample_dist_pois <- PoissonDistance(t(counts(dds)))

sampleDistMatrix_pois <- as.matrix(sample_dist_pois$dd)
rownames(sampleDistMatrix_pois) <- dds$names
colnames(sampleDistMatrix_pois) <- dds$names
colors <- colorRampPalette( rev(brewer.pal(9, "Blues")) )(255)
pheatmap(sampleDistMatrix_pois,
         clustering_distance_rows = sample_dist_pois$dd,
         clustering_distance_cols = sample_dist_pois$dd,
         col = colors)

PCA

DESeq2 cuenta con la función plotPCA() la cual lleva a cabo un análisis de componentes principales considerando como variables los transcritos (toma por default los primeros ntop=500) y como observaciones las muestras. El resultado es la gráfica de los scores en el subespacio generado por las dos primeras componentes principales.

Code
plotPCA(vsd , intgroup="cell")

O bien, podemos utilizar el script que desarrollamos previamente, nótese que es necesario aplicar la función sobre la matriz transpuesta de las cuentas (en este caso las correspondientes a VST)

Code
PC_total <- prcomp(t(assay(vsd)), scale. = TRUE, center = TRUE)

eig_total <- get_eigenvalue(PC_total)
eig_tabla <- data.frame(PC=paste0("PC",1:dim(eig_total)[1]), 
                        Eigenvalor=round(eig_total$eigenvalue,3), 
                        Varianza=round(eig_total$variance.percent,2), 
                        Var_acu=round(eig_total$cumulative.variance.percent,2))

kable(eig_tabla, align = "c", col.names = c("Componente", "Eigenvalor", "% varianza", "% varianza acumulada")) %>% kable_styling(c("striped", "hover"), full_width = F)%>% scroll_box(width="100%", height="300px", fixed_thead = TRUE)
Componente Eigenvalor % varianza % varianza acumulada
PC1 222.956 62.10 62.10
PC2 102.468 28.54 90.65
PC3 33.575 9.35 100.00
PC4 0.000 0.00 100.00
Code
fviz_eig(PC_total, addlabels = TRUE)

Code
PC_coef <-data.frame(PC_total$rotation)
kable(PC_coef, align = "c") %>% kable_styling(c("striped", "hover"), full_width = F)%>% scroll_box(width="100%", height="300px", fixed_thead = TRUE)
PC1 PC2 PC3 PC4
NM_001024952 0.0039696 0.0986019 -0.0027679 0.2575323
MSTRG.7.1 -0.0222913 -0.0927576 0.0150250 0.2119173
MSTRG.8.1 -0.0053619 -0.0970779 -0.0288363 -0.1330317
MSTRG.1.1 -0.0556195 -0.0442070 -0.0572452 0.0470005
MSTRG.9.1 -0.0583275 0.0217820 -0.0757903 0.0270105
MSTRG.26.1 -0.0552600 0.0076743 0.0965721 -0.0491509
MSTRG.27.1 -0.0641237 -0.0260213 0.0203126 0.0005552
NR_002840 -0.0402389 -0.0786923 0.0115309 0.0299995
MSTRG.20.1 -0.0657831 0.0169927 0.0129011 0.0623158
MSTRG.22.1 -0.0487338 -0.0443084 0.0895608 -0.0034428
MSTRG.23.1 -0.0579161 -0.0493255 -0.0091953 -0.0010840
MSTRG.31.1 -0.0640608 0.0202680 -0.0357620 0.0263561
MSTRG.32.1 -0.0556267 0.0550047 -0.0015328 -0.0445433
MSTRG.33.1 -0.0650439 -0.0228416 0.0098768 0.0134423
MSTRG.34.1 -0.0344471 -0.0846329 -0.0066560 -0.0212275
MSTRG.28.1 -0.0643026 0.0144141 0.0411390 0.0630614
MSTRG.28.3 -0.0391631 -0.0000697 0.1399959 0.0441424
NM_172644 -0.0656448 0.0187153 -0.0099666 0.0467747
MSTRG.3.1 -0.0661313 -0.0141300 -0.0115449 -0.0007900
MSTRG.4.1 -0.0652744 0.0157641 0.0270536 -0.0043887
MSTRG.5.1 -0.0261175 -0.0866474 0.0483868 -0.0245222
NM_001039482 -0.0052342 -0.0873476 -0.0794805 0.0870912
MSTRG.24.1 0.0479008 0.0682529 0.0181703 0.0020808
NM_199028 -0.0523576 -0.0171079 -0.1033771 0.1035555
MSTRG.11.1 -0.0319259 -0.0865865 -0.0116048 0.0104240
NM_009846 -0.0658399 0.0180749 -0.0009545 0.0168415
MSTRG.14.1 -0.0668931 0.0040681 -0.0043821 -0.0381071
MSTRG.14.2 -0.0649491 -0.0202335 -0.0228522 0.0135338
MSTRG.16.1 -0.0639735 -0.0271565 -0.0188716 0.0057304
MSTRG.17.1 0.0073851 -0.0902622 -0.0675062 0.0148719
MSTRG.18.1 -0.0558864 -0.0512254 -0.0321765 -0.0026979
MSTRG.6.1 0.0569818 0.0437960 -0.0486707 -0.0233613
NM_026411 0.0162433 -0.0867082 -0.0713209 -0.0374104
MSTRG.12.1 -0.0653649 0.0215083 -0.0000398 -0.0095012
MSTRG.37.1 -0.0596457 0.0104311 0.0763374 -0.0050878
MSTRG.39.1 -0.0666722 0.0081644 0.0078860 0.0047905
NM_030093 0.0333294 0.0852612 -0.0148873 -0.0272819
MSTRG.41.1 0.0008161 -0.0938506 -0.0538381 0.0507810
MSTRG.41.3 -0.0028627 -0.0848191 0.0881656 -0.0884877
MSTRG.42.1 -0.0028627 -0.0848191 0.0881656 -0.0884877
MSTRG.43.1 0.0281413 -0.0889972 -0.0187746 -0.0227259
NM_010822 -0.0483729 -0.0516701 0.0780867 0.0016181
MSTRG.46.1 -0.0421537 0.0767477 0.0027937 -0.0079373
NM_001083955 0.0644995 0.0112030 -0.0421318 0.0280634
NM_001033981 -0.0560000 0.0219717 -0.0865211 -0.0506239
MSTRG.47.1 -0.0646350 0.0198951 -0.0288782 0.0210257
NM_008267 -0.0616122 0.0212030 -0.0566038 -0.0176105
MSTRG.59.3 -0.0657937 0.0170383 0.0123455 0.0184221
MSTRG.59.1 -0.0655082 0.0189693 -0.0137514 -0.0474127
NR_108029 -0.0657878 0.0170127 0.0126577 -0.0131490
MSTRG.62.3 -0.0630506 0.0207431 -0.0455208 0.1165478
MSTRG.36.1 -0.0503557 -0.0597168 -0.0454113 0.0084068
MSTRG.45.2 -0.0611549 0.0213152 -0.0596846 0.0764204
MSTRG.52.3 0.0586804 0.0463152 0.0192720 -0.0456037
MSTRG.52.4 0.0369878 0.0813490 0.0224188 -0.0117069
MSTRG.52.7 0.0426795 0.0714720 0.0458048 -0.0347734
MSTRG.52.6 -0.0391631 -0.0000697 0.1399959 -0.0097234
MSTRG.48.1 -0.0648961 0.0243873 -0.0014998 -0.0024712
MSTRG.50.1 -0.0658017 0.0182679 -0.0035975 0.0067731
MSTRG.60.1 -0.0664482 0.0120782 -0.0042882 -0.0081776
MSTRG.55.1 -0.0662910 0.0093365 -0.0183338 -0.0091423
MSTRG.56.1 -0.0143203 -0.0431497 0.1507966 0.1012908
MSTRG.58.1 -0.0612899 0.0212834 -0.0587930 -0.0479393
NR_131758 -0.0611549 0.0213152 -0.0596846 0.0764204
MSTRG.63.1 -0.0654823 0.0161603 0.0226454 -0.0364418
NM_001177354 0.0183796 0.0921694 -0.0401765 0.0297902
MSTRG.68.1 0.0113528 -0.0972923 0.0062761 0.0111685
MSTRG.69.1 0.0526247 -0.0610853 -0.0024483 0.0041926
MSTRG.70.1 -0.0627076 -0.0134207 0.0558754 -0.0024513
MSTRG.71.1 0.0014660 -0.0985399 0.0116343 0.0476541
MSTRG.77.1 -0.0655252 0.0189412 -0.0133256 -0.0105986
NM_008272 -0.0645767 0.0199381 -0.0296436 -0.0327064
MSTRG.78.2 -0.0654172 0.0191081 -0.0158773 -0.0021671
NM_010466 -0.0623661 0.0209856 -0.0511013 -0.0224300
MSTRG.81.1 -0.0658439 0.0173167 0.0089080 0.0592505
NM_010465 -0.0653803 0.0159566 0.0249287 -0.0183365
MSTRG.80.1 -0.0653244 0.0192333 -0.0178333 -0.0599785
NM_175730 -0.0648773 0.0196996 -0.0254787 -0.0210757
NR_030526 -0.0658634 0.0178643 0.0018640 -0.0226307
MSTRG.89.1 -0.0645918 0.0147658 0.0375975 -0.0635039
NM_013553 -0.0658639 0.0178561 0.0019719 -0.0162338
MSTRG.92.1 -0.0613296 -0.0374889 0.0227511 -0.0320588
MSTRG.66.1 0.0636819 -0.0289155 0.0173880 -0.0415638
MSTRG.73.1 -0.0582098 -0.0469965 0.0232952 0.0023140
MSTRG.79.1 -0.0600059 0.0434843 -0.0101274 -0.0172873
MSTRG.74.1 -0.0590885 0.0100497 0.0793133 0.0426127
MSTRG.75.1 -0.0642546 0.0272316 -0.0102170 -0.0037616
MSTRG.82.2 -0.0391631 -0.0000697 0.1399959 -0.0097234
MSTRG.82.4 -0.0368791 0.0208140 -0.1393916 0.0503955
MSTRG.87.1 -0.0657887 0.0183192 -0.0043102 0.0044664
MSTRG.88.1 -0.0638345 0.0138955 0.0462122 -0.0040202
MSTRG.90.1 -0.0642600 0.0143645 0.0416314 0.0123285
MSTRG.85.1 -0.0662825 0.0089810 0.0190668 0.0104688
MSTRG.84.1 -0.0656190 0.0187691 -0.0107572 -0.0225297
MSTRG.91.1 -0.0554794 0.0498080 0.0421110 -0.0067756
MSTRG.95.1 -0.0632325 0.0325009 -0.0030080 -0.0147624
MSTRG.97.1 -0.0645043 0.0199896 -0.0305696 0.0351302
MSTRG.97.2 -0.0657625 0.0184105 -0.0055893 -0.0034154
MSTRG.93.1 -0.0554806 0.0436491 -0.0594062 0.0148108
NR_045743 -0.0391631 -0.0000697 0.1399959 0.0551918
MSTRG.94.1 -0.0527453 -0.0608061 0.0050484 0.0191431
NM_007757 -0.0620081 0.0319470 -0.0337093 -0.0011134
MSTRG.108.1 0.0441046 -0.0742549 -0.0062544 0.0059901
MSTRG.110.1 0.0653661 0.0037389 -0.0369883 0.0045490
MSTRG.111.1 0.0568629 -0.0519976 -0.0078067 -0.0349996
MSTRG.112.1 -0.0357253 -0.0084203 0.1452310 0.0596738
MSTRG.113.1 0.0599568 0.0435901 -0.0106553 -0.0228793
MSTRG.104.1 0.0668491 0.0055399 -0.0038893 -0.0010083
MSTRG.106.1 -0.0403287 -0.0776921 -0.0237121 0.0020689
MSTRG.107.1 0.0465952 -0.0684453 0.0326980 0.0413835
MSTRG.99.1 0.0281413 -0.0889972 -0.0187746 -0.0586364
MSTRG.100.1 -0.0665334 0.0090108 -0.0118581 -0.0014406
MSTRG.103.1 -0.0481073 0.0674302 0.0232208 -0.0580271
MSTRG.115.1 0.0154910 -0.0961051 -0.0015770 0.0093491
MSTRG.116.1 -0.0582260 -0.0300227 -0.0672297 0.0088030
NM_010721 0.0142870 0.0947367 -0.0322106 -0.0327858
MSTRG.122.1 -0.0544038 -0.0556964 -0.0257341 0.0092481
MSTRG.122.2 -0.0640150 -0.0165413 0.0416721 0.0241774
MSTRG.124.1 -0.0469555 0.0636393 -0.0527509 0.0107714
MSTRG.126.1 -0.0625481 0.0342387 0.0150593 0.0066118
NM_177115 -0.0391631 -0.0000697 0.1399959 0.0551918
MSTRG.119.1 -0.0206951 -0.0867844 0.0628835 0.0662916
MSTRG.120.1 0.0323839 0.0863945 -0.0063631 0.0595805
MSTRG.123.1 -0.0508019 -0.0319440 0.0976295 0.0603389
NM_008275 0.0281413 -0.0889972 -0.0187746 -0.0586364
MSTRG.129.1 -0.0648164 0.0197516 -0.0263697 -0.0499469
MSTRG.129.2 -0.0611725 0.0213111 -0.0595693 -0.0012553
NM_001290731 -0.0621067 0.0210655 -0.0530612 -0.0382163
NM_010469 -0.0391631 -0.0000697 0.1399959 -0.0097234
MSTRG.128.1 0.0479008 0.0682529 0.0181703 -0.0089686
MSTRG.137.1 0.0403041 -0.0786889 0.0099880 -0.0265053
MSTRG.138.1 0.0417895 -0.0745474 0.0350254 -0.0820917
MSTRG.140.1 -0.0631292 -0.0153204 0.0510209 -0.0398069
MSTRG.139.1 0.0522342 0.0605280 0.0220174 0.0318008
NM_007967 0.0607846 0.0408373 0.0126155 -0.0310472
MSTRG.131.2 -0.0643699 0.0200803 -0.0322253 0.0299430
MSTRG.131.3 -0.0658380 0.0180870 -0.0011189 -0.0120046
MSTRG.134.1 -0.0654459 0.0190663 -0.0152325 0.0019954
MSTRG.135.1 -0.0652894 0.0192771 -0.0185268 0.0221332
MSTRG.142.1 -0.0558073 -0.0545300 -0.0052406 0.0048154
NM_011527 0.0549164 0.0561414 0.0117572 -0.0202943
MSTRG.150.2 0.0595828 0.0445739 0.0120714 -0.0039668
MSTRG.152.1 -0.0656466 0.0165478 0.0181957 -0.0847421
NR_131922 0.0221267 -0.0891688 -0.0476116 0.0261612
NM_025647 -0.0536024 -0.0590283 0.0083904 0.0061479
MSTRG.144.1 -0.0668574 -0.0044634 0.0063705 -0.0055171
MSTRG.145.1 -0.0660520 -0.0052829 -0.0269632 0.0314610
MSTRG.146.1 -0.0618700 -0.0363801 -0.0180415 -0.0071711
MSTRG.151.1 -0.0583829 0.0440961 -0.0348567 -0.0417220
MSTRG.153.1 -0.0666184 -0.0098889 -0.0038461 0.0006571
MSTRG.154.1 -0.0634480 -0.0179370 -0.0454929 0.0057918
MSTRG.149.1 0.0062811 -0.0917556 0.0618681 0.1456624
NM_009141 0.0155532 -0.0948627 -0.0267156 0.0154819
NM_023785 0.0606114 -0.0418658 -0.0062603 0.0054643
NM_019932 0.0493285 -0.0666330 -0.0086743 0.0149035
NM_203320 -0.0581671 0.0217996 -0.0765891 0.0638370
NM_011339 0.0281413 -0.0889972 -0.0187746 -0.0227259
MSTRG.162.1 0.0479008 0.0682529 0.0181703 -0.0089686
MSTRG.166.1 -0.0297311 -0.0878363 0.0191841 0.0068821
NM_031408 -0.0455245 -0.0311805 -0.1142554 0.0087314
MSTRG.169.1 -0.0335680 0.0768391 -0.0654378 -0.1424992
NM_031404 -0.0658283 0.0172140 0.0101869 0.0800665
NM_001289507 -0.0391631 -0.0000697 0.1399959 -0.0097234
MSTRG.179.1 -0.0653754 0.0190188 -0.0172858 -0.0014584
MSTRG.172.1 -0.0450245 -0.0725218 -0.0164631 -0.0199717
MSTRG.175.1 -0.0589958 -0.0376288 -0.0484799 0.0083183
MSTRG.176.1 0.0382579 -0.0723652 0.0638939 0.1111631
MSTRG.183.1 -0.0654510 0.0117760 -0.0302300 -0.0293150
MSTRG.181.1 -0.0491251 0.0667010 0.0134365 0.0061988
MSTRG.182.1 -0.0307725 0.0855752 -0.0338563 0.0223627
MSTRG.187.1 -0.0661715 0.0148440 0.0059053 0.0228196
MSTRG.187.3 -0.0656466 0.0165478 0.0181957 -0.0847421
MSTRG.187.4 -0.0613777 0.0117042 0.0659510 -0.0087881
MSTRG.187.5 -0.0669338 -0.0017868 -0.0048802 -0.0482796
MSTRG.184.1 0.0117908 -0.0933258 -0.0477446 -0.0292836
MSTRG.189.1 0.0595249 -0.0357876 0.0484395 0.0256510
MSTRG.191.1 0.0274167 -0.0845879 0.0543661 0.0331678
MSTRG.192.1 0.0606406 -0.0317726 0.0477908 -0.0001728
MSTRG.197.1 0.0515951 0.0550429 -0.0534798 0.0367289
MSTRG.198.1 -0.0596871 0.0447606 0.0034996 -0.0325294
NR_040429 0.0281413 -0.0889972 -0.0187746 0.0104223
MSTRG.201.1 -0.0271435 -0.0879745 0.0356530 -0.0338503
MSTRG.202.1 -0.0388759 -0.0783458 0.0318602 -0.0126991
MSTRG.203.1 -0.0565300 -0.0519388 -0.0181730 -0.0068396
MSTRG.147.1 0.0281413 -0.0889972 -0.0187746 -0.0033894
MSTRG.157.2 0.0642718 -0.0276769 -0.0038789 -0.0003625
MSTRG.161.1 0.0627286 -0.0346014 0.0005909 0.0064597
MSTRG.163.1 0.0657492 -0.0183160 0.0073103 0.0080795
NM_011741 0.0403312 0.0783610 0.0155681 0.0083252
NM_028753 -0.0544399 -0.0490690 -0.0524890 0.0408744
MSTRG.167.2 -0.0642636 0.0201479 -0.0334806 0.0108135
NM_010312 0.0243188 0.0908503 -0.0258264 -0.0178496
MSTRG.186.1 -0.0397572 0.0780192 0.0266612 -0.0297801
MSTRG.186.2 -0.0627754 0.0128705 0.0557649 -0.0077529
MSTRG.180.1 -0.0652744 0.0157641 0.0270536 -0.0043887
MSTRG.171.1 -0.0627099 -0.0014680 -0.0605248 -0.0294285
MSTRG.173.1 -0.0600826 -0.0433743 0.0083999 0.0020231
MSTRG.174.1 -0.0662605 -0.0075337 -0.0213503 -0.0000407
MSTRG.177.1 0.0479008 0.0682529 0.0181703 -0.0089686
NM_001033312 0.0459600 0.0717509 0.0067275 -0.0006519
NM_007393 0.0384242 -0.0778510 -0.0385078 0.0084052
MSTRG.194.1 0.0225365 -0.0892542 -0.0458132 -0.0235330
MSTRG.195.1 0.0662323 0.0145297 -0.0030892 -0.0067443
NM_001313894 0.0522705 0.0610102 0.0167553 -0.0072992
NM_010439 -0.0656466 0.0165478 0.0181957 -0.0847421
NM_133933 -0.0552584 -0.0333955 -0.0781243 -0.0681574
MSTRG.199.1 -0.0581592 0.0094373 0.0839675 -0.0533207
MSTRG.204.1 -0.0657684 0.0183911 -0.0053166 -0.0220371
MSTRG.208.1 -0.0635714 0.0136248 0.0487946 0.0261394
MSTRG.209.1 -0.0657551 0.0184340 -0.0059210 -0.0426357
MSTRG.210.1 0.0276275 0.0889620 0.0237044 -0.0242431
MSTRG.211.1 -0.0645353 -0.0239064 -0.0195762 0.0346044
MSTRG.212.1 -0.0658272 0.0172073 0.0102701 -0.0046967
MSTRG.213.1 -0.0287382 0.0884434 0.0206624 -0.0405297
MSTRG.214.1 -0.0656155 0.0187760 -0.0108592 -0.0013035
MSTRG.215.1 -0.0656396 0.0180596 0.0133220 -0.0121240
MSTRG.215.2 -0.0379088 -0.0800753 -0.0259232 0.0063193
MSTRG.215.3 -0.0633065 0.0133641 0.0512402 -0.0435026
NM_008090 -0.0587453 0.0379550 -0.0497081 0.0001936
NM_019964 -0.0368791 0.0208140 -0.1393916 -0.1333008
MSTRG.223.1 -0.0651960 -0.0178734 -0.0241516 0.0006978
MSTRG.206.1 -0.0114672 -0.0969203 -0.0155733 -0.0197278
NR_105795 -0.0391631 -0.0000697 0.1399959 -0.0649704
MSTRG.216.1 -0.0639032 0.0203545 -0.0374450 0.0253022
MSTRG.221.1 -0.0632941 0.0308726 -0.0164997 -0.0155189
NM_023060 -0.0232540 -0.0262164 -0.1552265 0.0195777
MSTRG.217.1 -0.0368791 0.0208140 -0.1393916 0.0856155
MSTRG.219.1 -0.0573513 -0.0403849 0.0544486 0.0465791
MSTRG.229.2 -0.0489570 -0.0205937 -0.1121319 -0.0313657
MSTRG.229.1 0.0667553 -0.0077035 0.0032936 0.0012865
MSTRG.225.1 -0.0368791 0.0208140 -0.1393916 -0.1333008
MSTRG.227.1 0.0666838 -0.0075888 0.0089209 0.0130631
MSTRG.218.1 -0.0454425 -0.0635186 0.0613014 0.0078887
NM_016956 0.0158067 -0.0864425 -0.0729384 -0.0070027
NM_001278161 0.0549987 0.0563560 -0.0021061 -0.0063697
MSTRG.234.1 0.0648130 0.0078274 0.0412541 0.0575985
MSTRG.235.1 -0.0594793 -0.0450769 -0.0094821 -0.0097089
MSTRG.232.1 -0.0328090 -0.0858055 -0.0128836 0.0410710
MSTRG.237.1 -0.0665346 -0.0103488 0.0077791 -0.0011275
MSTRG.238.1 -0.0650072 -0.0229021 -0.0109891 -0.0057581
MSTRG.239.1 -0.0657014 0.0185839 -0.0080590 -0.0161536
MSTRG.240.1 -0.0391631 -0.0000697 0.1399959 -0.0097234
NM_133224 -0.0447215 -0.0625789 -0.0674622 -0.0178366
NM_198101 -0.0640608 0.0202680 -0.0357620 0.0263561
NM_020028 -0.0656466 0.0165478 0.0181957 -0.0847421
MSTRG.242.1 0.0594960 -0.0296001 -0.0600330 -0.0091630
MSTRG.248.2 0.0494117 0.0660666 0.0158147 -0.0099511
MSTRG.255.1 -0.0440485 -0.0742190 -0.0093955 0.0464390
NM_032004 0.0665784 0.0006345 -0.0186375 -0.0109920
MSTRG.258.1 0.0475118 0.0690658 -0.0153619 0.0144266
MSTRG.259.1 -0.0651565 0.0155661 0.0292065 0.0147365
MSTRG.263.1 -0.0614669 0.0384508 -0.0135187 -0.0033520
NM_026014 -0.0303014 0.0877604 -0.0134668 0.0230147
MSTRG.270.1 -0.0240218 -0.0396172 0.1454709 -0.0062371
MSTRG.272.1 -0.0630506 0.0207431 -0.0455208 0.1165478
MSTRG.272.2 0.0648742 0.0241641 0.0073650 0.0160007
NM_021502 -0.0595622 0.0216182 -0.0692773 0.0497163
MSTRG.276.1 0.0245704 -0.0918795 -0.0033669 -0.0178600
MSTRG.280.1 0.0655291 0.0196875 0.0092867 -0.0260822
MSTRG.280.2 -0.0654972 0.0189872 -0.0140229 -0.0402737
MSTRG.278.1 -0.0618750 0.0121013 0.0625589 -0.0441123
NM_001200023 -0.0368791 0.0208140 -0.1393916 0.0856155
NM_177899 0.0375232 0.0817952 -0.0039384 0.0037266
MSTRG.244.1 -0.0311843 0.0831895 -0.0469634 -0.0025277
MSTRG.244.3 -0.0601533 0.0107893 0.0734876 0.0998248
MSTRG.245.1 -0.0415441 -0.0095437 0.1343310 -0.0101468
MSTRG.249.2 -0.0601533 0.0107893 0.0734876 0.0998248
MSTRG.249.3 -0.0669379 -0.0031157 0.0004942 0.0279946
MSTRG.251.1 -0.0604781 -0.0398807 0.0253290 -0.0648732
MSTRG.253.1 -0.0595811 -0.0447595 -0.0098221 0.0248646
MSTRG.246.1 -0.0559206 0.0475767 -0.0459364 0.0308867
MSTRG.246.2 -0.0538441 -0.0583202 -0.0123096 -0.0701640
NM_026818 0.0667517 0.0073958 0.0053107 -0.0026373
NM_023312 -0.0110967 -0.0972360 -0.0105368 -0.0277095
NM_001037298 0.0664241 0.0059447 -0.0194176 0.0110458
MSTRG.264.1 0.0172623 -0.0943686 0.0250323 0.0487856
MSTRG.265.1 0.0203377 -0.0938041 0.0135252 -0.0097598
MSTRG.260.1 0.0281413 -0.0889972 -0.0187746 -0.0227259
MSTRG.261.1 -0.0055320 -0.0820195 0.0951307 0.0777172
MSTRG.266.1 -0.0643142 0.0260178 -0.0158343 -0.0121976
MSTRG.268.1 -0.0589113 0.0456136 -0.0196963 -0.0361587
NM_009698 -0.0643026 0.0144141 0.0411390 0.0630614
MSTRG.269.1 -0.0391631 -0.0000697 0.1399959 -0.0097234
MSTRG.275.1 -0.0346968 -0.0843872 -0.0075116 0.0202397
NM_001007462 0.0443420 0.0707785 0.0379269 0.0219081
NM_009824 -0.0467647 -0.0308192 -0.1111873 -0.0748094
MSTRG.277.1 -0.0194091 -0.0914983 -0.0416172 -0.0189381
MSTRG.282.1 -0.0023515 -0.0977595 -0.0240923 -0.0151238
MSTRG.283.1 -0.0431306 -0.0750787 -0.0150966 0.0206542
NM_025870 -0.0457766 -0.0680329 -0.0417497 0.0338087
MSTRG.294.1 0.0559786 0.0490218 -0.0405095 -0.0015499
MSTRG.296.1 0.0281413 -0.0889972 -0.0187746 0.0104223
MSTRG.301.1 0.0281413 -0.0889972 -0.0187746 0.0104223
MSTRG.302.1 0.0281413 -0.0889972 -0.0187746 0.0104223
MSTRG.308.1 0.0664589 0.0000209 0.0213113 -0.0086674
MSTRG.309.1 0.0606172 -0.0418116 -0.0069539 0.0212899
MSTRG.310.1 0.0461202 0.0714978 0.0076112 -0.0172291
MSTRG.311.1 0.0545337 -0.0573127 0.0032873 0.0060435
MSTRG.313.1 0.0225115 -0.0892493 -0.0459234 0.0234251
MSTRG.314.1 0.0658047 -0.0183236 0.0020124 -0.0048556
NM_031874 0.0626185 0.0317075 -0.0260319 0.0512756
NR_045606 0.0479008 0.0682529 0.0181703 -0.0213991
MSTRG.290.1 -0.0391631 -0.0000697 0.1399959 0.0551918
MSTRG.291.1 0.0044265 0.0922942 -0.0604733 -0.0050869
MSTRG.292.1 0.0559519 0.0532773 0.0182293 -0.0204155
MSTRG.299.1 -0.0565510 0.0014409 -0.0924177 0.0559439
MSTRG.285.1 -0.0655754 -0.0178037 -0.0161685 0.0257270
MSTRG.287.1 0.0217829 0.0667068 -0.1142478 0.5370302
NM_010149 -0.0159729 -0.0935045 -0.0375051 0.0546939
NM_010487 0.0443420 0.0707785 0.0379269 0.0219081
NM_008026 0.0597001 0.0439711 0.0146874 -0.0287076
MSTRG.312.1 0.0668753 -0.0023814 0.0082552 0.0100439
NM_138606 -0.0269365 -0.0840352 -0.0584243 -0.0806763
MSTRG.328.1 -0.0294520 -0.0715987 -0.0915344 -0.1116006
MSTRG.329.1 -0.0641311 -0.0217290 0.0321218 0.0125991
MSTRG.333.1 0.0093431 0.0955054 0.0369727 -0.0137663
MSTRG.334.1 -0.0624315 -0.0341956 0.0182341 0.0194255
MSTRG.335.1 -0.0657951 0.0170449 0.0122658 0.0049497
MSTRG.340.1 0.0643153 0.0275409 -0.0009255 -0.0255544
MSTRG.338.1 -0.0030399 -0.0982164 0.0168088 0.0108775
MSTRG.343.1 -0.0633799 -0.0102495 -0.0528036 -0.0373356
MSTRG.353.1 -0.0656478 0.0165510 0.0181575 -0.0609195
MSTRG.353.2 -0.0457014 -0.0567601 -0.0779874 0.0596532
MSTRG.355.1 -0.0592721 -0.0406958 0.0374190 -0.0000203
MSTRG.356.1 0.0066946 0.0978620 -0.0160735 -0.0285496
MSTRG.356.2 -0.0650480 0.0153960 0.0310305 -0.0580098
MSTRG.356.5 -0.0648969 -0.0162294 0.0318240 0.0163347
MSTRG.356.6 -0.0658688 0.0176380 0.0048232 0.0347573
MSTRG.356.8 -0.0658500 0.0180030 0.0000150 -0.0005138
NR_002844 0.0186940 -0.0948280 -0.0044157 -0.0055234
MSTRG.347.1 0.0490455 -0.0672463 -0.0030819 0.0167991
MSTRG.348.1 0.0281413 -0.0889972 -0.0187746 -0.0033894
MSTRG.349.1 0.0218530 -0.0924537 -0.0229346 0.0197658
MSTRG.350.1 0.0662696 -0.0120548 0.0133254 0.0014041
NR_015508 0.0479008 0.0682529 0.0181703 -0.0213991
NR_033398 -0.0368791 0.0208140 -0.1393916 0.0068885
MSTRG.316.1 0.0422440 0.0755552 -0.0226173 -0.0030626
MSTRG.317.1 -0.0664946 -0.0116355 -0.0030788 0.0418815
MSTRG.318.1 0.0381013 -0.0785835 -0.0360164 -0.0134684
MSTRG.320.1 0.0652581 -0.0214022 -0.0103206 -0.0145375
MSTRG.325.1 -0.0421993 0.0393900 -0.1149923 0.0799853
MSTRG.325.2 -0.0015604 -0.0987407 0.0035433 0.0063720
MSTRG.331.1 0.0422134 0.0733650 -0.0390394 0.0766226
MSTRG.322.1 0.0668140 0.0061305 0.0050254 -0.0118366
MSTRG.323.1 0.0669113 0.0033464 0.0043956 0.0066788
NM_008089 0.0541322 0.0581532 -0.0020911 -0.0072343
MSTRG.341.1 -0.0325479 0.0080457 0.1501712 0.1657315
MSTRG.336.1 -0.0556568 -0.0537639 -0.0197994 0.0021582
NM_027227 -0.0391631 -0.0000697 0.1399959 -0.0097234
MSTRG.352.1 -0.0656559 0.0165731 0.0178999 0.0257311
NR_015505 -0.0645767 0.0199381 -0.0296436 -0.0327064
MSTRG.346.1 -0.0656466 0.0165478 0.0181957 -0.0847421
NR_001463 -0.0391631 -0.0000697 0.1399959 0.0441424
MSTRG.344.1 -0.0641423 0.0142303 0.0429565 -0.0328379
MSTRG.357.1 -0.0650679 -0.0181214 0.0258238 0.0380162
MSTRG.361.1 0.0653924 -0.0049637 -0.0362320 0.0008721
MSTRG.362.1 0.0224749 -0.0930125 0.0051614 -0.0138325
MSTRG.358.1 0.0281413 -0.0889972 -0.0187746 -0.0227259
MSTRG.359.1 0.0281413 -0.0889972 -0.0187746 -0.0310129
Code
fviz_pca_var(PC_total, col.var = "contrib", gradient.cols=c("#1627dc", "#ffb600", "#ff2e16"), axes=c(1,2))

Code
fviz_pca_var(PC_total, col.var = "contrib", gradient.cols=c("#1627dc", "#ffb600", "#ff2e16"), select.var = list(contrib=20), axes=c(1,2))

Code
fviz_contrib(PC_total, "var", axes = 1, select.var = list(contrib=100))

Code
fviz_contrib(PC_total, "var", axes = 2, select.var = list(contrib=100))

Code
fviz_pca_ind(PC_total,
             fill.ind = colData(vsd)$cell,
             pointshape = 21,
             pointsize = 2,
             #addEllipses = TRUE,
             label.ind = colData(vsd)$cell,
            repel = TRUE,
            ggtheme = theme_bw()
            )

Code
proy_scores <- fviz_pca_ind(PC_total,
             fill.ind = colData(vsd)$cell,
             pointshape = 21,
             pointsize = 2,
             #addEllipses = TRUE,
             label.ind = colData(vsd)$cell,
            #repel = TRUE,
            ggtheme = theme_bw()
            )

ggplotly(proy_scores)

Análisis de expresión diferencial

El análisis de expresión diferencial se lleva a cabo sobre las cuentas originales por medio de la función DESeq:

dds <- DESeq(dds)
using pre-existing size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
dds
class: DESeqDataSet 
dim: 359 4 
metadata(1): version
assays(4): counts mu H cooks
rownames(359): NM_001024952 MSTRG.7.1 ... MSTRG.358.1 MSTRG.359.1
rowData names(22): baseMean baseVar ... deviance maxCooks
colnames(4): G1E_rep1 G1E_rep2 MK_rep1 MK_rep2
colData names(3): names cell sizeFactor

Esta función muestra mensajes de los pasos realizados (ver ?DESeq). Los cuales son: estimar los factores de tamaño (controlando las diferencias en la profundidad de secuenciación de las muestras), la estimación de los valores de dispersión para cada gen y el ajuste de un modelo lineal generalizado.

El objeto generado es de la clase DESeqDataSet que contiene todos los parámetros ajustados y tablas de resultados.

Tabla de resultados

Al llamar los resultados sin ningún argumento muestra los log2 fold changes y p-values para la última variable en la fórmula del diseño experimental (en este caso sólo es una variable). Si existieran más de dos niveles en esta variable, los resultados mostrarían la tabla de comparación del último nivel respecto al primer nivel.

Code
res <- results(dds)
res
log2 fold change (MLE): cell G1E vs MK 
Wald test p-value: cell G1E vs MK 
DataFrame with 359 rows and 6 columns
              baseMean log2FoldChange     lfcSE       stat    pvalue      padj
             <numeric>      <numeric> <numeric>  <numeric> <numeric> <numeric>
NM_001024952   4.58123      0.0488519   3.18513  0.0153375  0.987763        NA
MSTRG.7.1      6.55401     -0.6334148   2.46508 -0.2569551  0.797213   0.85974
MSTRG.8.1      7.43120     -1.7231046   2.35914 -0.7303961  0.465148   0.57815
MSTRG.1.1      2.54861      0.9148084   3.47067  0.2635829  0.792101        NA
MSTRG.9.1      2.86126      3.1664089   4.01910  0.7878394  0.430791        NA
...                ...            ...       ...        ...       ...       ...
MSTRG.357.1    1.83409        1.62935   3.93965   0.413577 0.6791837        NA
MSTRG.361.1   27.29284       -3.11403   1.34622  -2.313173 0.0207131 0.0515021
MSTRG.362.1    3.26117       -5.11248   4.00011  -1.278084 0.2012196        NA
MSTRG.358.1    4.55392       -6.95601   4.21178  -1.651563 0.0986236        NA
MSTRG.359.1    3.72594       -6.66930   4.53816  -1.469605 0.1416687        NA

Es posible extraer la tabla como una DataFrame, la cual contiene metadatos con información del significado de las columnas:

Code
res_df <- results(dds, contrast = c("cell", "G1E", "MK"))
# Se crea una versión tibble
res_tibble <- as_tibble(res_df)
#Se crea una data frame usual
res_data_frame <- as.data.frame(res_df)
mcols(res_df, use.names = TRUE)
DataFrame with 6 rows and 2 columns
                       type            description
                <character>            <character>
baseMean       intermediate mean of normalized c..
log2FoldChange      results log2 fold change (ML..
lfcSE               results standard error: cell..
stat                results Wald statistic: cell..
pvalue              results Wald test p-value: c..
padj                results   BH adjusted p-values

La primera columna, baseMean, es el promedio de los valores de las cuentas normalizadas, divididos por los factores de tamaño, tomados de todas las muestras en el DESeqDataSet. Las cuatro columnas restantes se refieren a la comparación del nivel G1E sobre el nivel de referencia MK para la variable cell.

La columna log2FoldChange es la estimación del tamaño del efecto consecuencia de la condición experimental. Nos dice cuánto parece cambiar la expresión del gen entre las líneas celulares. Este valor se reporta en una escala logarítmica en base 2.

La incertidumbre asociada a esta estimación está disponible en la columna lfcSE, que es el error estándar del valor estimado del log2FoldChange.

El propósito de un análisis de expresión diferencial es comprobar si los datos proporcionan evidencia suficiente para concluir que el log2FoldChange es significativamente diferente de cero. DESeq2 realiza para cada transcrito una prueba de hipótesis para ver si la evidencia es suficiente para rechazar la hipótesis nula (que la diferencia de expresión es cero y que la diferencia observada entre líneas celulares es causada simplemente por la variabilidad experimental). Como es habitual en estadística, el resultado de esta prueba se reporta por medio de un p-value. DESeq2 utiliza la corrección de Benjamini-Hochberg (BH) que controla la False Discovery Rate (FDR) : la proporción esperada de falsos positvios entre todas las hipótesis rechazadas, es decir, la FDR mide cuántos de los casos considerados significativos (rechazo de la hipótesis nula) son probablemente falsos. En DESeq se calcula para cada gen un p-value ajustado dado en la columna padj y por default considera un treshold de 0.1 para evaluar la hipótesis.

Podemos resumir los resultados con la siguiente línea de código, que proporciona información adicional.

Code
summary(res)

out of 359 with nonzero total read count
adjusted p-value < 0.1
LFC > 0 (up)       : 55, 15%
LFC < 0 (down)     : 48, 13%
outliers [1]       : 0, 0%
low counts [2]     : 139, 39%
(mean count < 6)
[1] see 'cooksCutoff' argument of ?results
[2] see 'independentFiltering' argument of ?results

Gráficas de resultados

MA plot

El MA plot representa la distribución de los coeficientes estimados en el modelo, es decir, la distribución de los genes o transcritos en las comparaciones de interés. En el eje y, la M corresponde a “minus”, es la diferencia del logaritmo de los valores que es equivalente al logaritmo del cociente. Y en el eje de de las x, A corresponde a average, que es el promedio de las cuentas normalizadas para cada gen en todas las muestras.

Este gráfico se puede generar con la función plotMA() :

Code
plotMA(res)

O bien, podemos utilizar ggplot2 para generarla y poder modificar los atributos (se muestra una versión básica):

Code
res_tibble <- mutate(res_tibble, isDE=if_else(padj<0.1, "DE", "nDE", missing="nDE"))
res_tibble$isDE <- factor(res_tibble$isDE)
ggplot(res_tibble)+
  geom_point(aes(baseMean, log2FoldChange, color=isDE), size=2, show.legend = TRUE)+
  scale_x_log10()+
  theme_bw()

También es posible generar un MA plot interactivo y gráficas de expresión para genes específicos con el package Glimma, para ello es necesario crear una variable group que corresponda a los niveles asociados al diseño experimental.

group <- colData(dds)$cell
dds$group <- group
glimmaMA(dds)
139 of 359 genes were filtered out in DESeq2 tests

Volcano plot

De manera análoga al MA plot, en el volcano plot se distinguen los genes o transcritos que muestran expresión diferencial entre líneas celulares. En las ordenadas se grafica \(-log_{10}(padj)\) y en las abscisas el log2FoldChange. Este gráfico se puede realizar por medio de la función EnhancedVolcano , a continuación se muestra el volcano plot básico.

Code
EnhancedVolcano(res,
                lab= rownames(res),
                x='log2FoldChange',
                y= 'pvalue')

También es posible utilizar el package Glimma para una versión interactiva del gráfico.

Code
glimmaVolcano(dds)

A partir de los datos podemos generar el plot con ggplot2.

Code
res_tibble <- mutate(res_tibble, neglog10padj=if_else(is.na(padj), 0, -log10(padj)))  
ggplot(res_tibble)+   
  geom_point(aes(log2FoldChange, neglog10padj, color=isDE), size=2, show.legend = TRUE)+   
  theme_bw()

Heatmap

Por medio de un heatmap con agrupamiento podemos visualizar la expresión de los genes diferencialmente expresados en términos de las cuentas normalizadas estandarizadas.

Code
# Se filtran los transcritos con expresión diferencial
significant <- res_data_frame |>  filter(log2FoldChange > 0 & padj < 0.1 |
                                   log2FoldChange < 0 & padj < 0.1)

##Se extrae la matriz de cuentas normalizadas
norm_counts <- counts(dds, normalized = T)

##Se filtran las filas que corresponden a los transcritos significativos
norm_counts <- norm_counts[rownames(significant), ]

##Generar una tabla de anotaciones que incluye el tipo de células
annotation_col <- coldata[, c("names","cell")]
##Generar el heatmap empleando clustering jerarquico
pheatmap(norm_counts, 
         border_color = NA, 
         scale = "row",
         clustering_distance_rows = "euclidean", 
         clustering_distance_cols = "euclidean", 
         clustering_method = "average", 
         show_colnames = T, 
         show_rownames = F, 
         annotation_col = annotation_col)