Grouping nodes close together in an automated fashion

46 views
Skip to first unread message

Sean So

unread,
Jan 22, 2025, 5:07:38 AMJan 22
to cytoscape-helpdesk
Hi Cytoscape users,

I'm a new user learning how to do visualisations with Cytoscape. Primarily, my goal at present is to try and recapitulate visualisations of phosphoproteomic networks in a manner similar to the PhosphoPath app, which appears to no longer be actively maintained and does not work on the latest Cytoscape versions.

I've gotten as far as changing the size of nodes based on node properties and the type of edge line based on edge labels, but I have so far been unable to recapitulate the image linked above using some test edge weights in Edge-weighted Force-directed/Spring-embedded layouts.

Has anyone got any experience with this kind of visualisation, or could point me in the right direction?

Not sure if this would be helpful at all, but I have supplied a sample network table and node attribute table below. Items with edge labels "SiteToProt" should ideally be very close together in space.

Thank you for any advice you can offer,
Sean
sample_node_attr.csv
sample_network.csv

Scooter Morris

unread,
Jan 22, 2025, 11:19:07 PMJan 22
to cytoscape-helpdesk
Hi Sean,

I used a Prefuse Force Directed and set the edge weight column to EdgeWeight and used "noramlized value" for the weight interpretation and got pretty much what I would have expected.  Edges with weight 100 are much shorter than edges with weight 1.

-- scooter

Sean So

unread,
Jan 23, 2025, 12:55:32 AMJan 23
to cytoscape-helpdesk
Hi Scooter,

Thank you for your help! This does work for this smaller test case but in a larger network the phosphosites are still a bit too far from the parent node, even when weights are set to a very high value (1e9)... 

One potential solution I was thinking of would be to treat each parent node + its phosphosites (nodes connected by edges with weight 100) as a single unit, plot all units in isolation (such that they had edges of equal length, and very short), and then have Cytoscape calculate distances/edges only between these representative units. Sounds rather complicated but is this a possibility?

I have played around with grouping manually but did not see a way to achieve a way to achieve this. I did find that if I grouped nodes and replotted the network, Cytoscape recalculated edges between groups and respected the internal network structure within each collapsed group, but I'm still struggling to more precisely control edge lengths within each group to more closely represent phosphosites almost like satellites of the parent node.

Please let me know if you have any further advice, and thank you for your help so far!
Sean

Sean So

unread,
Jan 23, 2025, 1:02:47 AMJan 23
to cytoscape-helpdesk
Just as I sent that message above, I realised that I can achieve a nice visualisation within each group by using the circular layout, but with the caveats that (1) I need at least 3 nodes (sensibly), and (2) I am still unsure how to apply this to each group in isolation in an automated fashion. I will keep looking around, and would still love some help resolving some of these problems, if possible.

Thank you!
Sean
Reply all
Reply to author
Forward
0 new messages