[Chimera-users] Saving trajectories in one pdb file
pett at cgl.ucsf.edu
Wed Dec 12 13:18:01 PST 2012
On Dec 12, 2012, at 11:03 AM, Daniel Gurnon wrote:
> Hi all,
> I'm using Chimera to prepare multi-model pdbs for use in ePMV. I've run into two issues:
> 1) When saving a portion of a trajectory in one pdb file, frame numbers are used as model numbers. But only 4 digits are supported. Above 9999, the model number becomes ****. Could you enable 7 digits? I'm taking frames from the end of a long trajectory.
> 2) I was hoping that I could retain the effect of "hold selection steady" by saving as a pdb with transformed coordinates, but this isn't the case. Is there a way to make this work?
I could probably easily change Chimera to use a non-PDB-standard larger field width in the MODEL record, but we're in a code freeze right now in preparation for the 1.7 candidate production release so I can't do so for a day or two. I will do it soonest, but I have a suggestion (below) that I hope obviates your immediate need for it.
Having "hold selection steady" reflected directly in the written PDB is pretty hard since the PDB-writing code only knows about whatever the current transformation matrix is as the write is performed, whereas the hold-selection-steady code changes the transformation matrix on the fly as the trajectory is played.
My suggested solution for your situation, assuming you aren't on a Windows box and that the frames you want are either consecutive or evenly spaced, is to write a series of PDB files and collate them together on the fly by using a per-frame script. The script below, if put in MD Movie's Per-Frame script dialog (set to "Chimera commands") will write the current frame to a temporary PDB file, and append that to a another PDB file, bookended by MODEL/ENDMDL records. So when you are done playing through the relevant frames you will have the final PDB file in /var/tmp/all.pdb. Note the in the second line of the script the "<FRAME>" part is literally that string -- MD Movie will replace that with the appropriate frame number.
write 0 /var/tmp/x.pdb
system echo MODEL <FRAME> >> /var/tmp/all.pdb
system /bin/cat /var/tmp/x.pdb >> /var/tmp/all.pdb
system echo ENDMDL >> /var/tmp/all.pdb
The all.pdb file will have a lot of extra records (headers and whatnot) between the MODEL/ENDMDL records that are not usually found there. I suspect that ePMV will accept the file as is without complaint. If it does not, just read the file back into Chimera and write it back out again. The rewritten file will be 100% PDB compliant.
UCSF Computer Graphics Lab
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chimera-users