reverse edge direction / clone edge properly

233 views
Skip to first unread message

Hendrik

unread,
Dec 16, 2011, 2:12:28 AM12/16/11
to cytoscape-discuss
hello cytoscape users,

i am new to cytoscape and wondered, how an edge can be
programmatically be reversed. this is an essential network operation
in my eyes (and i really need it) and could not find any hints except
this one:

http://groups.google.com/group/cytoscape-discuss/browse_thread/thread/b0759714026ea0a/

but this didn't actually helped a lot, because: how can i create a new
edge, which gets all (!) attributes of the old edge?

thanks a lot
hendrik

Mike Smoot

unread,
Dec 22, 2011, 1:04:26 PM12/22/11
to cytoscap...@googlegroups.com
Amazingly, after 6 years, that link you found is still actually good advice.

Your best bet is to simply create a new edge in the direction that you'd like and then copy the attributes.  We've got a utility class that makes copying easy:  CyAttributesUtils.copyAttributes()

One thing to note is that the root graph structure of Cytoscape means that you only need to create each edge once, so after you've created the two edges and their attributes, you should be able to add/remove the same edge without having to create it from scratch each time.


hope this helps,

Mike


hendrik

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.




--
____________________________________________________________
Michael Smoot, Ph.D.              
UCSD Department of Medicine
tel: 858-822-4756
Reply all
Reply to author
Forward
0 new messages