<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1415376317254_3857">Oh, I did that. <br></div><div id="yui_3_16_0_1_1415376317254_3859">Wasn't aware, that it did load the object of it.</div><div id="yui_3_16_0_1_1415376317254_3856" dir="ltr">Thanks.<br></div><div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Friday, November 7, 2014 10:30 AM, Vivek Rai <vivekraiiitkgp@gmail.com> wrote:<br> </font> </div> <br><br> <div class="y_msg_container">Hi Sanjeev,<br clear="none"><br clear="none">It's because of incorrect import. You have already brought all the<br clear="none">functions in local scope by importing them as `from Bio.PDB import *`<br clear="none">i.e., you can now directly use `super_imposer = Superimposer()`.<br clear="none"><br clear="none">To use the code that you had been using, you need to just do `import Bio`.<br clear="none">Vivek Rai<br clear="none"><a shape="rect" href="https://vivekiitkgp.github.io/" target="_blank">https://vivekiitkgp.github.io</a><br clear="none"><br clear="none"><div class="yqt0153660122" id="yqtfd61005"><br clear="none">On Fri, Nov 7, 2014 at 8:25 PM, Sanjeev Sariya <<a shape="rect" ymailto="mailto:s.sariya_work@ymail.com" href="mailto:s.sariya_work@ymail.com">s.sariya_work@ymail.com</a>> wrote:<br clear="none">> Hi Team,<br clear="none">><br clear="none">> I am trying to align 2 pdb files..<br clear="none">> When I try to create an object for Bio.PDB.Superimposer(), I get a strange<br clear="none">> error.<br clear="none">><br clear="none">> Langauge specs:<br clear="none">> Python version - 2.7<br clear="none">><br clear="none">> Bio.__version__ - 1.61 ## bio python version<br clear="none">><br clear="none">> My code looks like:<br clear="none">><br clear="none">> from Bio.PDB import *<br clear="none">> def alignPDB_file(refPDB, samplePDB): # function to align pdb file<br clear="none">> ref_atoms,sample_atoms=[],[]<br clear="none">><br clear="none">> ref_model=PDBParser(QUIET=True).get_structure("reference",refPDB)[0] #<br clear="none">> get the 0th model<br clear="none">> sam_model=PDBParser(QUIET=True).get_structure("sample",samplePDB)[0] #<br clear="none">> get the 0th model<br clear="none">><br clear="none">> for ref_chain in ref_model:<br clear="none">> for ref_res in ref_chain:<br clear="none">> if not "CA" in ref_res:continue<br clear="none">> else: ref_atoms.append(ref_res['CA'])<br clear="none">><br clear="none">> for sam_chain in sam_model:<br clear="none">> for sam_res in sam_chain:<br clear="none">> if not "CA" in sam_res: continue<br clear="none">> else: sample_atoms.append(sam_res['CA'])<br clear="none">><br clear="none">> #super_imposer=Bio.PDB.Superimposer()<br clear="none">> super_imposer = Bio.PDB.Superimposer()<br clear="none">><br clear="none">><br clear="none">> Error:<br clear="none">> super_imposer = Bio.PDB.Superimposer()<br clear="none">> NameError: global name 'Bio' is not defined<br clear="none">><br clear="none">> Kindly advise.<br clear="none">><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> Biopython mailing list - <a shape="rect" ymailto="mailto:Biopython@mailman.open-bio.org" href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br clear="none">> <a shape="rect" href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>