Answers.Body: <p>BioGeek is correct, however I will post a full answer.</p>
  
  <pre><code>import pythoncyc
  # To get ec-code
  db = pythoncyc.select_organism('sco')
  reaction = db["RXN1A0-6128"]
  ec_code = reaction["ec_number"]
  
  # To get genes
  pgdb = pythoncyc.PGDB("sco")
  genes = pgdb.genes_of_reaction("RXN1A0-6128")
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-30T19:49:28.377Z
Answers.LastActivityDate: 2017-11-30T19:49:28.377Z
Answers.UserDisplayName: 5norre
Body: <p>I am trying to collect the ec-code (and gene) of a reaction. I have tried the following:</p>
  
  <pre><code>import pythoncyc
  pgdb = pythoncyc.PGDB("sco")
  r = "RXN1A0-6128"
  gene = "SCP1.233B"
  enzyme = pgdb.enzymes_of_reaction(r)
  enzyme = pgdb.enzymes_of_gene(gene)
  pgdb.full_enzyme_name(enzyme)
  </code></pre>
  
  <p>However, I only get an enzyme id, and not the ec-code, which is visible on <a href="https://biocyc.org/SCO/NEW-IMAGE?type=REACTION&amp;object=RXN1A0-6128" rel="nofollow noreferrer">biocyc</a>.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T04:28:59.903Z
Comments.Text: Have you looked at the documentation for pythoncyc?  I have not used that library before but it seems like the .full_enzyme_name() function would only return that.  Is there another function to get the ec-code?
Comments.UserDisplayName: Bioathlete
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T12:21:29.763Z
Comments.Text: It seems that `ec_number` is a key in the dictionary you get when you call [`PFrame()` with `getFrameData=True`](https://github.com/latendre/PythonCyc/blob/master/doc/tutorial.md#more-on-pframe-objects).
Comments.UserDisplayName: BioGeek
Tags: <python>
Title: Using pythoncyc to get ec-code of a reaction
ThreadText: # Using pythoncyc to get ec-code of a reaction
  
  (Asked by: username_0 on 2017-11-05)
  
  I am trying to collect the ec-code (and gene) of a reaction. I have tried the following:
  
  ```
  import pythoncyc
  pgdb = pythoncyc.PGDB("sco")
  r = "RXN1A0-6128"
  gene = "SCP1.233B"
  enzyme = pgdb.enzymes_of_reaction(r)
  enzyme = pgdb.enzymes_of_gene(gene)
  pgdb.full_enzyme_name(enzyme)
  
  ```
  
  However, I only get an enzyme id, and not the ec-code, which is visible on [biocyc](https://biocyc.org/SCO/NEW-IMAGE?type=REACTION&object=RXN1A0-6128).
  
  **Tags:** python
  
  > **Comments:**
  > **username_1**: Have you looked at the documentation for pythoncyc?  I have not used that library before but it seems like the .full_enzyme_name() function would only return that.  Is there another function to get the ec-code?  
  > **username_2**: It seems that `ec_number` is a key in the dictionary you get when you call [`PFrame()` with `getFrameData=True`](https://github.com/latendre/PythonCyc/blob/master/doc/tutorial.md#more-on-pframe-objects).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-11-30. Score: 1 | Accepted answer
  
  username_2 is correct, however I will post a full answer.
  
  ```
  import pythoncyc
  # To get ec-code
  db = pythoncyc.select_organism('sco')
  reaction = db["RXN1A0-6128"]
  ec_code = reaction["ec_number"]
  
  # To get genes
  pgdb = pythoncyc.PGDB("sco")
  genes = pgdb.genes_of_reaction("RXN1A0-6128")
  
  ```
  
  
  ---
  
  