Hmm. I tried this myself and just clipped out the command I gave. Or so I
thought.

appendNew = true
load 2oc5.pdb
load append 1w68.pdb

zoom 9.2
frame *

select :A/2
r = [[ -0.59598154055, -0.32209352896, -0.73556900555 ], [ 0.21345024134,
-0.94661804765, 0.24156420749 ], [ 0.774109164, -0.013039573237,
0.63291782384 ]]
t = {52.748386 33.699253 167.34224} - {selected}.xyz
rotateSelected @r translate @t

So that's all set up for just the sort of alignment people should be
interested in, I think.

Note that the Jmol COMPARE command can now do 1-to-1 superposition directly.
It's true superposition, guaranteed to be best fit. And it reports standard
deviation. The compare() function also reports standard deviation, the
matrix, the translation vector, etc.

This all works provided you already have the 1-to-1 correspondence already.
Only when you are doing a true a priori alignment, where you need the
program to find the correlating atoms, do you need to use anything else.

Oh, and don't forget that the compare command is reversible. Just do this:

xyz0 = {selected}.xyz.all

before you do the move, then, after the move:

m4 = compare({selected}, xyz0)  # a 4x4 matrix

rotate selected @m4

And the atoms will come back to where they started from.

Here are some discussions of that:

http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm?topic=103
http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm?topic=110
http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm?topic=112


You might want to look into that.


On Wed, Aug 18, 2010 at 4:02 AM, Daniel Lundin
<daniel.lun...@molbio.su.se>wrote:

>
> > In addition, if you know where you want the model in the end, you can
> just
> > do this:
> >
> > rotate @r translate @t  #(rotate with TRANSLATE implies both SELECTED and
> > MOLECULAR)
> >
> though this didn't.
>
> I can't find any error messages that seems to relate to this issue, it
> looks like the command just silently fails and the structure is not moved.
>
> Otherwise this is perfect for my purpose, which is just superposition
> from data from an alignment program (matrix and vector). As long as the
> two command works it doesn't matter so much though (my scripts are auto
> generated).
>
> > where r is a matrix and t is a vector. This does a direct rotation (about
> > the center) and translation to take the selected atoms to a new location.
> > Very useful for superposition!
> >
> >
> > This is at http://chemapps.stolaf.edu/jmol/docs/examples-12/Jmol-12.zipand
> > will be incorporated into Jmol 12.0.7 and Jmol 12.1.5.
> >
> >
> >
> > Bob
> >
> /Daniel
>
> > ps -- and you can use those end-of-line backslashes if you want in Jmol
> as
> > well.
> >
> > On Mon, Aug 16, 2010 at 9:36 AM, Daniel Lundin
> > <daniel.lun...@molbio.su.se>wrote:
> >
> >> Hi,
> >>
> >> A couple of weeks ago I noticed that my scripts that rotates a structure
> >> and translates it to align with another didn't work anymore in
> >> 12.0.RC[34], but I never saw any replies (I suppose you were all busy
> >> with other issues in the release candidates). Now when I try out 12.0.6
> >> they still don't work like in (e.g.) 11.9.23. The structure isn't
> >> translated and whether it's rotated I can't tell. Are the command(s)
> >> changed in any way? I can't tell from the documentation that they are.
> >>
> >> This is a snippet from my script that loads the pdb files and does the
> >> rotation and translation:
> >>
> >> appendNew = true
> >> load 2oc5.pdb
> >> load append 1w68.pdb
> >> select :A/2
> >> # 2oc5A - 1w68A (note that the line is continued; I've inserted the
> >> # backslashes in the mail
> >> r = [[ -0.59598154055, -0.32209352896, -0.73556900555 ], [ \
> >> 0.21345024134, -0.94661804765, 0.24156420749 ], [ -0.774109164, \
> >> -0.013039573237, 0.63291782384 ]]
> >> rq = quaternion(r)
> >> t = { 174.54968533, 75.782173371, 65.591095934 }
> >> rotateSelected MOLECULAR @rq
> >> translateSelected @t
> >>
> >>
> >> /Daniel
> >>
> >> --
> >> Daniel Lundin
> >>
> >> Department of Molecular Biology&  Functional Genomics
> >> Arrhenius Laboratories for Natural Sciences
> >> Stockholm University, SE-106 91 Stockholm, Sweden
> >>
> >> tel. +46 (0)8 16 41 95, mobile: +46 (0)708 123 922, fax. +46 (0)8 16 64
> 88
> >>
> >> Email: daniel.lun...@molbio.su.se
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> This SF.net email is sponsored by
> >>
> >> Make an app they can't live without
> >> Enter the BlackBerry Developer Challenge
> >> http://p.sf.net/sfu/RIM-dev2dev
> >> _______________________________________________
> >> Jmol-users mailing list
> >> Jmol-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/jmol-users
> >>
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by
> >
> > Make an app they can't live without
> > Enter the BlackBerry Developer Challenge
> > http://p.sf.net/sfu/RIM-dev2dev
> >
> >
> >
> > _______________________________________________
> > Jmol-users mailing list
> > Jmol-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
> --
> Daniel Lundin
>
> Department of Molecular Biology & Functional Genomics
> Arrhenius Laboratories for Natural Sciences
> Stockholm University, SE-106 91 Stockholm, Sweden
>
> tel. +46 (0)8 16 41 95, mobile: +46 (0)708 123 922, fax. +46 (0)8 16 64 88
>
> Email: daniel.lun...@molbio.su.se
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to