A simple Cytoscape Groovy example
Cytoscape is a network analysis package used quite often in systems biology. Cytoscape has scripting support for Python, Ruby, and Groovy. There wasn't a meaningful Groovy example so I made a couple of minor changes to the Ruby example, along with logging added for debugging:
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->
w.println "Loading $f"
Cytoscape.createNetworkFromFile(f.canonicalPath)
Cytoscape.getCurrentNetworkView().redrawGraph(false,true)
}
}catch(Exception e){
w.println e
}
}
errFile =
Labels: bioinformatics, Cytoscape, groovy