Isn't the answer to this to compare your nodes with something other than Cynode.equal, e.g., roughly,
Pattern p = Pattern.compile("(ec[0-9 .]+)$");
Matcher m1 = p.matcher(name1);
String ec1 = m1.find() ? m1.group(1) : name1;
Matcher m2 = p.matcher(name2);
String ec2 = m2.find() ? m2.group(1) : name2;
Return (ec1 == ec2);
From: cytoscape-discuss@googlegroups.com [mailto:cytoscape-discuss@googlegroups.com] On Behalf Of Tingting
Sent: Saturday, July 04, 2009 4:32 AM
To: cytoscape-discuss@googlegroups.com
Cc: Samuel Yung
Subject: [Cytoscape-discuss] Re: [how to update the note attributes ]
Hi,
Piet, first, thank you for your quick reply and helpful suggestion.
We follow your suggestion and it works well. However, a new problem is caused by the new graph-specific id. This plugin has another function which is to compare two enzyme graphs whose nodes represent enzymes. This function is implemented by use of the equal() method of CyNode. For exmaple, the node whose id is "ec 2.2.1.3" of graph 'aae00010' is equal to the node "ec 2.2.1.3" of graph 'abc00010'. But now, in order to display the note attributes for each graph respectively, we change the node id from "ec 2.2.1.3" to "aae00010-ec 2.2.1.3". In this case, the comparison function doesn't work any more because all the node ids are unique and make none sense to the graph comparison.
To fix this problem, the most direct thought is to rewrite the equal() method of the CyNode class. But because most of the related classes inside Cytoscape directly use CyNode instance, it is not an easy work to carry on. (plus, lots of documents for Cytoscape are "documents me!". little information can be obtained. pps. hope Cytoscape can take advantage of Spring soon.)
Do anybody encounter this problem before and is there any good suggestions?
Look forward to your reply. Thanks a lot.
Regards,
Tingting
From: cytoscape-discuss@googlegroups.com [mailto:cytoscape-discuss@googlegroups.com] On Behalf Of piet molenaar
Sent: Friday, July 03, 2009 8:16 PM
To: cytoscape-discuss@googlegroups.com
Subject: [Cytoscape-discuss] Re: [how to update the note attributes ]
Hi Tingting,
This is due to the fact that in Cytoscape attributes are coupled via the unique node ID (left most attribute) and that there is one underlying graph that keeps track of mapping of attributes to id. You can solve this by making the id unique for each species: eg abc00010-ec.2.2.3
aae00010-ec.2.2.3.
To view similar enzyme you could add an additional attribute enzyme id and couple visual attributes to that one.
Hope this helps,
Piet
On Fri, Jul 3, 2009 at 1:08 PM, Tingting <grace.tingting.z...@gmail.com<mailto:grace.tingting.z...@gmail.com>> wrote:
Hi,
We are working on a plug-in to generate metabolic networks from KEGG. We met a problem when we desing the note attribute panel. Following are the details.
[Problem]: When a new graph is generated, the note attributes( genes, cpds and reactions displayed) are belonging to the new graph. When click back to the previous one, the node attribute panel refuses to display the attributes of the previous correspondingly.
[Details] here is an example.
Step 1. We generate enzyme graph for aae00010.
[cid:image001....@01CA03A5.A5A4D250]
Step 2. We generate enzyme graph for a new organism, say, abc. 'abc00010'.
[cid:image002....@01CA03A5.A5A4D250]
Step3. When we click back to see the graph of aae00010, we can find undoubtedly that the genes, cpds and reactions displayed in the note attribution panel are not belonging to aae00010 but abc00010.
[cid:image003....@01CA03A5.A5A4D250]
Step4. When we destroy the view of abc00010 graph, aae00010's node attributes are still in the same wrong way.
[cid:image004....@01CA03A5.A5A4D250]
(abc00010 on the left panel is in red means that its view is destroyed but the reconstructed network is still here)
Step5. When we destroy the view as well as the network of abc00010 graph, the note attribute is still wrong for aae00010.
[cid:image005....@01CA03A5.A5A4D250]
From the current documents provided by cytoscape, it's hard to find out which methods is responsible for switching the attributes display or destruction. Can anyone tell me how to solve this problem?
Many Thanks
Best Regards,
Tingting
--
Tingting Zhou
Bioinformatics Research Group
Beijing Proteome Research Center
Tel: +86-10-80727777-1129
--
Piet Molenaar
p.molen...@amc.uva.nl<mailto:p.molen...@amc.uva.nl>
Department of Human Genetics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands
tel (+31) 20-5666592
fax (+31) 20-6918626
--------------------------------------------------------
This message may contain confidential information. If you are not the designated recipient, please notify the sender immediately, and delete the original and any copies. Any use of the message by you is prohibited.