This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Select Nearest Neighbors Shared By More Than One Selected Node

Hi,

In Cytoscape it's easy to select first neighbors of selected nodes in a network. Does anybody know if there's a way to select only the first neighbors which are shared by more than one selected node (i.e. at least 2 nodes)?

Thanks!

cytoscape

2 answers

I don't know Cytoscape very well, but I think you can use the 'firstNeighbors' command to choose the nodes and then filter out neighbors shared by only one selected node? I think the usage should be:

firstNeighbors ( nodes {node array or IDs} [ ignoreFilteredOut ] {true, false} )

Please let me know if this works as I can see myself using this too...

Thanks but... hang on a second, I didn't even know there was a command line interface for Cytoscape... where am I supposed to enter that code?

Actually I was more looking for a way to do this by using the standard Cytoscape GUI. Am I missing something obvious here?

Ok, it's quite easy, just a matter of setting up a couple of filters. I have used the "Old" filters (Select --> Old filters), because the new filters interface is quite cumbersome...

  1. Create an ad-hoc filter for the nodes you're interested in (in my case genes showing differential expression (DE) in a big network). This can be done by using a numerical or string filters which looks for an attribute that only the DE genes have (create such an attribute if you don't have it in the first place).
  2. Create a topology filter for nodes that have at least 2 neighbors within distance 1 that pass filter #1.
  3. Select your network and apply filter #1 and then filter #2
  4. Create a new network from the selection
  5. done, good luck!

Log in to answer this question.