# How to centralize membrane on Z = 0

**URL:** <https://gromacs.bioexcel.eu/t/how-to-centralize-membrane-on-z-0/8222>\
**Category:** User discussions\
**Tags:** gmx-trjconv\
**Created:** [February 4, 2024, 3:16pm UTC](https://gromacs.bioexcel.eu/t/how-to-centralize-membrane-on-z-0/8222 "2024-02-04T15:16:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TGaziri](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/tgaziri/32/5191_2.png) [@TGaziri](https://gromacs.bioexcel.eu/u/TGaziri)\
**Post date:** [February 4, 2024, 3:16pm UTC](https://gromacs.bioexcel.eu/t/how-to-centralize-membrane-on-z-0/8222/1 "2024-02-04T15:16:24Z")

</div>

GROMACS version: 2022  
GROMACS modification: No

Hi,  
I’m trying to perform so analysis on a POPG lipid bilayer which requires the bilayer to be centered in the Z = 0 coordinate.

I’ve trying the following comands:

```auto
gmx trjconv -f md.xtc -s md.tpr -pbc whole -o md_0-100ns.xtc -center -n c218.ndx -e 100000

gmx trjconv -f md.xtc -s md.tpr -pbc mol -o md_0-100ns.xtc -center -n c218.ndx -e 100000

```

I tried using the whole POPG membrane as the group for centering, as well as the last carbon atom in the lipid tails.

after centering the membrane I also tried running the xtc file through the trjconv comand again using `-center 0`

` gmx trjconv -f md_0-100ns.xtc -s md.tpr -pbc mol -o md_0-100ns.xtc -center 0`

But, nothing seems to work, the membrane seems to be centered but not on z = 0.

I’m using a third party tool (LOOS) for the analysis so I can’t really tweek this so the membrane centered in other coordinate works for the analysis.

Thanks

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [February 5, 2024, 8:58am UTC](https://gromacs.bioexcel.eu/t/how-to-centralize-membrane-on-z-0/8222/2 "2024-02-05T08:58:20Z")

</div>

A very brutal solution may be that you take the centre of mass of your membrane along z (gmx traj -f memb\_trajectory.xtc -s memb\_binary.tpr -nox -noy -com -ox com\_membrane.xvg) and you use its average to translate the whole bilayer (e.g. gmx trjconv -f memb\_trajectory.xtc -s memb\_binary.tpr -trans 0 0 -value\_of\_mem\_COM -o trans\_memb.xtc). This will make so that the average position of the com of the membrane along z will be positioned in z=0 in the trajectory. If the com’s z doesn’t fluctuate a lot it may be a good approximation of having the membrane centered in z all the time.

---

<div class="post-metadata">

**Author:** ![TGaziri](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/tgaziri/32/5191_2.png) [@TGaziri](https://gromacs.bioexcel.eu/u/TGaziri)\
**Post date:** [February 5, 2024, 3:24pm UTC](https://gromacs.bioexcel.eu/t/how-to-centralize-membrane-on-z-0/8222/4 "2024-02-05T15:24:11Z")

</div>

Thanks for your reply, turns out that the issue with my analysis wasn’t the membrane centering. But thanks.
