# Cytoscape Scripting with Groovy

Cytoscape is a network analysis package used quite often in systems biology. Cytoscape has scripting support for Python, Ruby, and Groovy. Or at least they say there is scripting support for Groovy, but there wasn’t a meaningful Groovy example that I could find. So I made a couple of minor changes to the Ruby example, along with logging added for debugging and, behold, an example Cytoscape Groovy script:

import cytoscape.Cytoscape;
import cytoscape.layout.CyLayouts;
import cytoscape.layout.LayoutAlgorithm;
import cytoscape.CytoscapeInit

errFile = new File("test.out").withWriter{w->
w.println "CYTOSCAPE SCRIPT LOG"

try{
props = CytoscapeInit.getProperties()
props.setProperty("layout.default", "force-directed")

new File("sampleData").eachFileMatch(~/.*\.sif/){f->
}