Best way to make a graph edges shorter/ network more compact

16 views
Skip to first unread message

HizJ

unread,
Jan 20, 2020, 9:26:12 AM1/20/20
to cytoscape-helpdesk
Hi 
I am attempting to use automation to plot a network, and prefer to use the perfuse force directed layout but I find that the edge lengths are too long and the network is very scattered.
I know I can change the position of nodes by dragging them on the display, or by changing the parameters of the layout.

I was wondering is there some other way using automation to ensure that the edge lengths are as short as possible, or someway to compact the network ? 

toowide.png




Alex Pico

unread,
Jan 20, 2020, 2:36:13 PM1/20/20
to cytoscape...@googlegroups.com
Certainly. All Cytoscape-provided layouts are tunable, including Prefuse Force Directed. And tunables are supported by automation. Open up the Layout > Settings dialog to become familiar with the parameters you can tune (See video: https://www.youtube.com/watch?v=YPdbjIDD9vA).  Then open the Automation Panel (View menu) to test out your scripting syntax, e.g.,   

help layout force-directed # will display names for all parameters
layout force-directed defaultSpringLength=30. # will perform the layout with a shorter default edge length

Finally, if you are running your scripts in R, you can use the RCy3 function, like so:

layoutNetwork('force-directed defaultSpringCoefficient=0.0000005’). # will perform the layout with looser springs

Include as many tunable parameters as you like, space separated.

Hope this helps!
 - Alex



<toowide.png>





--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/0d225639-10f3-435a-891a-65a002df3fa2%40googlegroups.com.
<toowide.png>

Reply all
Reply to author
Forward
0 new messages