导出加权的igraph对象以用于NetPathMiner的Cytoscape

时间:2018-07-05 14:23:03

标签: r export igraph weighted cytoscape

我正在尝试导出用于NetPathMiner包的Cytoscape使用的igraph对象,并尝试在Cytoscape中加载它时,我得到

  

与键重相关的错误值

我正在使用的代码:

G_sub <- delete.edges( G,  E(G)[ E(G)$weight < threshold ] )
library(NetPathMiner)
plotCytoscapeGML(G_sub, file="toCytoScape.gml")

我使用以下方法构建的G

G <- graph.data.frame( rel.matrix, directed = FALSE )

其中rel.matrix是像这样的母体:

structure(list(from = c("TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "TPM1", 
"TPM1", "TPM1", "TPM1", "TPM1", "TPM1", "MT1G", "MT1G"), to = c("ACTA1", 
"TNNC2", "DBN1", "TNNT3", "DMD", "MYLPF", "MYBPC2", "PKM", "MYLK", 
"PXN", "LCP1", "MYO18A", "SPTBN1", "TMOD3", "PKD2", "SF3B1", 
"SMTN", "TMOD2", "NAA25", "VCL", "MYO5C", "TCAP", "ACTL8", "SPTAN1", 
"TMOD1", "PLS1", "ACTA2", "ACTL10", "EHBP1", "TAGLN", "ACTN4", 
"MYO5A", "COX4I1", "AHCYL1", "SEC23A", "RHOA", "MYH9", "SORBS3", 
"ACTRT1", "RAVER1", "FLNB", "NEB", "THOC1", "ACTN1", "TTN", "UQCRC2", 
"MYBPC3", "MYO5B", "MYBPC1", "SPTB", "CNN1", "ACTN2", "ACTR1B", 
"VIM", "SORD", "RAC3", "CFL1", "PFN4", "TPM3", "MYO1F", "KBTBD13", 
"SPTBN2", "MYH11", "SRXN1", "CFL2", "ACTB", "MYH7B", "MYL12A", 
"SPTA1", "MYH8", "FSCN3", "MYL4", "ACTR3B", "SLC25A4", "TNNT1", 
"VMP1", "ACTR1A", "MYH4", "ACTRT2", "MYH13", "MACF1", "MYO18B", 
"ATP5F1", "COX5A", "MYL10", "MYL12B", "TNNT2", "DSTN", "MYL3", 
"MYO1A", "PLS3", "TNNI3", "ACTL6A", "MYL6B", "MYOZ2", "NDUFB10", 
"MYH7", "RPS3", "MT2A", "MT1X"), weight = c(3.10788e-05, 5.958809e-05, 
6.384511e-05, 4.857867e-05, 3.833709e-05, 5.229225e-05, 4.924842e-05, 
3.225598e-05, 2.898718e-05, 8.135556e-06, 3.691475e-05, 5.009223e-05, 
2.241126e-05, 3.984557e-05, 4.087312e-05, 4.958667e-05, 5.482933e-05, 
7.170784e-05, 2.331922e-05, 2.8957e-05, 5.085006e-05, 4.037044e-05, 
5.287118e-05, 4.331423e-05, 4.904199e-05, 2.244811e-05, 2.444415e-05, 
3.39682e-05, 3.815621e-05, 6.097359e-05, 5.687818e-05, 5.921874e-05, 
5.489426e-05, 5.047384e-05, 4.028134e-05, 4.111754e-05, 6.317467e-05, 
4.741044e-05, 5.349051e-05, 8.419945e-05, 6.373862e-05, 2.202583e-05, 
5.292187e-05, 2.104257e-05, 3.063063e-05, 2.325379e-05, 2.897299e-05, 
5.694608e-05, 5.794348e-05, 3.419694e-05, 4.544227e-05, 5.685621e-05, 
3.70368e-05, 4.812005e-05, 4.707759e-05, 4.652025e-05, 3.1161e-05, 
2.135651e-05, 4.601607e-05, 4.217255e-05, 4.925196e-05, 2.101865e-05, 
5.812923e-05, 6.151076e-05, 3.965462e-05, 5.69303e-05, 4.145797e-05, 
4.619822e-05, 4.952048e-05, 5.969572e-05, 2.635453e-05, 2.956592e-05, 
4.576555e-05, 5.889256e-05, 5.63168e-05, 2.704127e-05, 2.10058e-05, 
4.418638e-05, 2.696945e-05, 5.0836e-05, 2.089578e-05, 3.58514e-05, 
6.042708e-05, 5.692903e-05, 5.903882e-05, 2.831509e-05, 4.728689e-05, 
2.156019e-05, 5.655941e-05, 3.334697e-05, 5.187546e-05, 6.976401e-05, 
2.068582e-05, 5.202582e-05, 4.009386e-05, 6.550041e-05, 2.20423e-05, 
5.175788e-05, 4.385124e-05, 2.531945e-05)), row.names = c(NA, 
100L), class = "data.frame")

但是更大。知道为什么我会收到此错误吗?

1 个答案:

答案 0 :(得分:1)

好吧,这似乎是NetPathMiner R软件包而不是Cytoscape的问题。这是该项目的问题跟踪器:

https://github.com/ahmohamed/NetPathMiner/issues

同时,我可以建议一种可行的替代方法。 RCy3软件包支持将igraph对象直接发送到Cytoscape,而不是导出为GML,然后必须手动导入它们。这是那个包裹:

https://bioconductor.org/packages/release/bioc/html/RCy3.html

以下是使用igraph的简短说明:

https://bioconductor.org/packages/release/bioc/vignettes/RCy3/inst/doc/Cytoscape-and-iGraph.html