Hello Pymol users & coders,
I'm trying to make a class where I align two structures, it works, but
I got an (for me) unusual behavior when I use the class twice.
I have the next code:
import __main__
__main__.pymol_argv = [ 'pymol', '-qc'] # Quiet and no GUI
import pymol
import sys, time, os
class alinear:
def __init__(self, pdb1, pdb2):
pymol.finish_launching()
name_struct1 = pdb1.split('/')[-1].split('.')[0]
name_struct2 = pdb2.split('/')[-1].split('.')[0]
#Load the both structure
pymol.cmd.load(pdb1, name_struct1)
pymol.cmd.load(pdb2, name_struct2)
#align both structures
align = pymol.cmd.align(name_struct1, name_struct2)
time.sleep(1)
print "The RMSD:" + str(align[0])
#pymol.cmd.quit()
When I import the code above in other code (or on the python
interpreter), then use it, it works ok, but when I reuse the class
(Instace it again) I got another RMSD value.
What I got:
>>> import alinear3
>>> alinear3.alinear("trimero_r308A_600_ps2.pdb", "wt_600ps_trim.pdb")
The RMSD:2.28731203079
<alinear3.alinear instance at 0xb7d0a92c>
>>> alinear3.alinear("trimero_r308A_600_ps2.pdb", "wt_600ps_trim.pdb")
The RMSD:14.8970594406
<alinear3.alinear instance at 0xb7d0a9ec>
>>> asdf = alinear3.alinear("trimero_r308A_600_ps2.pdb", "wt_600ps_trim.pdb")
The RMSD:19.5648212433
>>>
I tried to use at the end of the class' constructor the
pymol.cmd.quit() method. Again, it works ok at the first instance, but
then, when I try to use my class again I got an unusual (again,
unusual for me) behavior, it just hangs out, I mean, its stay freeze,
nothing happens...
Any idea to solve this?
Regards and Thanks...
PS: Sorry if my English suck..
--
http://crosvera.blogspot.com
Carlos Ríos V.
Estudiante de Ing. (E) en Computación e Informática.
Universidad del Bío-Bío
VIII Región, Chile
Linux user number 425502
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
PyMOL-users mailing list ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]