ps -- I thought you were just going to let the user manually rotate
and translate the surface. If you do that, you don't have to worry
about using rotateSelected. Jmol will do that for you. For that, all
you need is:
set allowrotateselected
set picking dragSelected
select protein
then instruct the user to pick an atom on the protein and LEFT-drag to
move the protein or ALT-LEFT-drag to rotate it.
With Jmol 12.1 you can catch that motion using
set atomMovedCallback "jmolScript:someFunctionNameHere()"
and do whatever you want at that point in the Jmol function
function someFunctionNameHere() {
set echo top left
echo @{"the distance is now " + distance({protein},{surface}) }
}
actually, now that I think of that, if all you want is an echo, you
can even do just this:
set allowrotateselected
set picking dragSelected
select protein
set echo top left
echo @{"the distance is now " + distance({protein},{surface}) }
because @{} in an echo forces it to be updated upon every screen write.
Bob
On Thu, Jun 23, 2011 at 11:59 AM, Robert Hanson <[email protected]
<mailto:[email protected]>> wrote:
distance from center of protein to surface is just:
x = distance({protein}.xyz , {surface}.xyz)
where "protein" and "surface" are appropriate defined.
I don't know why you would want to rotate the boundbox. Do you
really need that at all?
Rotating the protein 90 degrees about the x axis (of the
stationary surface), for example, would be:
select protein
rotateSelected internal {protein} x 90
If you want to rotate about the axes defined by the protein, then
that's a bit trickier and will require some quaternions.
Bob
On Thu, Jun 23, 2011 at 11:08 AM, Martin Hediger
<[email protected] <mailto:[email protected]>> wrote:
Dear List
I have posted a picture of the system I obtained onto my blog:
http://qmviews.blogspot.com/2011/06/jmol-002-control-over-two-structures.html
A protein structure is placed above a surface of atoms, this
is on a website that is in development.
How can I have a boundbox only around the protein?
Also, assuming the protein/box could only be rotated by 90°
around x,y,z (with some button), I guess I require to
introduce a second coordinate system only for the box, so I
know which face of the protein is oriented towards the surface
(this would then be entered into the interface for further
processing). How would I do this?
The whole purpose of this is to find the distance of the
center of bounding box from the surface, which of course is
half the side length. The question is how to figure out which
side length to consider.
Any hints are greatly appreciated.
Martin
On 15.06.11 15:32, Robert Hanson wrote:
Depends how you define "surface." If you mean "some other
group of atoms" then you can easily compute that at any time
and even display it real time. If you mean "isosurface" that,
too, might be able to be done, but I might have to add
something to make that work.
By "rotatable" I presume you mean independently of that
surface. That's not a problem, and translation is part of it.
You just use:
select protein
set allowRotateSelected TRUE
set dragSelected TRUE
Now you can use ALT-SHIFT-LEFT and ALT-LEFT to translate and
rotate the protein relative to the underlying surface atoms.
Now, say you want to update something as that happens. You
will need to use the latest development version of Jmol,
because what I describe next is not in Jmol 12.0. We have a
callback called "atomMovedCallback" that can send a message
either to Jmol or to your page JavaScript to do something. In
this case it would report the distance of "atomX" to the
nearest atom of "surfaceAtoms" where you have already defined
them as, perhaps:
atomX = {22.ca <http://22.ca>} # CA for residue 22
surfaceAtoms = {not protein}
select protein
set echo top left
set atomMovedCallback "jmolScript:checkDistance"
function checkDistance() {
Var dmin = 1e10
for (Var x in {surfaceAtoms}) {
Var d = x.distance(atomX)
if (d < dmin) { dmin = d }
}
Var s = format("%3.1f Angstroms", dmin)
echo @s
}
Something like that!
Bob Hanson
On Wed, Jun 15, 2011 at 7:13 AM, Martin Hediger
<[email protected] <mailto:[email protected]>> wrote:
Dear Jmol Users, I'm new to the Jmol list, I'm looking
forward to a nice
community interaction.
I would like to implement the following on a website:
A protein structure should be displayed and it should be
rotatable by
the user. At the same time, the distance between a given
point in the
structure (e.g. a residue alpha-C atom) and a surface
"below" the
structure should be computable (once the structure is
oriented the way
it should be. The background is that we want to model a
binding event of
a protein on a nanowire surface, so the orientation of
the molecule is
critical.
How could I achieve this?
Kind regards and thank you for answers.
Martin
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically
advanced content
authoring tool. Experience the power of Track Changes,
Inline Image
Editing and ensure content is compliant with
Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
<mailto:[email protected]>
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 <tel: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
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment
with vRanger.
Installation's a snap, and flexible recovery options mean your
data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
<mailto:[email protected]>
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 <tel: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
--
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
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users