Hi everybody!!
I am a master student who is trying to do something apparently simple: import a network, import a table, apply color from the attribute table and export a PNG of that table. But, I need to do it +9000 times. So, I really need to automatize the process.
So, I would like to write a "for loop" in Python in order to obtain a script with the command lines for the Command Line Dialog in Cytoscape. It sounds good! Not difficult! Lets start from the beggining in order you could see how I am working.(Ill let the 2 .txt files in order you could test the code, using just a simple 3 nodes network).
i) First of all, we can write the following command if we have a .txt with 2 columns:
network import file delimiters=";" file="insert a path here" indexColumnSourceInteraction=1 firstRowasColumnNames=false indexColumnSourceInteraction=1 indexColumnTargetInteraction=2
(You can use network1.txt that I uploaded)
Doing that, we obtain the first network and we can repeat it easily just by changing the name of the .txt data. (for instance: import network1.txt, network2.txt and so on).
ii) Now, we are going to import the table data. I am going to use the following command line:
table import file delimiters=";" file="insert a path here" keyColumnIndex=1 startLoadRow=1 firstRowAsColumnNames=false
(You can use table1.txt that I uploaded)
As you can see at this point, we obtain a table... an empty table! Do you know why does it happen? Ill really appreciate any help you could bring it to me.
*I know that we can do it via Py2Cytoscape or using R but I would like to do it in this way.