igraph:使用graph.edgelist而不是graph_from_data_frame时顶点名称无效[关闭]

Posted

技术标签:

【中文标题】igraph:使用graph.edgelist而不是graph_from_data_frame时顶点名称无效[关闭]【英文标题】:igraph : Invalid vertex names when using graph.edgelist and not graph_from_data_frame [closed] 【发布时间】:2022-01-14 23:30:52 【问题描述】:

根据我使用以下代码行的事实,我会收到错误。 这个很好用。

   g <- igraph::graph_from_data_frame(d.int, directed = TRUE)

我使用此方法创建 igraph 对象时出错。

   g <- igraph::graph.edgelist(as.matrix(unique(d.int[, c(1, 3)])), directed = FALSE)

错误是:

"Invalid vertex names"

为什么?

第二行使用的d.int数据框(sif格式)是:

           a.gn    b.gn                     type
24115     KLRD1    CD3G controls-state-change-of
24132     KLRD1  FCGR1A controls-state-change-of
24150     KLRD1  TYROBP          in-complex-with
28674     ITGA4   VCAM1          in-complex-with
28676     ITGA4   ITGB7          in-complex-with
28677     ITGA4   ITGAL   controls-expression-of
28678     ITGA4   ITGB1          in-complex-with
30999    TYROBP    CD3G controls-state-change-of
31018    TYROBP  FCGR1A controls-state-change-of
44607     ITGAL   ITGB2          in-complex-with
44608     ITGAL   ITGA4   controls-expression-of
69420   CD300LB  TYROBP          in-complex-with
75890       B2M  TYROBP          in-complex-with
75905       B2M    CD8A          in-complex-with
75911       B2M    CD3D          in-complex-with
75915       B2M  FCGR1A controls-state-change-of
75916       B2M KIR3DL1          in-complex-with
75919       B2M  LILRB2          in-complex-with
75941       B2M    CD3G          in-complex-with
75942       B2M    CD3G controls-state-change-of
75944       B2M   HLA-G          in-complex-with
75952       B2M   HLA-F          in-complex-with
75956       B2M  LILRB1          in-complex-with
75970       B2M   HLA-C          in-complex-with
76007       B2M  LILRA4          in-complex-with
76063       B2M   HLA-A          in-complex-with
76067       B2M KIR3DL2          in-complex-with
76086       B2M   KLRC1          in-complex-with
76087       B2M   HLA-B          in-complex-with
76100       B2M KIR2DL3          in-complex-with
76114       B2M   HLA-E          in-complex-with
76128       B2M    CD1D          in-complex-with
76129       B2M   KLRD1          in-complex-with
76130       B2M KIR2DL1          in-complex-with
76616    COL1A1  COL1A2          in-complex-with
78596      CD19    CD81          in-complex-with
78620      CD19  IFITM1          in-complex-with
78706      CD19    CD3G controls-state-change-of
78717      CD19  FCGR1A controls-state-change-of
88285     ICAM2   ITGAL          in-complex-with
88286     ICAM2   ITGB2          in-complex-with
94075     ICAM3   ITGB2          in-complex-with
94076     ICAM3   ITGAL          in-complex-with
101887     CD3D    CD8A          in-complex-with
101895     CD3D   HLA-A          in-complex-with
101915     CD3D    CD3G          in-complex-with
101916     CD3D   HLA-G          in-complex-with
101919     CD3D   HLA-B          in-complex-with
101926     CD3D   HLA-F          in-complex-with
101938     CD3D   HLA-C          in-complex-with
101961     CD3D   HLA-E          in-complex-with
109005    HLA-G  LILRB2          in-complex-with
109024    HLA-G  LILRA4          in-complex-with
109028    HLA-G  LILRB1          in-complex-with
121205     CD3G   HLA-A          in-complex-with
121225     CD3G   HLA-B          in-complex-with
121281     CD3G  FCGR1A          in-complex-with
121297     CD3G   HLA-G          in-complex-with
121306     CD3G   HLA-F          in-complex-with
121317     CD3G   HLA-C          in-complex-with
121419     CD3G   HLA-E          in-complex-with
121456     CD3G    CD8A          in-complex-with
137496     CDH1   KLRG1          in-complex-with
137498     CDH1   ITGB7          in-complex-with
150270    HLA-A  LILRB1          in-complex-with
150280    HLA-A  LILRA4          in-complex-with
150287    HLA-A KIR3DL2          in-complex-with
150296    HLA-A  LILRB2          in-complex-with
155691    CD200 CD200R1          in-complex-with
156706    ICAM1   ITGAL          in-complex-with
156707    ICAM1   ITGB2          in-complex-with
157374    KLRC1   KLRD1          in-complex-with
168591    ITGB1   VCAM1          in-complex-with
179866     CD96     PVR          in-complex-with
179910    KLRK1  TYROBP          in-complex-with
179915    KLRK1  RAET1E          in-complex-with
179921    KLRK1    CD3G controls-state-change-of
179937    KLRK1  FCGR1A controls-state-change-of
179980    KLRK1    MICB          in-complex-with
180078    KLRK1    MICA          in-complex-with
183355     CD1D    CD3G          in-complex-with
183360     CD1D    CD3D          in-complex-with
201658    ICAM4   ITGB2          in-complex-with
201659    ICAM4   ITGAL          in-complex-with
227035    HLA-C  LILRB2          in-complex-with
227037    HLA-C KIR2DL1          in-complex-with
227039    HLA-C  LILRA4          in-complex-with
227055    HLA-C  TYROBP          in-complex-with
227056    HLA-C  LILRB1          in-complex-with
227064    HLA-C KIR2DL3          in-complex-with
230227    HLA-B  LILRA4          in-complex-with
230243    HLA-B KIR3DL1          in-complex-with
230245    HLA-B  LILRB2          in-complex-with
230257    HLA-B  LILRB1          in-complex-with
230258    HLA-B  TYROBP          in-complex-with
235388   CLEC2D   KLRB1          in-complex-with
237811       C3  IFITM1          in-complex-with
237814       C3    CD19          in-complex-with
237820       C3    CD81          in-complex-with
237945    CD226     PVR          in-complex-with
257417     CD81  IFITM1          in-complex-with
264111    ICAM5   ITGAL          in-complex-with
264112    ICAM5   ITGB2          in-complex-with
285674    HLA-F  LILRB2          in-complex-with
285682    HLA-F  LILRA4          in-complex-with
285695    HLA-F  LILRB1          in-complex-with
307587     CD99   PILRA          in-complex-with
309539    HLA-E   KLRD1          in-complex-with
309589    HLA-E   KLRC1          in-complex-with
309610    HLA-E    CD3G controls-state-change-of
309628    HLA-E  FCGR1A controls-state-change-of
309629    HLA-E  LILRB2          in-complex-with
309645    HLA-E  TYROBP          in-complex-with
309653    HLA-E  LILRA4          in-complex-with
309698    HLA-E  LILRB1          in-complex-with
341342    TREM1  TYROBP          in-complex-with
342749     CD8A   HLA-B          in-complex-with
342752     CD8A   HLA-A          in-complex-with
342755     CD8A   HLA-C          in-complex-with
342756     CD8A   HLA-F          in-complex-with
342760     CD8A   HLA-G          in-complex-with
342761     CD8A   HLA-E          in-complex-with
360361   FCGR1A    NCR3          in-complex-with
241501   TYROBP   KLRD1          in-complex-with
286741    VCAM1   ITGA4          in-complex-with
286761    ITGB7   ITGA4          in-complex-with
286781    ITGB1   ITGA4          in-complex-with
446071    ITGB2   ITGAL          in-complex-with
694201   TYROBP CD300LB          in-complex-with
758901   TYROBP     B2M          in-complex-with
759051     CD8A     B2M          in-complex-with
759111     CD3D     B2M          in-complex-with
759161  KIR3DL1     B2M          in-complex-with
759191   LILRB2     B2M          in-complex-with
759411     CD3G     B2M          in-complex-with
759441    HLA-G     B2M          in-complex-with
759521    HLA-F     B2M          in-complex-with
759561   LILRB1     B2M          in-complex-with
759701    HLA-C     B2M          in-complex-with
760071   LILRA4     B2M          in-complex-with
760631    HLA-A     B2M          in-complex-with
760671  KIR3DL2     B2M          in-complex-with
760861    KLRC1     B2M          in-complex-with
760871    HLA-B     B2M          in-complex-with
761001  KIR2DL3     B2M          in-complex-with
761141    HLA-E     B2M          in-complex-with
761281     CD1D     B2M          in-complex-with
761291    KLRD1     B2M          in-complex-with
761301  KIR2DL1     B2M          in-complex-with
766161   COL1A2  COL1A1          in-complex-with
785961     CD81    CD19          in-complex-with
786201   IFITM1    CD19          in-complex-with
882851    ITGAL   ICAM2          in-complex-with
882861    ITGB2   ICAM2          in-complex-with
940751    ITGB2   ICAM3          in-complex-with
940761    ITGAL   ICAM3          in-complex-with
1018871    CD8A    CD3D          in-complex-with
1018951   HLA-A    CD3D          in-complex-with
1019151    CD3G    CD3D          in-complex-with
1019161   HLA-G    CD3D          in-complex-with
1019191   HLA-B    CD3D          in-complex-with
1019261   HLA-F    CD3D          in-complex-with
1019381   HLA-C    CD3D          in-complex-with
1019611   HLA-E    CD3D          in-complex-with
1090051  LILRB2   HLA-G          in-complex-with
1090241  LILRA4   HLA-G          in-complex-with
1090281  LILRB1   HLA-G          in-complex-with
1212051   HLA-A    CD3G          in-complex-with
1212251   HLA-B    CD3G          in-complex-with
1212811  FCGR1A    CD3G          in-complex-with
1212971   HLA-G    CD3G          in-complex-with
1213061   HLA-F    CD3G          in-complex-with
1213171   HLA-C    CD3G          in-complex-with
1214191   HLA-E    CD3G          in-complex-with
1214561    CD8A    CD3G          in-complex-with
1374961   KLRG1    CDH1          in-complex-with
1374981   ITGB7    CDH1          in-complex-with
1502701  LILRB1   HLA-A          in-complex-with
1502801  LILRA4   HLA-A          in-complex-with
1502871 KIR3DL2   HLA-A          in-complex-with
1502961  LILRB2   HLA-A          in-complex-with
1556911 CD200R1   CD200          in-complex-with
1567061   ITGAL   ICAM1          in-complex-with
1567071   ITGB2   ICAM1          in-complex-with
1573741   KLRD1   KLRC1          in-complex-with
1685911   VCAM1   ITGB1          in-complex-with
1798661     PVR    CD96          in-complex-with
1799101  TYROBP   KLRK1          in-complex-with
1799151  RAET1E   KLRK1          in-complex-with
1799801    MICB   KLRK1          in-complex-with
1800781    MICA   KLRK1          in-complex-with
1833551    CD3G    CD1D          in-complex-with
1833601    CD3D    CD1D          in-complex-with
2016581   ITGB2   ICAM4          in-complex-with
2016591   ITGAL   ICAM4          in-complex-with
2270351  LILRB2   HLA-C          in-complex-with
2270371 KIR2DL1   HLA-C          in-complex-with
2270391  LILRA4   HLA-C          in-complex-with
2270551  TYROBP   HLA-C          in-complex-with
2270561  LILRB1   HLA-C          in-complex-with
2270641 KIR2DL3   HLA-C          in-complex-with
2302271  LILRA4   HLA-B          in-complex-with
2302431 KIR3DL1   HLA-B          in-complex-with
2302451  LILRB2   HLA-B          in-complex-with
2302571  LILRB1   HLA-B          in-complex-with
2302581  TYROBP   HLA-B          in-complex-with
2353881   KLRB1  CLEC2D          in-complex-with
2378111  IFITM1      C3          in-complex-with
2378141    CD19      C3          in-complex-with
2378201    CD81      C3          in-complex-with
2379451     PVR   CD226          in-complex-with
2574171  IFITM1    CD81          in-complex-with
2641111   ITGAL   ICAM5          in-complex-with
2641121   ITGB2   ICAM5          in-complex-with
2856741  LILRB2   HLA-F          in-complex-with
2856821  LILRA4   HLA-F          in-complex-with
2856951  LILRB1   HLA-F          in-complex-with
3075871   PILRA    CD99          in-complex-with
3095391   KLRD1   HLA-E          in-complex-with
3095891   KLRC1   HLA-E          in-complex-with
3096291  LILRB2   HLA-E          in-complex-with
3096451  TYROBP   HLA-E          in-complex-with
3096531  LILRA4   HLA-E          in-complex-with
3096981  LILRB1   HLA-E          in-complex-with
3413421  TYROBP   TREM1          in-complex-with
3427491   HLA-B    CD8A          in-complex-with
3427521   HLA-A    CD8A          in-complex-with
3427551   HLA-C    CD8A          in-complex-with
3427561   HLA-F    CD8A          in-complex-with
3427601   HLA-G    CD8A          in-complex-with
3427611   HLA-E    CD8A          in-complex-with
3603611    NCR3  FCGR1A          in-complex-with

【问题讨论】:

无法重现,这里没有错误...也许您可以将d.int 共享为dput(d.int) 的输出,这样我们就可以加载与您机器上存在的数据相同的数据。 【参考方案1】:

函数igraph::graph.edgelist 有选项el,它应该是一个两列矩阵。这两列应包含边缘每一侧的节点名称(例如 from 和 to)。你做了d.int[, c(1, 3)],它选择了不是节点名称的类型。请改用d.int[, c(1, 2)]

【讨论】:

你完全正确。我在这里使用了一个示例 bioconductor.org/packages/devel/bioc/vignettes/paxtoolsr/inst/… 。但是数据框的格式与我使用的格式不同。所以我犯了一个错误,我认为在必要的地方绘制网络的交互类型。但是不...谢谢!【参考方案2】:

我认为运行时完全没有错误

g <- igraph::graph.edgelist(as.matrix(unique(d.int[, c(1, 3)])), directed = FALSE)
plot(g)


数据

> dput(d.int)
structure(list(a.gn = c("KLRD1", "KLRD1", "KLRD1", "ITGA4", "ITGA4", 
"ITGA4", "ITGA4", "TYROBP", "TYROBP", "ITGAL", "ITGAL", "CD300LB",
"B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M",
"B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M",
"B2M", "B2M", "B2M", "B2M", "COL1A1", "CD19", "CD19", "CD19",
"CD19", "ICAM2", "ICAM2", "ICAM3", "ICAM3", "CD3D", "CD3D", "CD3D",
"CD3D", "CD3D", "CD3D", "CD3D", "CD3D", "HLA-G", "HLA-G", "HLA-G",
"CD3G", "CD3G", "CD3G", "CD3G", "CD3G", "CD3G", "CD3G", "CD3G",
"CDH1", "CDH1", "HLA-A", "HLA-A", "HLA-A", "HLA-A", "CD200",
"ICAM1", "ICAM1", "KLRC1", "ITGB1", "CD96", "KLRK1", "KLRK1",
"KLRK1", "KLRK1", "KLRK1", "KLRK1", "CD1D", "CD1D", "ICAM4",
"ICAM4", "HLA-C", "HLA-C", "HLA-C", "HLA-C", "HLA-C", "HLA-C",
"HLA-B", "HLA-B", "HLA-B", "HLA-B", "HLA-B", "CLEC2D", "C3",
"C3", "C3", "CD226", "CD81", "ICAM5", "ICAM5", "HLA-F", "HLA-F",
"HLA-F", "CD99", "HLA-E", "HLA-E", "HLA-E", "HLA-E", "HLA-E",
"HLA-E", "HLA-E", "HLA-E", "TREM1", "CD8A", "CD8A", "CD8A", "CD8A",
"CD8A", "CD8A", "FCGR1A", "TYROBP", "VCAM1", "ITGB7", "ITGB1",
"ITGB2", "TYROBP", "TYROBP", "CD8A", "CD3D", "KIR3DL1", "LILRB2",
"CD3G", "HLA-G", "HLA-F", "LILRB1", "HLA-C", "LILRA4", "HLA-A",
"KIR3DL2", "KLRC1", "HLA-B", "KIR2DL3", "HLA-E", "CD1D", "KLRD1",
"KIR2DL1", "COL1A2", "CD81", "IFITM1", "ITGAL", "ITGB2", "ITGB2",
"ITGAL", "CD8A", "HLA-A", "CD3G", "HLA-G", "HLA-B", "HLA-F",
"HLA-C", "HLA-E", "LILRB2", "LILRA4", "LILRB1", "HLA-A", "HLA-B",
"FCGR1A", "HLA-G", "HLA-F", "HLA-C", "HLA-E", "CD8A", "KLRG1",
"ITGB7", "LILRB1", "LILRA4", "KIR3DL2", "LILRB2", "CD200R1",
"ITGAL", "ITGB2", "KLRD1", "VCAM1", "PVR", "TYROBP", "RAET1E",
"MICB", "MICA", "CD3G", "CD3D", "ITGB2", "ITGAL", "LILRB2", "KIR2DL1",
"LILRA4", "TYROBP", "LILRB1", "KIR2DL3", "LILRA4", "KIR3DL1",
"LILRB2", "LILRB1", "TYROBP", "KLRB1", "IFITM1", "CD19", "CD81",
"PVR", "IFITM1", "ITGAL", "ITGB2", "LILRB2", "LILRA4", "LILRB1",
"PILRA", "KLRD1", "KLRC1", "LILRB2", "TYROBP", "LILRA4", "LILRB1",
"TYROBP", "HLA-B", "HLA-A", "HLA-C", "HLA-F", "HLA-G", "HLA-E",
"NCR3"), b.gn = c("CD3G", "FCGR1A", "TYROBP", "VCAM1", "ITGB7", 
"ITGAL", "ITGB1", "CD3G", "FCGR1A", "ITGB2", "ITGA4", "TYROBP",
"TYROBP", "CD8A", "CD3D", "FCGR1A", "KIR3DL1", "LILRB2", "CD3G",
"CD3G", "HLA-G", "HLA-F", "LILRB1", "HLA-C", "LILRA4", "HLA-A",
"KIR3DL2", "KLRC1", "HLA-B", "KIR2DL3", "HLA-E", "CD1D", "KLRD1",
"KIR2DL1", "COL1A2", "CD81", "IFITM1", "CD3G", "FCGR1A", "ITGAL",
"ITGB2", "ITGB2", "ITGAL", "CD8A", "HLA-A", "CD3G", "HLA-G",
"HLA-B", "HLA-F", "HLA-C", "HLA-E", "LILRB2", "LILRA4", "LILRB1",
"HLA-A", "HLA-B", "FCGR1A", "HLA-G", "HLA-F", "HLA-C", "HLA-E",
"CD8A", "KLRG1", "ITGB7", "LILRB1", "LILRA4", "KIR3DL2", "LILRB2",
"CD200R1", "ITGAL", "ITGB2", "KLRD1", "VCAM1", "PVR", "TYROBP",
"RAET1E", "CD3G", "FCGR1A", "MICB", "MICA", "CD3G", "CD3D", "ITGB2",
"ITGAL", "LILRB2", "KIR2DL1", "LILRA4", "TYROBP", "LILRB1", "KIR2DL3",
"LILRA4", "KIR3DL1", "LILRB2", "LILRB1", "TYROBP", "KLRB1", "IFITM1",
"CD19", "CD81", "PVR", "IFITM1", "ITGAL", "ITGB2", "LILRB2",
"LILRA4", "LILRB1", "PILRA", "KLRD1", "KLRC1", "CD3G", "FCGR1A",
"LILRB2", "TYROBP", "LILRA4", "LILRB1", "TYROBP", "HLA-B", "HLA-A",
"HLA-C", "HLA-F", "HLA-G", "HLA-E", "NCR3", "KLRD1", "ITGA4",
"ITGA4", "ITGA4", "ITGAL", "CD300LB", "B2M", "B2M", "B2M", "B2M",
"B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M",
"B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "B2M", "COL1A1", "CD19",
"CD19", "ICAM2", "ICAM2", "ICAM3", "ICAM3", "CD3D", "CD3D", "CD3D",
"CD3D", "CD3D", "CD3D", "CD3D", "CD3D", "HLA-G", "HLA-G", "HLA-G",
"CD3G", "CD3G", "CD3G", "CD3G", "CD3G", "CD3G", "CD3G", "CD3G",
"CDH1", "CDH1", "HLA-A", "HLA-A", "HLA-A", "HLA-A", "CD200",
"ICAM1", "ICAM1", "KLRC1", "ITGB1", "CD96", "KLRK1", "KLRK1",
"KLRK1", "KLRK1", "CD1D", "CD1D", "ICAM4", "ICAM4", "HLA-C",
"HLA-C", "HLA-C", "HLA-C", "HLA-C", "HLA-C", "HLA-B", "HLA-B",
"HLA-B", "HLA-B", "HLA-B", "CLEC2D", "C3", "C3", "C3", "CD226",
"CD81", "ICAM5", "ICAM5", "HLA-F", "HLA-F", "HLA-F", "CD99",
"HLA-E", "HLA-E", "HLA-E", "HLA-E", "HLA-E", "HLA-E", "TREM1",
"CD8A", "CD8A", "CD8A", "CD8A", "CD8A", "CD8A", "FCGR1A"), type = c("controls-state-change-of",
"controls-state-change-of", "in-complex-with", "in-complex-with",
"in-complex-with", "controls-expression-of", "in-complex-with",
"controls-state-change-of", "controls-state-change-of", "in-complex-with", 
"controls-expression-of", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "controls-state-change-of",
"in-complex-with", "in-complex-with", "in-complex-with", "controls-state-change-of",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "controls-state-change-of", "controls-state-change-of",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "controls-state-change-of", "controls-state-change-of",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "controls-state-change-of",
"controls-state-change-of", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with", 
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with", "in-complex-with",
"in-complex-with", "in-complex-with", "in-complex-with")), class = "data.frame", row.names = c("24115",
"24132", "24150", "28674", "28676", "28677", "28678", "30999",
"31018", "44607", "44608", "69420", "75890", "75905", "75911",
"75915", "75916", "75919", "75941", "75942", "75944", "75952",
"75956", "75970", "76007", "76063", "76067", "76086", "76087",
"76100", "76114", "76128", "76129", "76130", "76616", "78596",
"78620", "78706", "78717", "88285", "88286", "94075", "94076",
"101887", "101895", "101915", "101916", "101919", "101926", "101938",
"101961", "109005", "109024", "109028", "121205", "121225", "121281",
"121297", "121306", "121317", "121419", "121456", "137496", "137498",
"150270", "150280", "150287", "150296", "155691", "156706", "156707",
"157374", "168591", "179866", "179910", "179915", "179921", "179937", 
"179980", "180078", "183355", "183360", "201658", "201659", "227035",
"227037", "227039", "227055", "227056", "227064", "230227", "230243",
"230245", "230257", "230258", "235388", "237811", "237814", "237820",
"237945", "257417", "264111", "264112", "285674", "285682", "285695",
"307587", "309539", "309589", "309610", "309628", "309629", "309645",
"309653", "309698", "341342", "342749", "342752", "342755", "342756",
"342760", "342761", "360361", "241501", "286741", "286761", "286781",
"446071", "694201", "758901", "759051", "759111", "759161", "759191",
"759411", "759441", "759521", "759561", "759701", "760071", "760631",
"760671", "760861", "760871", "761001", "761141", "761281", "761291",
"761301", "766161", "785961", "786201", "882851", "882861", "940751",
"940761", "1018871", "1018951", "1019151", "1019161", "1019191",
"1019261", "1019381", "1019611", "1090051", "1090241", "1090281",
"1212051", "1212251", "1212811", "1212971", "1213061", "1213171",
"1214191", "1214561", "1374961", "1374981", "1502701", "1502801",
"1502871", "1502961", "1556911", "1567061", "1567071", "1573741",
"1685911", "1798661", "1799101", "1799151", "1799801", "1800781",
"1833551", "1833601", "2016581", "2016591", "2270351", "2270371",
"2270391", "2270551", "2270561", "2270641", "2302271", "2302431",
"2302451", "2302571", "2302581", "2353881", "2378111", "2378141",
"2378201", "2379451", "2574171", "2641111", "2641121", "2856741",
"2856821", "2856951", "3075871", "3095391", "3095891", "3096291",
"3096451", "3096531", "3096981", "3413421", "3427491", "3427521",
"3427551", "3427561", "3427601", "3427611", "3603611"))

【讨论】:

以上是关于igraph:使用graph.edgelist而不是graph_from_data_frame时顶点名称无效[关闭]的主要内容,如果未能解决你的问题,请参考以下文章

使用igraph查找连接到顶点的所有顶点?

使用 Python 通过 igraph 分析 shapefile

用 ggtree 绘制 igraph 树对象

networkx/igraph (Python) 上的指定边长

R语言使用igraph包进行网络(network)可视化实战

igraph 和 tnet 中心性度量的差异