Hi Hasan,
if your structures are identical in sequence (same number of atoms), the
direct way for morphing would be to load them into the same object in
two states and then call rigimol.morph, like this:
from epymol import rigimol
cmd.extend('morph', rigimol.morph)
load conf1.pdb, inobj, 1
load conf2.pdb, inobj, 2
morph inobj, outobj, refinement=5
If the sequence is different or one of the structures have missing
atoms, you need to match them before creating the two-state object. I
have a script that does this, see attachment. It provides a "morpheasy"
command.
import morpheasy
load conf1.pdb
load conf2.pdb
morpheasy conf1, conf2
Hope that helps.
Cheers,
Thomas
Hasan Demirci wrote, On 01/25/12 22:37:
Hi,
In the past I was using rigimol to morph my structures.
I used to follow the path
pymol -qc prepare.pml
pymol -qc rigimol.pml
pymol domains.pml
pymol -qc refine.py
pymol view.pml
I lost my old pml files and in the current pymolv1.5 as far as I can see
rigimol (or any of the pml files) doesn't exist anymore.
I have two structures and they are dramatically different from one
another due to a mutation.
I would be grateful if you can help me with the morphing and refinement
scripts in pymolv1.5 (both windows 64 and/or linux 64 version is fine).
With my very best regards.
Hasan-
--
Thomas Holder
MPI for Developmental Biology
Spemannstr. 35
D-72076 Tübingen
'''
Simplified morphing workflow
(c) 2011 Thomas Holder
License: BSD-2-Clause
'''
from pymol import cmd
def morpheasy(source, target, source_state=0, target_state=0, name=None,
refinement=5, quiet=1):
'''
DESCRIPTION
Morph source to target, based on sequence alignment
'''
try:
from epymol import rigimol
except ImportError:
print 'No epymol available, please use a "Incentive PyMOL" build'
return
# arguments
source_state = int(source_state)
target_state = int(target_state)
source_state = int(source_state if source_state > 0 else cmd.get('state', source))
target_state = int(target_state if target_state > 0 else cmd.get('state', target))
refinement = int(refinement)
quiet = int(quiet)
# temporary objects
# IMPORTANT: cmd.get_raw_alignment does not work with underscore object names!
alnobj = cmd.get_unused_name('_aln')
so_obj = cmd.get_unused_name('source') # see above
ta_obj = cmd.get_unused_name('target') # see above
so_sel = cmd.get_unused_name('_source_sel')
ta_sel = cmd.get_unused_name('_target_sel')
cmd.create(so_obj, source, source_state, 1)
cmd.create(ta_obj, target, target_state, 1)
# align sequence
cmd.align(ta_obj, so_obj, object=alnobj, cycles=0, transform=0,
mobile_state=1, target_state=1)
cmd.select(so_sel, '%s and %s' % (so_obj, alnobj))
cmd.select(ta_sel, '%s and %s' % (ta_obj, alnobj))
alnmap = dict(cmd.get_raw_alignment(alnobj))
alnmap.update(dict((v,k) for (k,v) in alnmap.iteritems()))
# copy source atom identifiers to temporary target
idmap = dict()
cmd.iterate(so_sel, 'idmap[model,index] = (segi,chain,resi,resn,name)',
space={'idmap': idmap})
cmd.alter(ta_sel, '(segi,chain,resi,resn,name) = idmap[alnmap[model,index]]',
space={'idmap': idmap, 'alnmap': alnmap})
# remove unaligned
cmd.remove('%s and not %s' % (so_obj, so_sel))
cmd.remove('%s and not %s' % (ta_obj, ta_sel))
assert cmd.count_atoms(so_obj) == cmd.count_atoms(ta_obj)
cmd.sort(so_obj)
cmd.sort(ta_obj)
# append target to source as 2-state morph-in object
cmd.create(so_obj, ta_obj, 1, 2)
# morph
if name is None:
name = cmd.get_unused_name('morph')
rigimol.morph(so_obj, name, refinement=refinement, async=0)
# clean up
for obj in [alnobj, so_obj, so_sel, ta_obj, ta_sel]:
cmd.delete(obj)
return name
cmd.extend('morpheasy', morpheasy)
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
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