From: John Stone (johns_at_ks.uiuc.edu)
Date: Sun Mar 15 2020 - 13:30:45 CDT

That is correct, VMD tries to be a "consumer" of atomic structure information
in most cases, and if you modify the struture, e.g., by changing coordinates,
aligning/fitting structures, or similar, you will need to write the modified
structure file(s) out in order to preserve the changes when you load the
same visualization state in the future.

Best,
  John Stone
  vmd_at_ks.uiuc.edu

On Fri, Mar 13, 2020 at 11:00:55PM +0100, Peter Mawanga wrote:
> Ok, thanks for the clarification. So visualization state cannot be used
> to transform the actual positions then.
> On Fri, Mar 13, 2020 at 10:49 PM Josh Vermaas
> <[1]joshua.vermaas_at_gmail.com> wrote:
>
> Nope. Visualization states only save camera positions, probably to
> reduce the file size. In these cases, I just save the moved coordinates
> to a new file, and create a new visualization states after loading the
> repositioned file.
> Josh
> On Fri, Mar 13, 2020, 5:43 PM Peter Mawanga
> <[2]peter.mawanga.lagos_at_gmail.com> wrote:
>
> Hello Josh
> Thanks a lot for the reply. I moved two molecules using the "Mouse >
> Move > Molecule" option and wanted to save the new coordinates.
> However, I was unable to do so, although I could save the changes as a
> visualization state.Â
> From what I understand, the visualization state doesn't represent the
> actual coordinates of the different molecules. Is there any way to
> save the positions of the molecules as observed in the visualization
> state? Please let me know if feasible.
> On Fri, Mar 13, 2020 at 9:06 PM Josh Vermaas
> <[3]joshua.vermaas_at_gmail.com> wrote:
>
> Hi Peter,
> I'm not sure what you are trying to do, but those matrices should
> change the position of the camera, not the coordinates stored in
> VMD. I believe that the matricies within viewpoints are meant to be
> applied to the center_matrix, rotate_matrix, and scale_matrix
> accessible through molinfo (see
> [4]https://www.ks.uiuc.edu/Research/vmd/vmd-1.9.3/ug/node142.html).
> Have you tried something like (operating from memory):
> molinfo top set center_matrix {{1 0 0 -119.535} {0 1 0 -144.59} {0 0
> 1 -132.454} {0 0 0 1}}
> molinfo top set rotate_matrix {{-0.409795 -0.495426 0.765888 0}
> {0.679365 0.394516 0.618708 0} {-0.608684 0.773872 0.174909 0} {0 0
> 0 1}}
> molinfo top set scale_matrix {{0.0305694 0 0 0} {0 0.0305694 0 0} {0
> 0 0.0305694 0} {0 0 0 1}}
> That is what the saved state uses to re-establish the camera
> positions.
> -Josh
> On Fri, Mar 13, 2020 at 12:32 PM Peter Mawanga
> <[5]peter.mawanga.lagos_at_gmail.com> wrote:
>
> Hello everyone
> From the visualization state, I got the following matrix for
> changing the position of a molecule.Â
> set viewpoints([molinfo top]) {{{1 0 0 -119.535} {0 1 0 -144.59}
> {0 0 1 -132.454} {0 0 0 1}} {{-0.409795 -0.495426 0.765888 0}
> {0.679365 0.394516 0.618708 0} {-0.608684 0.773872 0.174909 0} {0
> 0 0 1}} {{0.0305694 0 0 0} {0 0.0305694 0 0} {0 0 0.0305694 0} {0
> 0 0 1}} {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}}}
> However, after applying the three matrices successively (since the
> fourth matrix is redundant and doesn't make any difference anyway
> after application), all the coordinates were reduced to almost
> insignificant decimal values.
> I tried using the "Save coordinates" option to save the molecule
> position after loading the visualization state but it didn't make
> any difference. The "measure fit" command returned an identity
> matrix too.
>
> Please suggest how to proceed with this issue.
> --
> Thanks
> Peter
>
> --
> Cheers
> Peter
>
> --
> Cheers
> Peter
>
> References
>
> Visible links
> 1. mailto:joshua.vermaas_at_gmail.com
> 2. mailto:peter.mawanga.lagos_at_gmail.com
> 3. mailto:joshua.vermaas_at_gmail.com
> 4. https://www.ks.uiuc.edu/Research/vmd/vmd-1.9.3/ug/node142.html
> 5. mailto:peter.mawanga.lagos_at_gmail.com

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/