Re: [Jmol-users] Interpolation in animation?

2006-08-02 Thread Egon Willighagen
On Tuesday 01 August 2006 21:20, Eric Martz wrote:
 1. I would be pleased to see a simple linear interpolation option built
 into Jmol. The need for such morph animations is becoming more common as
 more structures are solved in different conformations. Having it built into
 Jmol would save a lot of time and make this kind of visualization more
 accessible to a much wider authorship.

Thanx for this elaborate discussion, though I haven't read it in detail yet. 
But I do already want to mention an concept triggered by your email, and 
might also be mentioned in your email...

Some long time ago I was discussion interpolation with someone (might have 
been Hens...?), and this someone suggested that a linear interpolation is 
fine, *especially* if done on the internal coordinates instead of the 
Eucledian ones. Using the internal coordinates ensures that bond length and 
angles are reasonable for the interpolated steps.

Egon

-- 
[EMAIL PROTECTED]
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-08-02 Thread Hens Borkent
Egon Willighagen wrote:

On Tuesday 01 August 2006 21:20, Eric Martz wrote:
  

1. I would be pleased to see a simple linear interpolation option built
into Jmol. The need for such morph animations is becoming more common as
more structures are solved in different conformations. Having it built into
Jmol would save a lot of time and make this kind of visualization more
accessible to a much wider authorship.



Thanx for this elaborate discussion, though I haven't read it in detail yet. 
But I do already want to mention an concept triggered by your email, and 
might also be mentioned in your email...

Some long time ago I was discussion interpolation with someone (might have 
been Hens...?), and this someone suggested that a linear interpolation is 
fine, *especially* if done on the internal coordinates instead of the 
Eucledian ones. Using the internal coordinates ensures that bond length and 
angles are reasonable for the interpolated steps.

  

Quite possible Egon. Our examples were about small molecules, and the 
animations often involved rotations of groups in the molecule. In these 
cases a linear interpolation of cartesian coordinates is not what you want.
Maybe the four-point spline interpolation suggested by Michael would 
work better, but we found it simpler to do the interpolation outside 
Jmol (or Chime then).
Starting from a MOPAC multi-structure file in internal coordinates, we 
use(d) a script to produce any number of intermediate structures.
This method doesn't seem practical in the case of moving proteins though.
Or do you think the sequence PDB -- internal -- interpolate -- PDB 
feasible?

Hens


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-08-01 Thread Eric Martz
I just noticed this thread. Since I've done dozens of interpolated 
animations in Chime, I'll add my 2 cents.

1. I would be pleased to see a simple linear interpolation option built 
into Jmol. The need for such morph animations is becoming more common as 
more structures are solved in different conformations. Having it built into 
Jmol would save a lot of time and make this kind of visualization more 
accessible to a much wider authorship.

2. I'm not convinced that spline smoothing or other more complicated 
options are worthwhile. When something more than a simple linear 
interpolation is needed, what is needed is usually much more complicated 
than smoothing.

In my mind, there are three categories of conformational changes from the 
perspective of visualization:

A. Small movements of a few residues that can be satisfactorily visualized 
by simply toggling back and forth between two models (empirically known, or 
theoretical). An example is the changes in antibody sidechain positions 
when antigen binds.

B. Larger movements that require interpolation (morphing) in order to 
understand the changes in conformation. The first morph I did (recoverin 
+/- calcium) illustrates such a case (URL below).

C. Huge movements that require that intermediate key frames be manually 
modeled in order to produce a useful morph. Simple linear interpolations 
may move domain in implausible directions, or move domains through one 
another. Positioning the domains in reasonable intermediate key frames, 
then interpolating between these key frames, gives a more useful result. An 
example is RNA polymerase (look for the movie and animation links at 
http://www.chem.umass.edu/~cmartin/ -- this is not in Chime or Jmol -- 
evidently they didn't publish that form?) Another dramatic example that I 
have long wanted to see done well is the inactivation of trypsin by a 
serpin. As far as I recall, it hasn't been done.

For categories B and C, a linear interpolation usually has clearly bogus 
intermediates, such as the collapse and reexpansion of domains, the 
formation of cobweb clumps of bogus covalent bonds when atoms move too 
close to each other, or the passing of one chain through another. The 
latter occurs in my recoverin morph.

These chemically impossible intermediates are still often compatible with 
a large advantage for effective comprehension of the conformational 
changes. Further, they serve to remind the viewer that the intermediates 
are not attempts to predict the true trajectory of change, but simply 
visual aids.

When one wished to go beyond linear interpolation, the next step is to do 
molecular mechanics/dynamics on the interpolated intermediates to make each 
step chemically possible. Luckily, years of work on such routines have 
been provided as a free server by Werner Krebs, Mark Gerstein, and Nat 
Echols, the Yale Morph Server (http://www.molmovdb.org/morph/). At their 
Database of Macromolecular Movements (molmovdb.org) you can also find 
hundreds of morphs done by visitors to the site, shown in Jmol or Chime or 
Protein Explorer. Doing a morph with this server takes a bit of time, so I 
always try linear interpolation first.

3. MORPH RESOURCES (not linked above):

My original Protein Morpher. This has linear and minimized interpolations 
of recoverin, integrin CD11b MIDAS domain, influenze hemagglutinin, 
calmodulin, cAMP kinase.
It is available through MolviZ.Org, or go directly to
http://www.umass.edu/microbio/chime/morpher/index.htm
Unfortunately, it ONLY WORKS IN NETSCAPE 4.8 with CHIME.

However, if you don't want to install Netscape 4.8 (instructions:
http://www.umass.edu/microbio/chime/neccsoft.htm#browsers ) and Chime, you 
can still read:

Morph Rationale and History (First? Morph):
http://www.umass.edu/microbio/chime/morpher/fs_mtop.htm

and Morphing Methods:
http://www.umass.edu/microbio/chime/morpher/morphmtd.htm

--
Protein Explorer has a control panel named NMR Models/Animation. If a 
morph is provided as an NMR-style multiple model PDB-format file, Protein 
Explorer can animate it.

As you likely appreciate, displaying an animation in Chime or Jmol means 
you can rotate it to view the animation from different perspectives, and 
change the color scheme or rendering. These are in contrast to an animated 
GIF (true movie) which has only a single color scheme, rendering, and 
perspective.

Protein Explorer has convenience buttons to use common color schemes and 
renderings for the animations.

There is a script box in which you can customize the animations.

Protein Explorer displays the animation in a separate browser window, which 
can be saved to disk. This enables the animation to be played separately, 
without Protein Explorer.

To see many examples (as animated GIFs, and as interactive PDB file 
morphs), go to ProteinExplorer.Org and at the FrontDoor, click on Morphs. 
Or go directly to
http://www.umass.edu/microbio/chime/pe_beta/pe/protexpl/morfdoc.htm
Since 

Re: [Jmol-users] Interpolation in animation?

2006-07-29 Thread Egon Willighagen
On Tuesday 25 July 2006 03:58, Miguel wrote:
  On Jul 24, 2006, at 3:37 PM, Miguel wrote:
  I suggest that if you want to add this to Jmol 10 that it may be
  easier to
  add a separate 'interpolate' step that actually calculates and
  stores the
  intermediate positions of the atoms.
 
  Would you ming elaborating a bit on this?

 As I recall, one of the problems with 'interpolation' in Jmol v9
 animations was that the locations of the atoms were not actually
 calculated and stored.

They were. Jmol v6-v9 (maybe even earlier releases, not sure when the 
interpolation was hacked in) use linear interpolation, with the goal of a 
more smooth fitting later, which I never implemented, as the linear code was 
for many application already reasonable (just don't make the time steps too 
large before before input into Jmol).

 Rather, the locations of the atoms were dynamically 
 calculated as each frame was drawn.

I'm quite sure I the interpolated frames were new extra models, instead of 
dynamic calculation. At least that is how it was originally implemented, but 
maybe I missed some recoding here...

 At the time I thought that this was too complicated ... because it meant
 that the code to calculate the position in real-world Angstrom coordinates
 was comingled with the code to transform into screen coordinates AND, to a
 certain extent, the code for rendering. Additionally, the code needed to
 know a lot about the 'model' representation, since the interpolation took
 place between two models.

The original implementation assumed all 'model's to have an equal number of 
atoms, and to be sorted equally, so that atom 1 in all frames was always the 
same atom.

I can't remember to have fiddles with real-world/screen coordinates when doing 
interpolations...

 In order to reduce this complexity I think it would be better to break
 this up into pieces. I thought about something like a separate
 'interpolate n' command where n was the number of steps to introduce
 between existing models. I was thinking that it would actually introduce
 new models. That way the interpolation code could focus on interpolation, 
 and not have to worry about screen transformation issues.

Right.

 The biggest problem that I see with this approach is that you would be
 inserting new models between existing models. That would require some
 rework of the model/frame code.

 So, as I am writing this it occurs to me that maybe the other approach
 isn't so bad. As an example of how this would work, you can take a look at
 the vibration code. That code dynamically applies the vector to adjust the
 atom position immediately before the transformation. It works well for the
 vibrations because the location of each atom is transformed individually.

 If you wanted to apply this to animations, then I think that you would
 want for the atom in frame n to be used from frame n - 0.5 to frame n
 + 0.5, where I am using a fractional frame value to represent an
 interpolated value.

 At the beginning it would be easiest to use linear interpolation between
 the two frames ... so the location of an atom at frame 1.25 would be the
 location at frame 1 + 0.25 * vector from frame 1 to frame 2.

Doesn't this double the required calculations? Two instead of one, for each 
frame? Calculation of vector(fr1, fr2) for linear interpolation is quite 
cheap, but for smoother interpolations, if we really need them (see above), 
this might be bad... but this computation time might be neglectible with the 
actual time needed for redering...

 If you could structure it this way, I think it would be best if a the
 interpolation routine was written to take 4 atom positions ... to
 interpolate between atoms n  n+1 you would also pass in frames n-1 and
 n+2. This would allow a smoother cubic spline interpolation that would
 give better results. Even if you don't implement this at the beginning,
 try to structure the code this way so that the parameters will be
 available in the future.

Sound good.

 Some other problems that always bugged me related to interpolating
 animations between frames ...
  - you will need to interpolate atom sizes as well
  - you may need to interpolate atom colors as well
  - it isn't clear to me how other atom characteristics should be handled

As Jmol v9 assumed the same atom, coloring used to be no problem... and it 
never dealt with different atom sizes depending on bonding or charge... not 
on interpolation, at least...

 I think that these things may also have pushed me towards the separate
 'interpolate' command ... because these issues potentially introduce a lot
 of complexity that would be hard to handle as part of the rendering cycle.

A separate interpolate command sounds good

 I realize that my comments may still be too hard to understand. Give some
 thought to the problem and please feel free to ask specific questions.

Egon

-- 
[EMAIL PROTECTED]
Cologne University Bioinformatics Center (CUBIC)
Blog: 

[Jmol-users] Interpolation in animation?

2006-07-24 Thread eric capps
Does 10.x support interpolation between frames in animation? I have  
heard that Jmol 9 supported this, but I can't seem to find  
information about it anywhere in 10.x. Was this feature discontinued?

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-07-24 Thread Bob Hanson
Eric,

What does that mean, interpolation between frames? I suspect the 
answer is no, and I can't imagine that Jmol 9 did it.

Bob

eric capps wrote:

Does 10.x support interpolation between frames in animation? I have  
heard that Jmol 9 supported this, but I can't seem to find  
information about it anywhere in 10.x. Was this feature discontinued?

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users
  



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-07-24 Thread eric capps
By interpolation between frames, I mean: an option, in the animation  
menu, to create a number of transition frames between two frames in  
an animation to make it look smoother. This is how it was described  
to me:

I don't know how it work under the hood, but in the jmol 9 that I  
use, when you open the Extras-Animate panel, you can check  
'interpolate between frames', and choose the number of frames that it  
will add between the ones you have loaded.

Googling it turned up this alone: http://thomas.kuehne.cn/references/ 
jmol.diff.

Weird? Maybe this was a branch that didn't catch on or something, but  
if it in fact is not implemented in Jmol 10, I could take a stab at it.

On Jul 24, 2006, at 12:33 PM, Bob Hanson wrote:

 Eric,

 What does that mean, interpolation between frames? I suspect the
 answer is no, and I can't imagine that Jmol 9 did it.

 Bob

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-07-24 Thread Miguel

 By interpolation between frames, I mean: an option, in the animation
 menu, to create a number of transition frames between two frames in
 an animation to make it look smoother. This is how it was described
 to me:

 I don't know how it work under the hood, but in the jmol 9 that I
 use, when you open the Extras-Animate panel, you can check
 'interpolate between frames', and choose the number of frames that it
 will add between the ones you have loaded.

Yes, Jmol 9 had this feature.

It did linear interpolation of atom positions between frames.

 Googling it turned up this alone: http://thomas.kuehne.cn/references/
 jmol.diff.

 Weird? Maybe this was a branch that didn't catch on or something, but
 if it in fact is not implemented in Jmol 10, I could take a stab at it.

Most of the internal architecture was redone with Jmol 10.

This feature related to animation was lost.

I suggest that if you want to add this to Jmol 10 that it may be easier to
add a separate 'interpolate' step that actually calculates and stores the
intermediate positions of the atoms.

I also suggest that you may want to consider using a spline-type
interpolation rather than a linear interpolation. I think that would give
better interpolated results in that the interpolated positions would be a
smoothed position across 4 points rather than a linear position between 2
points.


Miguel


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-07-24 Thread eric capps
On Jul 24, 2006, at 3:37 PM, Miguel wrote:
 I suggest that if you want to add this to Jmol 10 that it may be  
 easier to
 add a separate 'interpolate' step that actually calculates and  
 stores the
 intermediate positions of the atoms.

Would you ming elaborating a bit on this?

-Eric

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-07-24 Thread Miguel

 On Jul 24, 2006, at 3:37 PM, Miguel wrote:
 I suggest that if you want to add this to Jmol 10 that it may be
 easier to
 add a separate 'interpolate' step that actually calculates and
 stores the
 intermediate positions of the atoms.

 Would you ming elaborating a bit on this?

As I recall, one of the problems with 'interpolation' in Jmol v9
animations was that the locations of the atoms were not actually
calculated and stored. Rather, the locations of the atoms were dynamically
calculated as each frame was drawn.

At the time I thought that this was too complicated ... because it meant
that the code to calculate the position in real-world Angstrom coordinates
was comingled with the code to transform into screen coordinates AND, to a
certain extent, the code for rendering. Additionally, the code needed to
know a lot about the 'model' representation, since the interpolation took
place between two models.

In order to reduce this complexity I think it would be better to break
this up into pieces. I thought about something like a separate
'interpolate n' command where n was the number of steps to introduce
between existing models. I was thinking that it would actually introduce
new models. That way the interpolation code could focus on interpolation,
and not have to worry about screen transformation issues.

The biggest problem that I see with this approach is that you would be
inserting new models between existing models. That would require some
rework of the model/frame code.

So, as I am writing this it occurs to me that maybe the other approach
isn't so bad. As an example of how this would work, you can take a look at
the vibration code. That code dynamically applies the vector to adjust the
atom position immediately before the transformation. It works well for the
vibrations because the location of each atom is transformed individually.

If you wanted to apply this to animations, then I think that you would
want for the atom in frame n to be used from frame n - 0.5 to frame n
+ 0.5, where I am using a fractional frame value to represent an
interpolated value.

At the beginning it would be easiest to use linear interpolation between
the two frames ... so the location of an atom at frame 1.25 would be the
location at frame 1 + 0.25 * vector from frame 1 to frame 2.

If you could structure it this way, I think it would be best if a the
interpolation routine was written to take 4 atom positions ... to
interpolate between atoms n  n+1 you would also pass in frames n-1 and
n+2. This would allow a smoother cubic spline interpolation that would
give better results. Even if you don't implement this at the beginning,
try to structure the code this way so that the parameters will be
available in the future.


Some other problems that always bugged me related to interpolating
animations between frames ...
 - you will need to interpolate atom sizes as well
 - you may need to interpolate atom colors as well
 - it isn't clear to me how other atom characteristics should be handled

I think that these things may also have pushed me towards the separate
'interpolate' command ... because these issues potentially introduce a lot
of complexity that would be hard to handle as part of the rendering cycle.


I realize that my comments may still be too hard to understand. Give some
thought to the problem and please feel free to ask specific questions.


Miguel


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Interpolation in animation?

2006-07-24 Thread Bob Hanson
I would be interested in hearing more about what Eric means by 
interpolation. An analogy to graphic data seems appropriate. A 
distinction I would bring up is between taking a set of dots
on a graph and (a) connecting them with line segments or (b) drawing the
best-fit curve through them. In the first case you get a fairly
unsatisfying set of interpolations. In the second you get a smooth curve
at the expense of adjusting the data.

NOW, if your interest in interpolation is to just do (a) -- make a
linear interpolation between each frame -- I think that might be less 
interesting. If, on the other hand you are interested in actually 
creating a  time-based best fit curve through the data -- basically 
fitting each atom through a sequence of frames, determining a smooth 
curve, and then  redoing the frames with interpolated frames to create 
the best-fit animation, THAT might be more interesting.

Another possibility is to implement a moveto-like transition between
frames. The idea here would be that the positions you see are
interpolations of frames while the animation is running, but you can
only stop at actual frames. Starting in a given frame, something like:

FrameTo target number of interpolations per frame overall
frames_per_second

The problem there to sort out would be what to do about helixes and
such. These really should be recalculated at each point. That might be
asking for a lot, but maybe not. It's interesting that Jmol can
calculate helixes and sheets -- it doesn't need to be told where they 
are. And it's very fast.

I worry about the overhead, though. AH how to do this without
messing up the data? How about this: a special frame that gets LOADED
with atom data and it is just that animation frame that you are
seeing. One frame. Perhaps with a special number, like . (When
multiple files are loaded, then frames come in with numbers like 1001,
1002, 2001, 2002, so  wouldn't be out of the question.) You could
even define the frame number using some simple SET command. set
animationFrameNumber 

Then perhaps one could say:

frame smoothAnimation firstFrameNo lastFrameNo
interpolationsPerFrame interpolationsPerSecond otherOptions

The cool thing about this is that you could do all the manipulation you 
want -- rotations, zooming, etc. -- while the thing is playing, and it 
would work just fine. Basically the rendering/animation engine would 
work just like ever, with the data changing under it.

So my proposal would be a single frame that is a clone of the atom set 
and is loaded on the fly. I think I've successfully separated the 
rendering functions from the calculation and visibility issues. There 
are no longer any aspects of visibility that are being determined DURING 
rendering - so we can define the state of the system at any time.

If necessary, we could do a precalculation, but I suspect the real issue 
there is scalability. You can't just preload 10,000,000 atom locations, 
helix information, etc. But, on the other hand, there might be a way to 
stream this -- to save an animation in some format using the application 
and then stream it in and visualize on the fly. Moving the atoms is no 
real problem. Miguel's analogy to vibration is intriguing. One could 
define this all in terms of differences and the sequence of getting from 
frame A to frame B as, in essense, a once-through vibration vector.

Interesting idea.

Bob



eric capps wrote:

By interpolation between frames, I mean: an option, in the animation  
menu, to create a number of transition frames between two frames in  
an animation to make it look smoother. This is how it was described  
to me:

I don't know how it work under the hood, but in the jmol 9 that I  
use, when you open the Extras-Animate panel, you can check  
'interpolate between frames', and choose the number of frames that it  
will add between the ones you have loaded.

Googling it turned up this alone: http://thomas.kuehne.cn/references/ 
jmol.diff.

Weird? Maybe this was a branch that didn't catch on or something, but  
if it in fact is not implemented in Jmol 10, I could take a stab at it.

On Jul 24, 2006, at 12:33 PM, Bob Hanson wrote:

  

Eric,

What does that mean, interpolation between frames? I suspect the
answer is no, and I can't imagine that Jmol 9 did it.

Bob



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users
  




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay