Skip to content

Instantly share code, notes, and snippets.

@keiono
Created December 13, 2013 04:47
Show Gist options
  • Save keiono/7939893 to your computer and use it in GitHub Desktop.
Save keiono/7939893 to your computer and use it in GitHub Desktop.
Load multiple files
from java.io import File
KEGG_DIR = "/Users/kono/kegg/"
pathways = ["hsa00010.xml", "hsa00020.xml", "hsa01100.xml"]
loadNetworkTF = cyAppAdapter.get_LoadNetworkFileTaskFactory()
taskManager = cyAppAdapter.getTaskManager()
allTasks = None
for pathway in pathways:
keggfile = File(KEGG_DIR + pathway)
print str(keggfile)
itr = loadNetworkTF.createTaskIterator(keggfile)
if allTasks is None:
allTasks = itr
else:
allTasks.append(itr)
taskManager.execute(allTasks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment