Error in as.igraph.vs(graph, from) : Invalid vertex names
mitchTwoTimes opened this issue · comments
Hi,
Can you please help me understand what is required for get_tf_network
? I don't understand why there would be an issue plotting if there are plenty of TF:Target interactions in my GRN.
> grnTF <- 'RFX3'
> glm_network@meta[glm_network@meta$tf == grnTF,]
# A tibble: 87 × 9
# Groups: target, tf [87]
tf target estimate n_regions n_genes n_tfs regions pval padj
<chr> <chr> <dbl> <int> <int> <int> <chr> <dbl> <dbl>
1 RFX3 ABCA1 -0.339 58 87 62 chr9-103942767-103943002;chr9-105313283-105313329;chr9-105329432-105329519 7.88e- 6 1.16e- 4
2 RFX3 ADAMTS9 0.0214 50 87 42 chr3-63688014-63688078 1.68e- 6 2.87e- 5
3 RFX3 ADGRV1 0.478 70 87 77 chr5-89498890-89498912;chr5-90017336-90017531;chr5-90548195-90548407;chr5-91730137-91730363;chr5-91875156-91875250 9.23e- 6 1.34e- 4
4 RFX3 AGBL4 -0.0201 61 87 31 chr1-47804255-47804358 3.19e- 3 2.12e- 2
5 RFX3 ANLN -0.0394 70 87 73 chr7-36037473-36037546;chr7-36986510-36986722 5.32e- 3 3.20e- 2
6 RFX3 ARHGAP22 0.0415 48 87 56 chr10-48739519-48739802 2.06e- 2 9.19e- 2
7 RFX3 ASIC2 0.0408 83 87 43 chr17-34077521-34077548 5.50e- 3 3.29e- 2
8 RFX3 CASC15 0.0750 108 87 93 chr6-22036459-22036589;chr6-22098791-22098890 8.29e-18 5.00e-16
9 RFX3 CBLB 0.218 45 87 37 chr3-104992925-104992945 6.34e-14 2.83e-12
10 RFX3 CCSER1 0.326 61 87 69 chr4-90542414-90542465 1.29e- 5 1.81e- 4
# … with 77 more rows
> proj <- get_tf_network(proj, network = "glm_network", tf = grnTF)
Getting shortest paths from TF
Error in as.igraph.vs(graph, from) : Invalid vertex names
> traceback()
5: stop("Invalid vertex names")
4: as.igraph.vs(graph, from)
3: igraph::all_shortest_paths(gene_graph, tf, features, mode = "out")
2: get_tf_network.SeuratPlus(proj, network = "glm_network", tf = grnTF)
1: get_tf_network(proj, network = "glm_network", tf = grnTF)
Thank you
Hi,
Can you please help me understand what is required for
get_tf_network
? I don't understand why there would be an issue plotting if there are plenty of TF:Target interactions in my GRN.> grnTF <- 'RFX3' > glm_network@meta[glm_network@meta$tf == grnTF,] # A tibble: 87 × 9 # Groups: target, tf [87] tf target estimate n_regions n_genes n_tfs regions pval padj <chr> <chr> <dbl> <int> <int> <int> <chr> <dbl> <dbl> 1 RFX3 ABCA1 -0.339 58 87 62 chr9-103942767-103943002;chr9-105313283-105313329;chr9-105329432-105329519 7.88e- 6 1.16e- 4 2 RFX3 ADAMTS9 0.0214 50 87 42 chr3-63688014-63688078 1.68e- 6 2.87e- 5 3 RFX3 ADGRV1 0.478 70 87 77 chr5-89498890-89498912;chr5-90017336-90017531;chr5-90548195-90548407;chr5-91730137-91730363;chr5-91875156-91875250 9.23e- 6 1.34e- 4 4 RFX3 AGBL4 -0.0201 61 87 31 chr1-47804255-47804358 3.19e- 3 2.12e- 2 5 RFX3 ANLN -0.0394 70 87 73 chr7-36037473-36037546;chr7-36986510-36986722 5.32e- 3 3.20e- 2 6 RFX3 ARHGAP22 0.0415 48 87 56 chr10-48739519-48739802 2.06e- 2 9.19e- 2 7 RFX3 ASIC2 0.0408 83 87 43 chr17-34077521-34077548 5.50e- 3 3.29e- 2 8 RFX3 CASC15 0.0750 108 87 93 chr6-22036459-22036589;chr6-22098791-22098890 8.29e-18 5.00e-16 9 RFX3 CBLB 0.218 45 87 37 chr3-104992925-104992945 6.34e-14 2.83e-12 10 RFX3 CCSER1 0.326 61 87 69 chr4-90542414-90542465 1.29e- 5 1.81e- 4 # … with 77 more rows > proj <- get_tf_network(proj, network = "glm_network", tf = grnTF) Getting shortest paths from TF Error in as.igraph.vs(graph, from) : Invalid vertex names
> traceback() 5: stop("Invalid vertex names") 4: as.igraph.vs(graph, from) 3: igraph::all_shortest_paths(gene_graph, tf, features, mode = "out") 2: get_tf_network.SeuratPlus(proj, network = "glm_network", tf = grnTF) 1: get_tf_network(proj, network = "glm_network", tf = grnTF)
Thank you
Hey, I also met the same error as you did.
Did you find solutions?
It's possible that this is because the graph is disconnected and certain nodes cannot be reached from a TF. I'll see if I can fix this to through a warning rather than an error