<div dir="ltr">Thank you, Peter. That works.<div><br></div><div>Luwen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 7, 2015 at 5:14 PM, Peter Cock <span dir="ltr">&lt;<a href="mailto:p.j.a.cock@googlemail.com" target="_blank">p.j.a.cock@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Iuwen,<br>
<br>
Thank you for emailing us. This example looks wrong, or at least<br>
out of sync with the actual code. The handle style is also quite<br>
old (not explicitly closing the file handles).<br>
<br>
I&#39;ve not worked out what happened, but Biopython 1.65 added<br>
Bio.KEGG.REST as a new module for using the KEGG online<br>
API. This has an equivalent kegg_get function which you could<br>
use as follows:<br>
<br>
from Bio.KEGG.REST import kegg_get<br>
from Bio.KEGG import Enzyme<br>
with open(&quot;ec:5.4.2.2.txt&quot;, &quot;w&quot;) as out_handle:<br>
    out_handle.write(kegg_get(&quot;ec:5.4.2.2&quot;).read())<br>
with open(&quot;ec:5.4.2.2.txt&quot;) as in_handle:<br>
    records = list(Enzyme.parse(in_handle))<br>
record = records[0]<br>
print(record.classname)<br>
print(record.entry)<br>
<br>
Again, the output should be:<br>
<br>
[&#39;Isomerases;&#39;, &#39;Intramolecular transferases;&#39;, &#39;Phosphotransferases<br>
(phosphomutases)&#39;]<br>
5.4.2.2<br>
<br>
I&#39;ve filed an issue to remind us to look at this:<br>
<a href="https://github.com/biopython/biopython/issues/592" rel="noreferrer" target="_blank">https://github.com/biopython/biopython/issues/592</a><br>
<br>
Peter<br>
<div><div class="h5"><br>
On Fri, Aug 7, 2015 at 3:56 AM, ning luwen &lt;<a href="mailto:bioinformaticsing@gmail.com">bioinformaticsing@gmail.com</a>&gt; wrote:<br>
&gt; Dear All,<br>
&gt;<br>
&gt; I followed the tutorial<br>
&gt; <a href="http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc231" rel="noreferrer" target="_blank">http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc231</a> to learn KEGG<br>
&gt; things in biopython, but without lucky, any suggestion?<br>
&gt;<br>
&gt;&gt;&gt;&gt; from Bio import KEGG<br>
&gt;&gt;&gt;&gt; from Bio.KEGG import Enzyme<br>
&gt;&gt;&gt;&gt; request = KEGG.get(&quot;ec:5.4.2.2&quot;)<br>
&gt; Traceback (most recent call last):<br>
&gt;   File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>
&gt; AttributeError: &#39;module&#39; object has no attribute &#39;get&#39;<br>
&gt;&gt;&gt;&gt; import Bio<br>
&gt;&gt;&gt;&gt; print Bio.__version__<br>
&gt; 1.65<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; regards,<br>
&gt; luwen ning<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Biopython mailing list  -  <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
&gt; <a href="http://mailman.open-bio.org/mailman/listinfo/biopython" rel="noreferrer" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">regards,<br>luwen ning</div>
</div>