-
Notifications
You must be signed in to change notification settings - Fork 0
/
7.2.hub_and_betweeness_genes.R
488 lines (317 loc) · 18.9 KB
/
7.2.hub_and_betweeness_genes.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
#
#7.2.hub_and_betweeness_genes.R
#This script makes an analysis of hub genes and high betweeness genes
#Libraries --- ---
pacman::p_load('igraph',
'ggplot2',
'dplyr',
'gridExtra',
'biomaRt',
"ggVennDiagram",
"ClusterProfiler")
library("org.Hs.eg.db", character.only = TRUE)
#Get data --- ---
graphAD <- read_graph(file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/ROSMAP_RNAseq_DLPFC_AD_MutualInfograph_percentile99.99.graphml',
format = 'graphml')
graphnoAD <- read_graph(file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/ROSMAP_RNAseq_DLPFC_noAD_MutualInfograph_percentile99.99.graphml',
format = 'graphml')
graphs <- list(graphAD = graphAD,
graphnoAD = graphnoAD)
#Define similarity of Enriched Processes, Jaccard Index function --- ---
jaccard_simplex <- function(a,b){
length(intersect(a,b))/length(union(a,b))
}
#Identify hub genes --- ---
#Calculate degree of nodes
nodes_degree <- sapply(X = graphs, FUN = degree)
#Table of degree distribution
degree_distribution <- list()
for (i in 1:length(nodes_degree)) {
# Aplicar cluster_infomap a cada grafo y almacenar el resultado en results_list
degree_distribution[[i]] <- data.frame(gene = names(nodes_degree[[i]]), degree = nodes_degree[[i]])
}
#Calculate percentile 95 of genes with higher degree ---- ---
q_threshold.de <- list()
for (i in 1:length(nodes_degree)) {
# Aplicar cluster_infomap a cada grafo y almacenar el resultado en results_list
q_threshold.de[[i]] <- quantile(nodes_degree[[i]], probs = 0.95)
}
#Hub genes --- ---
#Hub genes for AD patients
hub_genes_AD <- V(graphAD)$name[nodes_degree[[1]] > q_threshold.de[[1]]]
hub_genes_AD <- nodes_degree[[1]][hub_genes_AD]
hub_genes_AD <- data.frame(ensembl_gene_id = names(hub_genes_AD), degree = hub_genes_AD)
hub_genes_AD_trad <- convert_ens_to_symbol(hub_genes_AD)
hub_genes_AD <- hub_genes_AD %>% left_join(hub_genes_AD_trad, by= "ensembl_gene_id")
#Order by degree
hub_genes_AD <- hub_genes_AD[order(hub_genes_AD$degree, decreasing = TRUE), ]
#Plot hub genes for AD
#Df
hub_genes_AD.df <- data.frame(ensembl_gene_id = names(nodes_degree[[1]]), degree = nodes_degree[[1]])
hub_genes_AD.df$hub_gene <- ifelse(hub_genes_AD.df$ensembl_gene_id %in% hub_genes_AD$ensembl_gene_id, "Hub Gene", "Not Hub Gene")
#Translate again
hub_genes_AD.df_trads <- convert_ens_to_symbol(hub_genes_AD.df$ensembl_gene_id)
hub_genes_AD.df <- hub_genes_AD.df %>% left_join(hub_genes_AD.df_trads, by= "ensembl_gene_id")
#Order factors for plotting
chrom_order <- c(1:22, "X", "MT")
hub_genes_AD.df$chromosome_name <- factor(hub_genes_AD.df$chromosome_name, levels = chrom_order)
#p
hub_genes_AD.p <- ggplot(hub_genes_AD.df,
aes(x = chromosome_name, y = degree, color = hub_gene)) +
geom_text(data = subset(hub_genes_AD.df, hub_gene == "Hub Gene"), aes(label = external_gene_name),
color = 'black', hjust = 0.5, vjust = -0.8, size = 3, check_overlap = TRUE) + # Añadir etiquetas solo para los "hub genes"
geom_point(size = 3) +
theme(axis.text.x = element_blank(), legend.position = "none") +
labs(x = "Genes", y = "Degree", title = "Degree of Genes", subtitle = "with hub genes (95%) indicated in patients with pathological AD") +
scale_color_manual(values = c("Hub Gene" = "#8B3A3A", "Not Hub Gene" = "#1874CD")) +
theme_light()
#Enrichment of the hub genes
hub_genes_AD_enrichment <- enrichGO(
gene = hub_genes_AD$external_gene_name,
OrgDb = org.Hs.eg.db,
keyType = 'SYMBOL',
readable = TRUE,
ont = "BP", #type of GO(Biological Process (BP), cellular Component (CC), Molecular Function (MF)
pvalueCutoff = 0.05,
qvalueCutoff = 0.10)
barplot(hub_genes_AD_enrichment)
#For no AD patients --- ---
#Hub genes --- ---
#Hub genes for AD patients
hub_genes_noAD <- V(graphnoAD)$name[nodes_degree[[2]] > q_threshold.de[[2]]]
hub_genes_noAD <- nodes_degree[[2]][hub_genes_noAD]
hub_genes_noAD <- data.frame(ensembl_gene_id = names(hub_genes_noAD), degree = hub_genes_noAD)
hub_genes_noAD_trad <- convert_ens_to_symbol(hub_genes_noAD)
hub_genes_noAD <- hub_genes_noAD %>% left_join(hub_genes_noAD_trad, by= "ensembl_gene_id")
hub_genes_noAD <- hub_genes_noAD[order(hub_genes_noAD$degree, decreasing = TRUE), ]
#Plot hub genes for AD
#Df
hub_genes_noAD.df <- data.frame(ensembl_gene_id = names(nodes_degree[[2]]), degree = nodes_degree[[2]])
hub_genes_noAD.df$hub_gene <- ifelse(hub_genes_noAD.df$ensembl_gene_id %in% hub_genes_noAD$ensembl_gene_id, "Hub Gene", "Not Hub Gene")
#Translate again
hub_genes_AD.df_trads <- convert_ens_to_symbol(hub_genes_noAD.df$ensembl_gene_id)
hub_genes_noAD.df <- hub_genes_noAD.df %>% left_join(hub_genes_AD.df_trads, by= "ensembl_gene_id")
#p
#Order factors for plotting
hub_genes_noAD.df$chromosome_name <- factor(hub_genes_noAD.df$chromosome_name, levels = chrom_order)
hub_genes_noAD.p <- ggplot(hub_genes_noAD.df,
aes(x = chromosome_name, y = degree, color = hub_gene)) +
geom_text(data = subset(hub_genes_noAD.df, hub_gene == "Hub Gene"), aes(label = external_gene_name),
color = 'black', hjust = 0.5, vjust = -0.8, size = 3, check_overlap = TRUE) + # Añadir etiquetas solo para los "hub genes"
geom_point(size = 3) +
theme(axis.text.x = element_blank(), legend.position = "none") +
labs(x = "Chromosoe", y = "Degree", title = "Degree of Genes", subtitle = "with hub genes (95%) indicated in patients without pathological AD") +
scale_color_manual(values = c("Hub Gene" = "#8B3A3A", "Not Hub Gene" = "#1874CD")) +
theme_light()
#Enrichment
hub_genes_noAD_enrichment <- enrichGO(
gene = hub_genes_noAD$external_gene_name,
OrgDb = org.Hs.eg.db,
keyType = 'SYMBOL',
readable = TRUE,
ont = "BP", #type of GO(Biological Process (BP), cellular Component (CC), Molecular Function (MF)
pvalueCutoff = 0.05,
qvalueCutoff = 0.10)
#Enrichment table
hub_genes_noAD_enrichment.df <- as.data.frame(hub_genes_noAD_enrichment@result)
#Enrichment plot
barplot(hub_genes_noAD_enrichment)
#Grid both plots --- ---
grid_hub_genes <- grid.arrange(hub_genes_AD.p, hub_genes_noAD.p)
#Save plot
#
# ggsave("/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/ROSMAP_RNA-seq_DLFPC_NIA_reagan_hub_genes.png",
# grid_hub_genes, width = 20, height = 10, dpi = 300)
#Analysis of hub genes --- ---
#What genes do both networks share?
shared_hub_genes <- intersect(hub_genes_AD$external_gene_name, hub_genes_noAD$external_gene_name)
venn.hub <- venn.diagram(
x = list(AD = hub_genes_AD$external_gene_name, noAD = hub_genes_noAD$external_gene_name),
filename = NULL,
fill = c("red", "blue"),
alpha = 0.5,
cex = 2,
cat.cex = 2,
cat.pos = 0
)
ggVennDiagram(list(AD = hub_genes_AD$external_gene_name, noAD = hub_genes_noAD$external_gene_name)) +
scale_fill_gradient(low = "#F4FAFE", high = "#4981BF") +
theme(legend.position = "none")
# Genes in AD but not in noAD
hub_gene_AD <- hub_gene_AD %>% left_join(hub_genes_AD.df, by = "ensembl_gene_id")
hub_genes_noAD <- hub_genes_noAD <- hub_genes_noAD %>% left_join(hub_genes_noAD.df, by = "ensembl_gene_id")
#
genes_en_AD_no_noAD_sym <- setdiff(hub_genes_AD$external_gene_name, hub_genes_noAD$external_gene_name)
genes_en_AD_no_noAD_ens<- setdiff(hub_genes_AD$ensembl_gene_id, hub_genes_noAD$ensembl_gene_id)
#Enrichment of genes_en_AD_no_noAD_sym
genes_en_AD_no_noAD_sym
genes_en_AD_no_noAD_sym_enrichment <- enrichGO(
gene = genes_en_AD_no_noAD_sym,
OrgDb = "org.Hs.eg.db",
keyType = 'SYMBOL',
readable = TRUE,
ont = "BP", #type of GO(Biological Process (BP), cellular Component (CC), Molecular Function (MF)
pvalueCutoff = 0.05,
qvalueCutoff = 0.10)
#table of enrichment
genes_en_AD_no_noAD_sym_enrichment.df <- as.data.frame(genes_en_AD_no_noAD_sym_enrichment@result)
#Enrichment plots
barplot(genes_en_AD_no_noAD_sym_enrichment, showCategory=10)
dotplot(genes_en_AD_no_noAD_sym_enrichment, showCategory=10)
cnetplot(genes_en_AD_no_noAD_sym_enrichment, circular = TRUE, colorEdge = TRUE)
#
pathview(gene.data = genes_en_AD_no_noAD_ens, pathway.id="hsa05014", #AD
species = "hsa", gene.idtype=gene.idtype.list[3])
#Save hub genes to explore them in the partitions
#write(genes_en_AD_no_noAD_ens, file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/genes_en_AD_no_noAD_ens.txt')
#Comparison of hub genes not found in healthy people
genes_en_AD_no_noAD.df <- hub_gene_AD %>% filter(external_gene_name %in% genes_en_AD_no_noAD_sym)
dim(genes_en_AD_no_noAD.df)
#[1] 25 6
#Network of hub genes in the AD graph but not in the noAD graph
indexed_ver <- which(V(graphAD)$name %in% genes_en_AD_no_noAD_ens)
genes_en_AD_no_noAD.g <- induced_subgraph(graphAD, indexed_ver)
plot(genes_en_AD_no_noAD.g)
#Translate vertex names
xgenes_en_AD_no_noAD.g <- translate_vertex_names(genes_en_AD_no_noAD.g)
plot(xgenes_en_AD_no_noAD.g)
#Save graph
#
# write_graph(xgenes_en_AD_no_noAD.g, file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/ROSMAP_RNAseq_DLPFC_hub_genes_AD_noAD_trad.graphml',
# format = "graphml")
#Similitud de procesos biologicos de cada hub gene
hub_genes_AD_enrichment
hub_genes_noAD_enrichment
#Comparison of enrichments
ComparisonEnrichedProcessJ_hubs <- jaccard_simplex(names(hub_genes_AD_enrichment@geneSets), names(hub_genes_noAD_enrichment@geneSets))
#[1] 0.8768494
################################################################################
#Identify high betweenness nodes --- ---
betweenness_values <- sapply(X = graphs, FUN = betweenness)
#Tables of betweenness distribution
betweeness_distribution <- list()
for (i in 1:length(betweenness_values)) {
# Aplicar cluster_infomap a cada grafo y almacenar el resultado en results_list
betweeness_distribution[[i]] <- data.frame(gene = names(betweenness_values[[i]]), degree = betweenness_values[[i]])
}
#List to sabe quantile thresholds
q_threshold.be <- list()
for (i in 1:length(betweenness_values)) {
q_threshold.be[[i]] <- quantile(betweenness_values[[i]], probs = 0.95)
}
#Plot betweeness distribution
AD_be_distribution <- ggplot(betweeness_distribution[[1]], aes(x = degree, y = ..density..)) +
geom_histogram(binwidth = 1, fill = "#00688B", color = "black") +
labs(title = "Betweeness distribution histogram",
subtitle = "for patients with AD",
x = "Betweeness", y = "Freq") +
geom_vline(xintercept = q_threshold.be[[1]], color = "red", linetype = "dashed") +
geom_text(aes(x = q_threshold.be[[1]], y = 0.06, label = "95th percentile"), color = "red", hjust = -0.1) +
theme_minimal()
noAD_be_distribution <- ggplot(betweeness_distribution[[2]], aes(x = degree, y = ..density..)) +
geom_histogram(binwidth = 1, fill = "#00688B", color = "black") +
labs(title = "Betweeness distribution histogram",
subtitle = "for patients with no AD",
x = "Betweeness", y = "Freq") +
geom_vline(xintercept = q_threshold.be[[2]], color = "red", linetype = "dashed") +
geom_text(aes(x = q_threshold.be[[2]], y = 0.06, label = "95th percentile"), color = "red", hjust = -0.1) +
theme_minimal()
grid.arrange(AD_be_distribution, noAD_be_distribution)
#High betweeness nodes for AD patients --- ---
high_betweenness_nodes_AD <- V(graphAD)$name[betweenness_values[[1]] > q_threshold.be[[1]]]
high_betweenness_nodes_AD <- betweenness_values[[1]][high_betweenness_nodes_AD]
high_betweenness_nodes_AD <- data.frame(ensembl_gene_id = names(high_betweenness_nodes_AD), betweenness_values = high_betweenness_nodes_AD)
# Convert ENSMBL a SYMBOL
high_betweenness_nodes_AD_trad <- convert_ens_to_symbol(high_betweenness_nodes_AD$ensembl_gene_id)
# Merge gene names traduction
high_betweenness_nodes_AD <- high_betweenness_nodes_AD %>% left_join(high_betweenness_nodes_AD_trad, by = "ensembl_gene_id")
high_betweenness_nodes_AD <- high_betweenness_nodes_AD[order(high_betweenness_nodes_AD$betweenness_values, decreasing = TRUE), ]
#Plot --- ---
#df
#Create data frame
high_betweenness_nodes_AD.df <- data.frame(ensembl_gene_id = names(betweenness_values[[1]]), betweeness = betweenness_values[[1]])
#Add check column
high_betweenness_nodes_AD.df$high_betweenness <- ifelse(high_betweenness_nodes_AD.df$ensembl_gene_id %in% high_betweenness_nodes_AD$ensembl_gene_id, "High betweeness Gene", "Not High betweeness Gene")
dim(high_betweenness_nodes_AD.df)
#Translate again
high_betweenness_nodes_AD.df_trads <- convert_ens_to_symbol(high_betweenness_nodes_AD.df$ensembl_gene_id)
#Paste both dfs
high_betweenness_nodes_AD.df <- high_betweenness_nodes_AD.df %>% left_join(high_betweenness_nodes_AD.df_trads, by = "ensembl_gene_id")
#Arrange chromosome names in order
high_betweenness_nodes_AD.df$chromosome_name <- factor(high_betweenness_nodes_AD.df$chromosome_name, levels = chrom_order)
#p
high_betweenness_nodes_AD.p <- ggplot(high_betweenness_nodes_AD.df,
aes(x = chromosome_name, y = betweeness, color = high_betweenness)) +
geom_text(data = subset(high_betweenness_nodes_AD.df, high_betweenness == "High betweeness Gene"), aes(label = external_gene_name),
color = 'black', hjust = 1.1, vjust = 0.2, size = 3) + # Añadir etiquetas solo para los "hub genes"
geom_point(size = 3) +
scale_fill_manual(values = c("High betweeness Gene" = "red", "Other" = "blue")) + # Definir los colores para las categorías
theme(axis.text.x = element_blank(),legend.position = "none") + # Rotar las etiquetas del eje x
labs(x = "Chromosome", y = "Betweeness", title = "Betweeness of Genes", subtitle = "with central genes indicated in patients with pathological AD") +
scale_color_manual(values = c("High betweeness Gene" = "#8B3A3A", "Not High betweeness Gene" = "#1874CD")) +
theme_light()
high_betweenness_nodes_AD.p
#High betweeness nodes for noAD patients --- ---
high_betweenness_nodes_noAD <- V(graphnoAD)$name[betweenness_values[[2]] > q_threshold.be[[2]]]
high_betweenness_nodes_noAD <- betweenness_values[[2]][high_betweenness_nodes_noAD]
high_betweenness_nodes_noAD <- data.frame(ensembl_gene_id = names(high_betweenness_nodes_noAD), betweenness_values = high_betweenness_nodes_noAD)
high_betweenness_nodes_noAD <- high_betweenness_nodes_noAD[order(high_betweenness_nodes_noAD$betweenness_values, decreasing = TRUE), ]
# Convert ENSMBL a SYMBOL
traductions_be_noAD <- convert_ens_to_symbol(high_betweenness_nodes_noAD$ensembl_gene_id)
# Merge gene names traduction
high_betweenness_nodes_noAD <- high_betweenness_nodes_noAD %>% left_join(traductions_be_noAD, by = "ensembl_gene_id")
high_betweenness_nodes_noAD <- high_betweenness_nodes_noAD[order(high_betweenness_nodes_noAD$betweenness_values, decreasing = TRUE), ]
#Plot --- ---
#df
#Create data frame
high_betweenness_nodes_noAD.df <- data.frame(ensembl_gene_id = names(betweenness_values[[2]]), betweeness = betweenness_values[[2]])
#Add check column
high_betweenness_nodes_noAD.df$high_betweenness <- ifelse(high_betweenness_nodes_noAD.df$ensembl_gene_id %in% high_betweenness_nodes_noAD$ensembl_gene_id, "High betweeness Gene", "Not High betweeness Gene")
#Translate again
high_betweenness_nodes_noAD.df_trads <- convert_ens_to_symbol(high_betweenness_nodes_noAD.df)
#Paste both dfs
high_betweenness_nodes_noAD.df <- high_betweenness_nodes_noAD.df %>% left_join(high_betweenness_nodes_noAD.df_trads, by = "ensembl_gene_id")
#Arrange chromosome names in order
high_betweenness_nodes_noAD.df$chromosome_name <- factor(high_betweenness_nodes_noAD.df$chromosome_name, levels = chrom_order)
#p
high_betweenness_nodes_noAD.p <- ggplot(high_betweenness_nodes_noAD.df,
aes(x = chromosome_name, y = betweeness, color = high_betweenness)) +
geom_text(data = subset(high_betweenness_nodes_noAD.df, high_betweenness == "High betweeness Gene"), aes(label = external_gene_name),
color = 'black', hjust = 1.1, vjust = 0.2, size = 3) + # Añadir etiquetas solo para los "hub genes"
geom_point(size = 3) +
scale_fill_manual(values = c("High betweeness Gene" = "red", "Other" = "blue")) + # Definir los colores para las categorías
theme(axis.text.x = element_blank(),legend.position = "none") + # Rotar las etiquetas del eje x
labs(x = "Chromosome", y = "Betweeness", title = "Betweeness of Genes", subtitle = "with central genes indicated in patients without pathological AD") +
scale_color_manual(values = c("High betweeness Gene" = "#8B3A3A", "Not High betweeness Gene" = "#1874CD")) +
theme_light()
high_betweenness_nodes_noAD.p
#Grid both plots
grid_high_be_genes <- grid.arrange(high_betweenness_nodes_AD.p, high_betweenness_nodes_noAD.p)
# #Save plot
# ggsave("/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/ROSMAP_RNA-seq_DLFPC_NIA_reagan_high_be_genes.png",
# grid_high_be_genes, width = 20, height = 10, dpi = 300)
#What genes do both networks share?
shared_high_be_genes <- intersect(high_betweenness_nodes_AD$external_gene_name, high_betweenness_nodes_noAD$external_gene_name)
#
high_be_genes_en_AD_no_noAD_sym <- setdiff(high_betweenness_nodes_AD$external_gene_name, high_betweenness_nodes_noAD$external_gene_name)
high_be_genes_en_AD_no_noAD_ens<- setdiff(high_betweenness_nodes_AD$ensembl_gene_id, high_betweenness_nodes_noAD$ensembl_gene_id)
#Comparison of hub genes not found in healthy people
high_be_genes_en_AD_no_noAD.df <- high_betweenness_nodes_AD %>% filter(external_gene_name %in% high_be_genes_en_AD_no_noAD_sym)
high_be_genes_en_AD_no_noAD.df <- high_be_genes_en_AD_no_noAD.df[order(high_be_genes_en_AD_no_noAD.df$betweenness_values, decreasing = TRUE), ]
dim(high_be_genes_en_AD_no_noAD.df)
#[1] 66 5
#Network of hub genes in the AD graph but not in the noAD graph --- ---
indexed_ver_be <- which(V(graphAD)$name %in% high_be_genes_en_AD_no_noAD_ens)
high_be_genes_en_AD_no_noAD.g <- induced_subgraph(graphAD, indexed_ver_be)
plot(high_be_genes_en_AD_no_noAD.g)
#Translate gene names in graph --- ---
xhigh_be_genes_en_AD_no_noAD.g <- translate_vertex_names(high_be_genes_en_AD_no_noAD.g)
#Save graph
# write_graph(xhigh_be_genes_en_AD_no_noAD.g, file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/ROSMAP_RNAseq_DLPFC_high_be_genes_AD_noAD.graphml',
# format = "graphml")
#NEXT QUESTION IS What modules do these genes belong to? --- ---
#Save hub genes to explore them in the partitions
#write(genes_en_AD_no_noAD_ens, file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/genes_en_AD_no_noAD_ens.txt')
#Save high betweeness genes to explore them in the partitions
#write(high_be_genes_en_AD_no_noAD_ens, file = '/datos/rosmap/data_by_counts/ROSMAP_counts/counts_by_tissue/DLFPC/counts_by_NIA_Reagan/graphs_NIA_Reagan/high_be_genes_en_AD_no_noAD_ens.txt')
#END