Getting Autoannotate cluster names in node table

38 views
Skip to first unread message

Balasubramaniam Namasivayam

unread,
Dec 30, 2024, 9:33:22 AM12/30/24
to cytoscape-helpdesk
Hello,
I wanted to know if there is a way to import the cluster names generated by Auto annotate app into the node table. Currently I have the `--mclCluster` which denotes the id number  of the cluster for the nodes that they belong to the respective cluster and I am interested to have the name of the cluster generated by the auto annotate tool for respective nodes. I have looked into the autoannotate documentation and seems to me there is no option. I would be grateful if you could let me know if there is an another way to do it.

Thanks and I wish you all a very happy new year in advance!!

Kind regards,

Bala

Christopher Churas

unread,
Jan 3, 2025, 2:53:54 PMJan 3
to cytoscape...@googlegroups.com
Hi,

It is complicated, but possible.
 
1) In your clustered network add a column named "clusterlabel" (as type string)

2) Create a summary network and set the node attribute aggregation for "clusterlabel" node attribute to "Cluster Label"

3) In the newly created summary network, export node table as CSV file via menu File > Export > Table as File and choose "AutoAnnotate - Summary Network default node"
    for the "Select a table to export"

4) Remove all columns from CSV file except "__mclCluster" and "clusterlabel"

5) In Cytoscape go back to the clustered network and delete the "clusterlabel" column (otherwise the import may complain)

6) Import the table to the node table of the clustered network via File > Import > Table From File

   Set "Where to import table data" to "selected networks only"
   Select the clustered network in "Network List"
   Set "Import Data" As "Node Table Columns"
   Set "Key column for networks" to __mclCluster
   In preview below set __mclCluster as key (key icon)
  
Assuming all worked the labels of the clusters should be in clusterlabel.

hope this makes sense,

chris


--
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 visit https://groups.google.com/d/msgid/cytoscape-helpdesk/a4c20517-aaa5-4fe3-95bc-1cbb54a8314bn%40googlegroups.com.

Christopher Churas

unread,
Jan 3, 2025, 2:54:44 PMJan 3
to cytoscape...@googlegroups.com
Hi,

There is a chance I missed a more obvious solution, Mike is there a better way to do this?

chris

Mike Kucera

unread,
Jan 3, 2025, 4:22:29 PMJan 3
to cytoscape...@googlegroups.com
Thanks Chris, that's probably the best way to do it.

The cluster labels are not stored in the table because you can have multiple Annotation Sets per network.

Thanks.



Balasubramaniam Namasivayam

unread,
Jan 6, 2025, 4:12:03 AMJan 6
to cytoscape-helpdesk
Hello,
Many thanks for your response. I tried the suggested solution yet I keep getting the error //Cannot invoke java.util.Set.iterator() because "unique" is null// after assigning the node attributes for  newly created `clusterlabel` (single string type) column. Assigning `None` to this column creates the summary network just fine. 

I thank you in advance for your suggestion!

Kind regards,
Bala

Mike Kucera

unread,
Jan 6, 2025, 10:29:46 AMJan 6
to cytoscape...@googlegroups.com
Hi Balasubramaniam,

I've created a new version of AutoAnnotate that has a new action that will create the column with the cluster names for each node.

Please check your email. I've sent you a link to the new version of AutoAnnotate for you to try.

Mike.


Balasubramaniam Namasivayam

unread,
Jan 6, 2025, 10:49:09 AMJan 6
to cytoscape-helpdesk
Hi Mike,

Thanks for the new version. I can confirm that it works as intended! I greatly appreciate you for this wonderful support!

Best regards,
Bala 

Reply all
Reply to author
Forward
0 new messages