Creating a subnetwork that includes a certain number of hops and how merge nodes share attributes

44 views
Skip to first unread message

k.nirm...@gmail.com

unread,
Apr 4, 2017, 9:00:23 AM4/4/17
to cytoscape-helpdesk
Hi,

I am working on a PPI interaction network. I use the IntAct Database and I have a list of gene symbols (nodes) where I would like to extract the interaction information.

I have three questions:
1. Is it in someway possible to create a sub-network that includes nodes & edges that are connected with two (or 3) hops.
For example, if I have a list,
A
B
C

Then interaction DB has many interactions
A pp B
B pp C
C pp D
D pp E
E pp A
F pp G

What I would like is to be able to decide my network should include all nodes that have two hops (for example.
So, in my network then it should be

A
B
C
D
E

and the corresponding edges. (If there is any alternative way to generate this data and then if I can visualise this cytoscape, pls suggest too... Thanks!)


My Second question is.

From IntAct, I have the problem that the name and shared name or unique, while the gene symbols are the same. So I would like to merge all the gene symbols as one node and the edges should also be correspondingly merged.

Is it possible to merge interactions, for example
A pp B
A pp1 B

to 

A int B pp pp1

May be some of my questions are too basic, but I am new to Cytoscape and your help will be very much appreciated. 



Scooter Morris

unread,
Apr 4, 2017, 10:48:55 AM4/4/17
to cytoscape...@googlegroups.com
Greetings,


On 04/04/2017 06:00 AM, k.nirm...@gmail.com wrote:
Hi,

I am working on a PPI interaction network. I use the IntAct Database and I have a list of gene symbols (nodes) where I would like to extract the interaction information.

I have three questions:
1. Is it in someway possible to create a sub-network that includes nodes & edges that are connected with two (or 3) hops.
For example, if I have a list,
A
B
C

Then interaction DB has many interactions
A pp B
B pp C
C pp D
D pp E
E pp A
F pp G

What I would like is to be able to decide my network should include all nodes that have two hops (for example.
So, in my network then it should be

A
B
C
D
E

and the corresponding edges. (If there is any alternative way to generate this data and then if I can visualise this cytoscape, pls suggest too... Thanks!)

I think you mean degree (at least from your example).   A node's degree is defined as the number of neighbors of that node (i.e. the number of edges that connect this node to other nodes).  If that's what you want, the answer is yes -- it's quite easy.  You can start by calculating the degree (Tools->NetworkAnalyzer->Network Analysis).   That will create several new columns in your node table, including "Degree".  Then you can use the "Select" tab in the Control Panel to select all nodes with a particular degree.  Finally, do a "File->New->Network->From selected nodes and all edges" and you'll have your subnetwork.


My Second question is.

From IntAct, I have the problem that the name and shared name or unique, while the gene symbols are the same. So I would like to merge all the gene symbols as one node and the edges should also be correspondingly merged.

Is it possible to merge interactions, for example
A pp B
A pp1 B

to 

A int B pp pp1
Yes, you can merge the network to itself (Tools->Merge->Networks) and select the gene symbol as the Matching Column (under Advanced Options).  That will result in multiple edges, which you can merge using Edit->Remove duplicated edges.

-- scooter


May be some of my questions are too basic, but I am new to Cytoscape and your help will be very much appreciated. 



--
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.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.


Giovanni Scardoni

unread,
Apr 4, 2017, 6:53:20 PM4/4/17
to cytoscape...@googlegroups.com
Hi, 
you can use the Pesca app. You select the model and it finds the paths connecting them.



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.

--
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.

dawn ap

unread,
Apr 5, 2017, 8:33:00 AM4/5/17
to cytoscape-helpdesk
Hi,

1st question:
You can do this by going to "Select->Nodes->First neighbors of selected nodes" (shortcut Ctrl+6).
First select your nodes {A,B,C}, then do "First neighbors of selected nodes" once and you have added to your selection the 1st neighbors {D,E} (what I think you mean as 1 hop), do it again and you will include 2nd neighbors {} (there aren't any in you example).
Then do as Scooter said: "File->New->Network->From selected nodes and all edges" and you'll have your subnetwork.

As far as it concerns merging, I think Scooter is right. 
Just one note, merging multiple edges will result to:
A int B pp 
OR
A int B pp1
NOT 
A int B pp pp1

dawn

k.nirm...@gmail.com

unread,
Apr 5, 2017, 12:10:49 PM4/5/17
to cytoscape...@googlegroups.com
Thank you all for the inputs. It definitely helped. But actually what I am interested in doing is a little bit different. So, I would like rephrase perhaps my first question. 

What I have is a large network. Then I have a few selected nodes(N) such that N = {a,b,c...... n}. What I would like to do is find all OTHER nodes that connect to my selected N nodes with a distance of 2 or 3. In other words, I do not need to find all neighbours but only those neighbours that have neighbours that connect to my initial list as shown below.

  • Node a --- NeighbourX-----NeighbourY----- Node B (with a distance of 2)

Thanks a lot in advance. 

best,
Nirmal




On Wednesday, April 5, 2017 at 2:33:00 PM UTC+2, dawn ap wrote:
Hi,

1st question:
You can do this by going to "Select->Nodes->First neighbors of selected nodes" (shortcut Ctrl+6).
First select your nodes {A,B,C}, then do "First neighbors of selected nodes" once and you have added to your selection the 1st neighbors {D,E} (what I think you mean as 1 hop), do it again and you will include 2nd neighbors {} (there aren't any in you example).
Then do as Scooter said: "File->New->Network->From selected nodes and all edges" and you'll have your subnetwork.


This gives me 1st degree neighbours and 2nd degree neighbours.  

Scooter Morris

unread,
Apr 5, 2017, 12:56:01 PM4/5/17
to cytoscape...@googlegroups.com
Ah, OK, you really were talking about hops, not degree.  If you want all nodes *within* 3 hops, it's relatively easy.  If you *only* want nodes 2 or 3 hops (and not 1 hop) that's a little more difficult.  To do the former, you would select all of your nodes(N), then do "Select->Nodes->First neighbors of selected nodes" 3 times.  Now all of the nodes within 3 hops of your original nodes are selected.  If you want to exclude 1st neighbors, then you would create a subnet with only the first neighbors, then create a subnet with nodes up to 3 hops away, then do a difference using the "Tools->Merge->Networks...".

-- scooter


On 04/05/2017 09:10 AM, k.nirm...@gmail.com wrote:
Thank you all for the inputs. It definitely helped. But actually what I am interested in doing is a little bit different. So, I would like rephrase perhaps my first question. 

What I have is a large network. Then I have a few selected nodes(N) such that N = {a,b,c...... n}. What I would like to do is find all OTHER nodes that connect to my selected N nodes with a distance of 2 or 3. In other words, I do not need to find all neighbours but only those neighbours that have neighbours that connect to my initial list as shown below.

  • Node a --- NeighbourX-----NeighbourY----- Node B (with a distance of 2)

Thanks a lot in advance. 

best,
Nirmal




On Wednesday, April 5, 2017 at 2:33:00 PM UTC+2, dawn ap wrote:
Hi,

1st question:
You can do this by going to "Select->Nodes->First neighbors of selected nodes" (shortcut Ctrl+6).
First select your nodes {A,B,C}, then do "First neighbors of selected nodes" once and you have added to your selection the 1st neighbors {D,E} (what I think you mean as 1 hop), do it again and you will include 2nd neighbors {} (there aren't any in you example).
Then do as Scooter said: "File->New->Network->From selected nodes and all edges" and you'll have your subnetwork.

As far as it concerns merging, I think Scooter is right. 
Just one note, merging multiple edges will result to:
A int B pp 
OR
A int B pp1
NOT 
A int B pp pp1

dawn
--
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.

Nirmal Raman Kannaiyan

unread,
Apr 11, 2017, 4:47:11 AM4/11/17
to cytoscape...@googlegroups.com
Hi Scooter,

Could you provide any leads on to the “hops” part to only select the nodes that connect my candidate genes? When you say it is difficult, can I do it in Cytoscape or should I do it for example in R somehow?

best,
Nirmal


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/PK_GgsNUSLM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cytoscape-helpd...@googlegroups.com.

Giovanni Scardoni

unread,
Apr 11, 2017, 6:22:03 AM4/11/17
to cytoscape...@googlegroups.com
Hi,
you can use the Pesca app. You select your nodes of interest. Then you select S-P cluster option.
This gives you all the shortest paths connecting your nodes (two by two) in the large network.
If you want only the paths no longer than 2 or 3 steps, you can select them in the result panel on the right.
Giovanni

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.



--
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/PK_GgsNUSLM/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.

--
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.



--
Giovanni Scardoni
The Center for BioMedical Computing (CBMC)
www.cbmc.it/~scardonig/
University of Verona
Strada le Grazie, 15 -37134
Verona -Italy

Try these Cytoscape apps!
CentiScaPe: http://www.cbmc.it/~scardonig/centiscape/centiscape.php
Interference: http://www.cbmc.it/~scardonig/interference/Interference.php

Giovanni Scardoni

unread,
Apr 11, 2017, 6:22:45 AM4/11/17
to cytoscape...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, 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 a topic in the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cytoscape-helpdesk/PK_GgsNUSLM/unsubscribe.
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+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.
--
Giovanni Scardoni
The Center for BioMedical Computing (CBMC)
www.cbmc.it/~scardonig/
University of Verona
Strada le Grazie, 15 -37134
Verona -Italy

Try these Cytoscape apps!
CentiScaPe: http://www.cbmc.it/~scardonig/centiscape/centiscape.php
Interference: http://www.cbmc.it/~scardonig/interference/Interference.php
Reply all
Reply to author
Forward
0 new messages