0

I have a large igraph where the vertex of interest were extracted, then out of that subgraph, nodes with the description of interest were extracted. Now I want to extract the edges with attributes corresponding to those nodes with the description of interest.

I tried with edges.table <- E(subgraphGRN)[from(genes$Names)] but I would like to get the attributes as well. Any suggestions?

Biocrazy
  • 403
  • 2
  • 15
  • https://stackoverflow.com/questions/39918955/display-edge-label-only-when-hovering-over-it-with-cursor-visnetwork-igraph – nak5120 May 22 '18 at 13:42
  • this would be with visnetwork though which I think you'll like better – nak5120 May 22 '18 at 13:43
  • Thanks for your suggestion but since I am thinking to implement a webpage for this script, I don't want to jump between packages. The less I have to update packages, the better. That's why I prefer to stick to `igraph` – Biocrazy May 22 '18 at 13:52
  • When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick May 22 '18 at 15:07

1 Answers1

1

maybe E(subgraphGRN)[[from(genes$Names)]] with double brackets. Double brackets provides you with all the information of the edge vector.

Also, maybe E(subgraphGRN)[[from(genes$Names)]] %>% subgraph.edges(graph = subgraphGRN, eids = .) %>% as_data_frame() if you want to use the information for non-graph processing.

struggles
  • 825
  • 5
  • 10