kjo
kjo

Reputation: 35301

How to automate [load + export] operation in Cytoscape?

I have ~100 *.xgmml files each specifying a different network. How can I automate the process of generating PNG image files through Cytoscape for each of these input files?

(The Cytoscape command-line options include some to load files, but I don't see any for exporting the network as an image file.)

Upvotes: 3

Views: 676

Answers (1)

Ben Lansdell
Ben Lansdell

Reputation: 31

(In cytoscape 3+) You can do domething like the following, placed either into a text file and run with cytoscape.sh -S [script file], or just entered into cytoscape once it has been opened (Tools -> Execute command file):

#Import network
network import file indexColumnTargetInteraction=1 ...
  indexColumnSourceInteraction=2 file="[full path to .xgmml file]"
#Import and set style
vizmap load file file="[full path to .xml style file]"
vizmap apply styles=[style name]
#Set layout
layout attribute-circle
#Set view to fit display
view fit content    
#Save 
view export OutputFile="[full path to output file]" options=PDF

More generally, the help command on the command line utility (Tools -> Command Line Dialog) is very useful. It lists all available commands and each command can be queried for its syntax.

Upvotes: 3

Related Questions