From: Josh Vermaas (
Date: Fri Feb 19 2016 - 11:54:04 CST

If you want it centerd in the box, drop the -sel "protein" at the end. I
was just trying to get the protein together into one unit cell, so that
you can move them as a unit later. Next question: is the segname really
A, or is it chain A, B, C, D, and E? VMD's atomselections matter! If
segname A is an empty selection, it won't do what you want.

On 02/19/2016 11:48 AM, Nicolas Martin wrote:
> Dear Josh, dear all,
> Thanks you for your kind answer. I gave it a try without bigdcd and it
> didn't really improve the situation. I have the impression that even
> the centering is not working properly. Indeed when running only the
> first command:
> pbc wrap -compound fragment -center com -centersel "segname A" -now
> -sel "protein"
> Segment A isn't in the middle of my box. Segment E is and still moving
> quite a lot. I do not understand why the centering algorithm would
> allow such a variation in the position of the center of mass of the
> selection neither why segE is centered instead of segA.
> Although since I have an homopentamere I cannot pick the largest one
> as Josh suggested.
> Bests,
> NM
> On 02/19/2016 04:50 PM, Josh Vermaas wrote:
>> Hi Nicholas,
>> I've never done it with bigdcd, but another alternative is a set of
>> two wrap commands. I think unwrap depends on a previous set of
>> coordinates to be loaded, so I'm not sure what it would even do when
>> bigdcd only loads one frame at a time.
>> #This gets the protein together into one group, assuming each chain
>> is its own segment, and isn't too big relative to the periodic box
>> pbc wrap -compound fragment -center com -centersel "segname PA" -now
>> -sel "protein"
>> #This step is optional, and recenters the lipids and waters around
>> the protein that is put back together.
>> pbc wrap -compound fragment -center com -centersel "protein" -now
>> Of course, you'd need to adjust the "segname PA" selection to just
>> pick one segment of the multimer, preferably the largest one.
>> -Josh Vermaas
>> On 02/19/2016 08:30 AM, Nicolas Martin wrote:
>>> Dear users,
>>> I recently run a simulation in NAMD of a pentameric membrane protein
>>> using the wrapping option. Even tough the water and membrane are
>>> correctly wrapped, the protein diffuse in the simulation box and end
>>> ups crossing the periodic boundaries. Doing so, the protein is not
>>> kept full, but 2 chains over 5 jump on the other side of the box.
>>> The wrapping in namd is made so there is no long bonds and only full
>>> chains move to the other side of the box.
>>> I need all the chains to be put back together at the center of the
>>> box for further analysis.
>>> I tried to follow the documentation for doing so and the best I
>>> could end up with is a protein more or less (the com seems to be
>>> moving significantly) well centered in the box and several frames
>>> over a long trajectory with stretched bonds. Here is the routine I
>>> used over all trajectory frames:
>>> pbc unwrap -sel protein -now
>>> pbc wrap -compound res -center com -centersel "protein" -now
>>> I also used bigdcd (that's why the option -now and not -all was used
>>> above) for reading trajectories and wrote wrapped dcds every 1000
>>> frames to avoid memory problems (otherwise it's a ~30GB trajectory).
>>> I also tried using the Join keyword on the first frame which had no
>>> significant effect.
>>> What procedure would you advice me to use in order to get a
>>> perfectly re-centered and wrapped trajectory in the case of my
>>> multi-chains system?
>>> Thanks you in advance for your help,
>>> NM