Skip to content

Instantly share code, notes, and snippets.

@kozo2
Forked from keiono/load_kegg.py
Last active January 1, 2016 17:29
Show Gist options
  • Save kozo2/8177896 to your computer and use it in GitHub Desktop.
Save kozo2/8177896 to your computer and use it in GitHub Desktop.
from java.io import File
KEGG_DIR = "/Users/kozo2/kegg/"
CARBOHYDRATE = "Carbohydrate"
pathwayids_for = { CARBOHYDRATE : ["00010", "00020", "00030", "00040", "00051", "00052", "00053", "00500", "00520", "00562", "00620", "00630", "00640", "00650", "00660"] }
ORGANISM = "eco"
loadNetworkTF = cyAppAdapter.get_LoadNetworkFileTaskFactory()
taskManager = cyAppAdapter.getTaskManager()
allTasks = None
for pathwayid in pathwayids_for[CARBOHYDRATE]:
kgmlpath = File(KEGG_DIR + CARBOHYDRATE + "/" + ORGANISM + pathway + ".xml")
print str(kgmlpath)
itr = loadNetworkTF.createTaskIterator(kgmlpath)
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