Question: Import New Edges into Pre-Existing Network in Cytoscape
0
gravatar for thorerges
4.0 years ago by
thorerges60
United States
thorerges60 wrote:

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 fileI 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 themIs there a way to do this?

 

cytoscape network • 2.5k views
ADD COMMENTlink modified 4.0 years ago by cyril-cros890 • written 4.0 years ago by thorerges60
1
gravatar for cyril-cros
4.0 years ago by
cyril-cros890
France
cyril-cros890 wrote:

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.

ADD COMMENTlink modified 4.0 years ago • written 4.0 years ago by cyril-cros890
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1321 users visited in the last hour