Maintaing Labels After Merging [KEGGParser, Cytoscape 3.4.0]

11 views
Skip to first unread message

Adrian Quintana

unread,
Sep 28, 2016, 3:01:31 PM9/28/16
to cytoscape-helpdesk
Hi, 

I'm currently working on merging some networks into an expansive network with quite a bit of nodes and edges. I am using KEGGParser to import the networks from KEGG (KGML format) and they already contain preconfigured labels via map attributes. My question relates to keeping the in-view labels after each merge of individual networks. As is, after each merge the labels will take the preferred layout and just be displayed at the bottom of the page. Is there a better way to maintain these labels or preconfigure better ones? 

Also, I have noticed that after merging the values contained in the table are merged and "averaged". I noticed this in the RGB color schemes where the merged network contain the mix of colors; in addition, this look to have appeared in the x,y coordinates of the some nodes. Is this correct?

Attached is the file I'm working with and a picture as reference. 

Thanks in advance. 

Adrian 


hsa05169.xml
example.png

Scooter Morris

unread,
Sep 29, 2016, 10:46:03 AM9/29/16
to cytoscape-helpdesk
Hi Adrian,



On Wednesday, September 28, 2016 at 12:01:31 PM UTC-7, Adrian Quintana wrote:
Hi, 

I'm currently working on merging some networks into an expansive network with quite a bit of nodes and edges. I am using KEGGParser to import the networks from KEGG (KGML format) and they already contain preconfigured labels via map attributes. My question relates to keeping the in-view labels after each merge of individual networks. As is, after each merge the labels will take the preferred layout and just be displayed at the bottom of the page. Is there a better way to maintain these labels or preconfigure better ones? 
 
By bottom of the page, I assume you mean the Table Panel?  If so, you can easily set up a Style to map the attribute you want to the label.  Just use a "Passthrough" mapping from the desired column to Node Label.  Note that by default, two String columns are going to get combined as a List of Strings, so you may need to massage that column into a single String.

Also, I have noticed that after merging the values contained in the table are merged and "averaged". I noticed this in the RGB color schemes where the merged network contain the mix of colors; in addition, this look to have appeared in the x,y coordinates of the some nodes. Is this correct?

I don't think they are averaged (at least not from looking at the code), but as I said above, they may be output as a list of values rather than a single float or int.

Attached is the file I'm working with and a picture as reference. 

Thanks in advance. 

Adrian 


-- scooter

Adrian Quintana

unread,
Sep 30, 2016, 11:13:20 AM9/30/16
to cytoscape...@googlegroups.com
Thank you for getting back to me. 

When I mentioned "bottom of the page" I meant the bottom of the merged network visualized network-- my apologies on the confusion. What happens is that the original network contains the predefined labels and I would like to carry them forward in the exact location where they were located before the merge (as they label certain sections of the pathway perfectly). From what I've seen this doesn't seem possible since the merged network moves all the nodes and edges in the preferred arrangement. 

Are there any other ways of keeping the labels as is or another process within Cytoscape that I've missed that would help in placing these labels accordingly. I tried annotations, but since they are not actually arranged in the table data they are not carried over. 

Your help if much appreciated. 

Adrian

--
You received this message because you are subscribed to a topic in the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cytoscape-helpdesk/9it3wTIPLCs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.
To post to this group, send email to cytoscape-helpdesk@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.

highlighted example.png

Scooter Morris

unread,
Sep 30, 2016, 12:21:26 PM9/30/16
to cytoscape...@googlegroups.com
Hi Adrian,
    Can you send me an example session file?  It sounds like the labels are using Annotations, which is something we haven't thought about with network merge.

-- scooter
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 post to this group, send email to cytoscape...@googlegroups.com.

Adrian Quintana

unread,
Sep 30, 2016, 2:35:43 PM9/30/16
to cytoscape...@googlegroups.com
I've attached the file. 

Thanks!

To unsubscribe from this group and all its topics, send an email to cytoscape-helpdesk+unsubscribe@googlegroups.com.

To post to this group, send email to cytoscape-helpdesk@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.

--
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-helpdesk+unsub...@googlegroups.com.

To post to this group, send email to cytoscape-helpdesk@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.
Merge Example.cys

Scooter Morris

unread,
Sep 30, 2016, 6:23:45 PM9/30/16
to cytoscape...@googlegroups.com
Hi Adrian,
    OK, I've looked at the file and I see your issue.  First, you need to know that those "labels" are actually nodes in Cytoscape, so any layout will move the nodes around.  There is an app called "LayoutSaver" that will allow you to map the layout of one network (e.g. your Pancreatic cancer network) onto another (e.g. Merged Network).  The problem is that if you do that for both Pancreatic and Prostate cancer, you wind up with your two pathways interspersed.  If that works for you, then layoutSaver may be a good approach. 
    Another approach is to use the X and Y values read in from the KEGGParser.  The KEGGParser actually defined X and Y for your nodes when it reads things in -- unfortunately, it defines them as strings, which is somewhat problematic for this approach.   The issue is that when you merge the networks, the columns in the merged network display both values (e.g. 407.0;251.1).  So, you need to first convert them to floating point values and then set up X and Y passthrough mappings to use them.  The net result (see attached) is kind of messy, but it does have all of the nodes and labels in the same place they were in the original networks.

-- scooter
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
MergeExample2.cys

Adrian Quintana

unread,
Oct 7, 2016, 12:48:58 PM10/7/16
to cytoscape...@googlegroups.com
I went ahead and just converted the FP numbers as suggested and this will work fine. When you mention finding something in the code of the file, where are you looking exactly? Is there a log file created; if so, how would one go about accessing it?

Thanks for your help!
Reply all
Reply to author
Forward
0 new messages