The error is due to you not surrounding AlnAB in quotes, so python treats it as 
a variable which has not been defined.

That said, align modifies the coordinates of the existing object, the object 
created just shows the correspondence of residues used for alignment. To save 
the superimposed coordinates, you use the existing objects.

-David

> On Mar 13, 2017, at 1:31 AM, Sanaa Syed <sanaasye...@gmail.com> wrote:
> 
> Hello,
> Can somebody please help me with creating aligned object using pymol API? i 
> want   to split chains from my protein and superimpose first chain on the 
> rest. the chains get loaded. and superimposed as well but i am unable to save 
> superimposed coordinates in a new file because no object is created.  this is 
> my script:
> list1=["chain_A","chain_B","chain_C","chain_D"]
> for every in list1:
>         cmd.load("/home/sanaa/pymol/"+every+".pdb")
> object_list=cmd.get_object_list()
> aligned=[ ]
> list2=[ ]
> #object=string(alignedA_B)
> for j in range(len(object_list)):
>        try:
>                         
> aligned=cmd.align(object_list[0],object_list[j+1],object=AlnAB)
>                         list2.append(aligned)
>         except IndexError:
>                 pass
> 
> this is giving me name error like:
> NameError: name 'AlnAB' is not defined
> 
> the object is not being created after calling the align command. it creates 
> an object if i give the command directly on  pymol command line but not 
> through the script. i have tried everything. please help!
> ------------------------------------------------------------------------------
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to