This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Import New Edges into Pre-Existing Network in Cytoscape

I have a network consisting of about 500 nodes and a few thousand edges (a picture of this is attached) which I imported from a .CSV file. I have another table, containing some 200 more connections in the following format in a CSV file as well:

Gene        Connection      Gene
gene1       1               gene2
gene3       1               gene4
gene1       1               gene4

The 1's simply represent a connection in an unweighted graph between each gene pair. I would like to import these connections into Cytoscape, so each previously connected pair of nodes has 2 connections between them. Is there a way to do this?

Screenshot

network cytoscape

1 answer

Since you did not get any answer, read http://wiki.cytoscape.org/Cytoscape_User_Manual/Creating_Networks

You can import an excel/csv file to Cytoscape. The minimal configuration is two columns, source and target nodes. You can use some awk commands (or just copy paste in excel) - supposing the edges are oriented in Cytoscape, you want to create the reciprocal edge target -> source.

awk '{print $1, "\t",$3}'  yourFile.csv > file1.csv   # print the 1st and 3rd columns separated by a tabulation
​awk '{print $3,"\t",$1}'  yourFile.csv  > file2.csv   # do the reverse
cat file1.csv file2.csv > inputCytoscape.csv          # concatenate the files

You now have two different networks. Go to Cytoscape/Tools/Merge (and maybe Advanced Merge) to get a single network.

Log in to answer this question.