This is a test version of Biostars. For the public version, visit https://www.biostars.org.
In cytoscape, how to filter all nodes and edges directly or indirectly connected with 2 certain nodes?

Dear all, I have about 5k pairs of genes, predicted to have interactions from STRING website. The data structure I got from STRING is like this:

#node1  node2   node1_string_internal_id    node2_string_internal_id    node1_external_id   node2_external_id   neighborhood_on_chromosome  gene_fusion phylogenetic_cooccurrence   homology    coexpression    experimentally_determined_interaction   database_annotated  automated_textmining    combined_score
UPF3B   CASC3   4436211 4435465 9606.ENSP00000276201    9606.ENSP00000264645    0   0   0   0   0.062   0.993   0.900   0.808   0.999
SNRPF   SNRPA   4435728 4433858 9606.ENSP00000266735    9606.ENSP00000243563    0   0   0   0   0.600   0.975   0.900   0.191   0.999
...

I want to use Cytoscape to visualize their network. After importing the data, the original network is like the following:

Network example figure

I only want all the nodes directly or indirectly connected with both gene A and gene B. So in this example, I only want gene A, B, C, E and F. Gene H, I and G are not wanted. Is there any existing tool or function in Cytoscape to realize it? Or do I need to write scripts to do the filtering? (I guess it will be very difficult and evolve lots of algorithms.

Thank you in advance.

Best, Yingzi

cytoscape

1 answer

Hi Yingzi, I have a couple of answers for you. First, you could just use the stringApp from within Cytoscape and provide it with genes A and B and you'll get exactly the network you want. However, if you want to use text file you downloaded from string-db, you could also load the entire network in Cytoscape, select gene A and gene B (either manually or using the filter tab) then select the first neighbors of those two nodes (Select->Nodes->First neighbors of selected nodes->Undirected). Now, you have all of the genes you are interested selected. Next, do a File->New Network->Selected Nodes, All Edges . That will create a network with only your selected nodes and the edges between them.

-- scooter

Log in to answer this question.