[gmx-users] How to rotate the molecule in box

Christian Blau blau at kth.se
Wed Jan 8 10:55:08 CET 2020


Hi Yeping,


The center of rotation is (0,0,0) for the rotate command, which is the lower left front corner of your box, and not the 
box center. That's why the molecule moves out of the box when rotating.

One (of conceivable more ways) to perform the rotation, is to use -center (0,0,0) to create a new structure, centered on 
the origin, then perform the rotation, and then shift the molecule back into the box center with -center only.


Best,

Christian


On 2019-12-30 14:44, sunyeping wrote:
> Dear all,
>
> By using the editconf command, we can build a box for the protein molecule, for example:
>
>       gmx editconf -f complex.gro -o newbox.gro -c -d 1.2 -bt cubic
>
> but how to rotate the molecule in the box? I tried to use "-rotate" option of the editconf command to do so, but I found part of the molecule goes out the pbc box after rotation. Please refer to the image at the following link:
>
> https://drive.google.com/file/d/1P_yTeRSkHpeUTXSUZMlTw2AHZ17s0htv/view?usp=sharing
>
> The molecule was orignally at position 1. I wanted to rotate the molecule around x and y axes by 45 degrees. After I ran the following command:
>
>      gmx editconf -f newbox.gro -rotate 45 45 0 -bt o -o newbpx_1.gro
>
> The molecule went to position 2. You can see part of the molecule are now out of the box.
>
> Do you know how to rotate the molecule but keep it within the box?
>
> Thank you in advance.
>
> Yeping


More information about the gromacs.org_gmx-users mailing list