<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Ryan,<div><span class="Apple-tab-span" style="white-space:pre"> </span>Unfortunately, coordinates are the only attribute that works on a per-frame basis. We hope to remedy that in Chimera 2, but we are nowhere near even an alpha release of Chimera 2 so that isn't really relevant here. If you only need this for movie recording and your machine has a lot of memory relative to the size of these trajectories, then what you can do is sort of a riff on your workaround 2: open the trajectory <i>both</i> as submodels and with MD Movie and copy the anisoU attribute on an as-needed basis with the per-frame scripting capability of MD Movie (Per-Frame/Define Script). Here's a Python script you could use in the Define Script dialog to do the copying:</div><div><br></div><div><div>from chimera import openModels, Molecule</div><div>mols = openModels.list(modelTypes=[Molecule])</div><div>for m in mols:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if m.subid == mdInfo['frame']:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>for pdbAtom, trajAtom in zip(m.atoms, mdInfo['mol'].atoms):</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>trajAtom.anisoU = pdbAtom.anisoU</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>break</div><div><br></div><div>You could add an <i>aniso</i> command after the copy via the <i>runCommand</i> method:</div><div><br></div><div>from chimera import runCommand</div><div>runCommand("aniso args-you-want...")</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>This is going to make trajectory playback sluggish, so is only really useful for movie recording I'd say. Of course, showing the aniso surfaces was probably making playback sluggish anyway!</div><div><br></div><div>--Eric</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div></div><div><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "><br></font></div><div><div>On Nov 23, 2012, at 9:47 AM, Ryan Harrison wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Dear Chimera team,<br><br>I've encountered a problem with atom.anisoU. Since class Atom is implemented in C++, and I don't have the technical sophistication or nerve to build chimera from scratch after the dire warning, [<a href="http://www.cgl.ucsf.edu/chimera/sourcecode.html">1</a>] I seek council. <br>
<br>I'm using PDB ANISOU to store orientation information from a coarse grained model. Using PDB MODEL and PDB ENDMDL I output trajectory information. PDB atom coordinates and aniso change with each frame in the trajectory.<br>
<br>When visualizing a coordSet in the trajectory, atom.coord() updates as expected...<br># m1 is a model with ANISO information<br>>>> m1.activeCoordSet = m1.coordSets[2]<br>>>> m1.atoms[1].coord()<br>chimera.Point(-0.268, 0.002, 0.08) <b># <~~~ As expected from PDB file</b><br>
>>> m1.activeCoordSet = m1.coordSets[10]<br>
>>> m1.atoms[1].coord()<br>
chimera.Point(0.012, -0.276, -0.043) <b># <~~~ Changes as expected from PDB file</b><br><br>However, atom.anisoU does not update as expected [<a href="http://www.cgl.ucsf.edu/pipermail/chimera-users/2012-February/007246.html">2</a>, <a href="http://plato.cgl.ucsf.edu/pipermail/chimera-users/2008-December/003377.html">3</a>]. It is always the PDB ANISO information from the last model (last MD trajectory) in the file...<br>
>>> m1.activeCoordSet = m1.coordSets[2]<br>
>>> m1.atoms[1].anisoU <b># <~~~ ANISO for last model in PDB file, not model 2</b><br>
array([[ 0.0296, 0.0182, 0.0201],<br>
[ 0.0182, 0.0844, -0.0055],<br>
[ 0.0201, -0.0055, 0.1258]], dtype=float32)<br>
>>> m1.activeCoordSet = m1.coordSets[10]<br>
>>> m1.atoms[1].anisoU <b># <~~~ Again, ANISO for last model in PDB file, not model 10</b><br>
array([[ 0.0296, 0.0182, 0.0201],<br>
[ 0.0182, 0.0844, -0.0055],<br>
[ 0.0201, -0.0055, 0.1258]], dtype=float32)<br><br>The result is visualizations with proper coordinates (update properly for each frame in trajectory) but inaccurate ellipsoids (ANISO does not update; fixed as last frame / last model).<br>
<br><b>Work around 1 (Failed):</b><br>Since <i>aniso</i> takes spec atom-spec as an input, I tried specifying a model and position in trajectory. Unfortunately, this doesn't seem to be possible [<a href="http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/frameatom_spec.html">4</a>].<br>
<br><b>Work around 2 (Tedious):</b><br>Since <i>aniso</i> can take submodels, I import (cannot use nifty MD Movie tool) as sub-models instead of as a trajectory. I can then apply aniso to each submodel, which works as expected, and switch submodels on/off sequentially to make a movie (<a href="http://www.cgl.ucsf.edu/pipermail/chimera-users/2009-April/003800.html">5</a>). This is not ideal since I'm missing out on the ease of use of the MD Movie tool, and it's very cumbersome to move through a stack of submodels to emulate a trajectory.<br>
<br>Thank you for your time and please help!<br><br>Best,<br>Ryan</blockquote></div></div><br><br><div>
</div>
<br></body></html>