Entering edit mode
9.6 years ago
jolespin
▴
150
I'm following the documentation on http://pythonhosted.org/Orange-Bioinformatics/reference/kegg.html
I want to get an iterable for all the KEGG reaction IDs for a particular organism.
I chose my organism by:
#!/usr/bin/python
import Orange
from Orange.bio.kegg import *
#Organism
genome = KEGGGenome()
genome_ids = genome.keys()
org_query = 'Escherichia coli K-12 MG1655'
org_id = None
for id in genome_ids:
species = genome[id].definition
if species == org_query:
org_id = id
break
organism = Organism(org_id) #T00007
org_code = organism.org_code #eco
I was able to get all the genes by:
#Genes
genes = organism.genes
gene_ids = genes.keys()
for id in gene_ids:
print id, genes[id].definition​
I got all of the pathway ids by:
#Pathways 1
pathways = organism.pathways()
for id in pathways:
print id​
To get the pathway ids and names, I had to:
#Pathways 2
for path in Orange.bio.kegg.pathways(org_id):
print path.entry_id, path.definition​
I'm trying to get the reaction ids and reaction names but I can't seem to get it to work. I started by creating the following object but I couldn't seem to get anything out of it.
#Reactions
reactions = Orange.bio.kegg.databases.Reaction()