Hi Kyle, the translate command has a "camera" argument, which controls whether the vector is in camera space (default) or in model space. You want model space, so you need:
PyMOL>translate [1, 0, 0], glycan*, camera=0 Cheers, Thomas Kyle Sutherland-Cash wrote, On 04/17/13 19:47: > Hello everyone, > > I've been trying to write a script to orient two particular molecules > with respect to one another. I do this by calculating a translation > vector between the two and then using cmd.translate to move the second > object to the desired location. However, this didn't seem to have the > desired effect and moved the second molecule somewhere else. > > I investigated further and tried using a translation of [1, 0, 0], which > I supposed would just alter the x coordinate of my molecule. Instead it > translated the molecule by 1A (I checked the magnitude of the actual > translation to be sure) along an arbitrary axis. This axis also changed > after deleting and recreating the object with its original coordinates. > > Am I doing something wrong, or did I not understand properly how > translate works? I've pasted some sample input/output just below. > > Thanks, > > Kyle > > ---------------------------------------- > > First time: > > PyMOL>iterate_state 1, glycan* and id 1, print x, y, z > 3.39400005341 1.43299996853 -0.0 > IterateState: iterated over 1 atom coordinate states. > PyMOL>translate [1, 0, 0], glycan* > PyMOL>iterate_state 1, glycan* and id 1, print x, y, z > 3.77618098259 2.14793467522 -0.585493266582 > IterateState: iterated over 1 atom coordinate states. > > ---------------------------------------- > > Second time: > > PyMOL>iterate_state 1, glycan* and id 1, print x, y, z > 3.39400005341 1.43299996853 -0.0 > IterateState: iterated over 1 atom coordinate states. > PyMOL>translate [1, 0, 0], glycan* > PyMOL>iterate_state 1, glycan* and id 1, print x, y, z > 2.96896576881 2.08610153198 -0.626740753651 > IterateState: iterated over 1 atom coordinate states. > > ---------------------------------------- -- Thomas Holder PyMOL Developer Schrödinger Contractor ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ 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