I have been trying to combine the subgraphs preserving the original edge attributes using graph.union
function in igraph. Operation was successful but the new graph forgot its edge attributes. I have even tried the options mentioned here but it seems to me that there are some bugs.
In my work, I have used two column data as edgelist separated by tab (as delimiter).
The method I have:
tab118_FP2_9<-read.table("D:/edgelist_118.9.out", header = FALSE, sep = "\t" ,"r")
tab118_FP2_9a<-tab118_FP2_9+1 # have used python script , in which counting starts from zero , which is actually the no. one in reality
g118_FP2_9<-graph.data.frame(tab118_FP2_9a, directed =F)
tab118_FP2_3<-read.table("D:/edgelist_118.3.out", header = FALSE, sep = "\t" ,"r")
tab118_FP2_3a<-tab118_FP2_3+1 # have used python script , in which counting starts from zero , which is actually the no. one in reality
g118_FP2_3<-graph.data.frame(tab118_FP2_3a, directed =F)
g118_FP2_3<-graph.data.frame(tab118_FP2_3a, directed=F)
g118_FP2_9<-graph.data.frame(tab118_FP2_9a, directed=F)
E(g118_FP2_9)$weight<- 2
E(g118_FP2_3)$weight<- 1
E(g118_FP2_3)$color<-"red"
E(g118_FP2_9)$color<-"blue"
g118_FP2_3_9<-g118_FP2_3 %u% g118_FP2_9
Fortunately graphs got merged successfully but the original edge attributes (color and weight) is lost.
How can I send my input files?
I want to retain the edge colors of the original graphs as it is in the merged new graph.