<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Dear all,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I am a newbie to Biopython and I would like to extract the Free R values from PDB files. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">After asking Google and browsing the Biopython document, I did not find the solution yet. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">It seems that Biopython only can read and get the resolution and journal information etc. from the header of the PDB file.</div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><a href="http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc150">http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc150</a></font><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">My question is does the Biopython able to fetch the Free R values from PDB file? Or I need to write my own script to get those values.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><b>In addition,</b> I found two mistakes in the section 11.1.1 Readin a PDB file. </font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">(1) </font></div><div class="gmail_default"><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)">>>> from Bio.PDB.PDBParser import PDBParser
>>> p = PDBParser(PERMISSIVE=1)</pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto">>>> structure_id = "1fat"
>>> filename = "pdb1fat.ent"
>>> s = p.get_structure(structure_id, filename)</pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto"><font face="arial, helvetica, sans-serif">However, the following codes do not work,</font></pre></pre></div><div class="gmail_default"><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)">>>> resolution = <span style="background-color:rgb(255,255,0)">structure</span>.header['resolution']
>>> keywords = <span style="background-color:rgb(255,255,0)">structure</span>.header['keywords']</pre></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Actually, they should be </font></div><div class="gmail_default"><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)">>>> resolution = s.header['resolution']
>>> keywords = s.header['keywords']</pre></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Because the variable, </font><font face="monospace, monospace">s</font><font face="arial, helvetica, sans-serif">, has been defined, however, </font><span style="background-color:rgb(255,255,0);color:rgb(0,0,0)">structure</span><span style="font-family:arial,helvetica,sans-serif"> did not.</span><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">(2) just below the above-mentioned example, </font></div><div class="gmail_default"><p style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">The dictionary can also be created without creating a <tt>Structure</tt> object, ie. directly from the PDB file:</p><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><font face="monospace, monospace">>>> with open(filename, 'r') as handle:
... header_dict = parse_pdb_header(handle)
...</font></pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><br></pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">However, it does not work. The error message is "name 'parse_pdb_header' is not defined ". </font></pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><b><font face="arial, helvetica, sans-serif">Actually, <span style="background-color:rgb(255,255,255)">one need to import the module </span></font><span style="background-color:rgb(255,255,255)">parse_pdb_header </span></b><font face="arial, helvetica, sans-serif"><span style="background-color:rgb(255,255,255)"><b>first</b></span>, as shown below,</font></pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto"><b style="background-color:rgb(255,255,0)"><font face="monospace, monospace">>>> from Bio.PDB import </font>parse_pdb_header</b></pre></pre></div><div class="gmail_default"><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><font face="monospace, monospace">>>> </font>with open(filename, 'r') as handle:</pre><pre class="gmail-verbatim" style="margin-left:0ex;margin-right:auto;color:rgb(0,0,0)"><font face="monospace, monospace">... header_dict = parse_pdb_header(handle)
...</font></pre><div>Then, header_dict will get the information from the PDB file.</div><div><br></div><div><br></div><div>I hope the developers will correct those mistakes in the document. Thank you very much.</div><div><br></div><div>Best wishes,</div><div>Huan</div><div>.</div><div><br></div><div><br></div></div></div>