Notebook05: POPC/cholesterol mixture

In this notebook, we will show you how to reconstruct hydrogens, calculate the order parameters and produce output trajectories on a POPC/cholesterol (66:34) mixture. Again, this example is based on the Berger united-atom force field.

Before going on, we advise you to get started with Notebook01 if you are not familiar with basic features of buildH and Jupyter notebooks (e.g. do you know what ! means in a Jupyter cell?).

Checking buildH activation

As explained in Notebook01, you should have activated buildH before launching this notebook, thus you should obtain the following when invoking buildH in a Unix terminal:

[1]:
!buildH
usage: buildH [-h] [-v] -c COORD [-t TRAJ] -l LIPID
              [-lt LIPID_TOPOLOGY [LIPID_TOPOLOGY ...]] -d DEFOP
              [-opx OPDBXTC] [-o OUT] [-b BEGIN] [-e END] [-igch3]
buildH: error: the following arguments are required: -c/--coord, -l/--lipid, -d/--defop

If you see this, you can go on. If not, please go to Notebook01 and see the explanations there on how to activate buildH.

Downloading the example files

The example shown in this Notebook are taken from a POPC/cholesterol (66:34) trajectory (84 POPC molecules and 44 cholesterol molecules) taken from the NMRlipidsIVb project. The initial source files can be found on Zenodo. For the purpose of learning, we simplified the trajectory and extracted only 25 frames (0-25 ns, one frame / ns). We also made the molecules whole with the tool trjconv from GROMACS with the flag -pc mol. The starting gro file and the trajectory of 25 frames can be directly downloaded from the buildH repo in the directory https://github.com/patrickfuchs/buildH/tree/master/docs/Berger_POPCCHOL_test_case. Here we’ll download them with wget (recall to download all files in raw format):

[2]:
!wget https://raw.githubusercontent.com/patrickfuchs/buildH/master/docs/Berger_POPCCHOL_test_case/endCONF_OK.gro
--2021-07-07 15:17:17--  https://raw.githubusercontent.com/patrickfuchs/buildH/master/docs/Berger_POPCCHOL_test_case/endCONF_OK.gro
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1795883 (1.7M) [text/plain]
Saving to: ‘endCONF_OK.gro’

endCONF_OK.gro      100%[===================>]   1.71M  --.-KB/s    in 0.08s

2021-07-07 15:17:17 (22.4 MB/s) - ‘endCONF_OK.gro’ saved [1795883/1795883]

[3]:
!wget https://github.com/patrickfuchs/buildH/raw/master/docs/Berger_POPCCHOL_test_case/popcCHOL34molPER0-25ns_OK_dt1000.xtc
--2021-07-07 15:17:20--  https://github.com/patrickfuchs/buildH/raw/master/docs/Berger_POPCCHOL_test_case/popcCHOL34molPER0-25ns_OK_dt1000.xtc
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/patrickfuchs/buildH/master/docs/Berger_POPCCHOL_test_case/popcCHOL34molPER0-25ns_OK_dt1000.xtc [following]
--2021-07-07 15:17:20--  https://raw.githubusercontent.com/patrickfuchs/buildH/master/docs/Berger_POPCCHOL_test_case/popcCHOL34molPER0-25ns_OK_dt1000.xtc
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2472992 (2.4M) [application/octet-stream]
Saving to: ‘popcCHOL34molPER0-25ns_OK_dt1000.xtc’

popcCHOL34molPER0-2 100%[===================>]   2.36M  --.-KB/s    in 0.09s

2021-07-07 15:17:21 (25.8 MB/s) - ‘popcCHOL34molPER0-25ns_OK_dt1000.xtc’ saved [2472992/2472992]

[4]:
!ls
data
endCONF_OK.gro
img
Notebook_01_buildH_calc_OP.ipynb
Notebook_02_buildH_calc_OP_outputwH.ipynb
Notebook_03_mixture_POPC_POPE.ipynb
Notebook_04_library.ipynb
Notebook_05_mixture_POPC_cholesterol.ipynb
popcCHOL34molPER0-25ns_OK_dt1000.xtc

We also need the two def files corresponding to POPC and cholesterol. They can be downloaded from the buildH repo in the directory https://github.com/patrickfuchs/buildH/tree/master/def_files (again remember to use raw files):

[5]:
!wget https://raw.githubusercontent.com/patrickfuchs/buildH/master/def_files/Berger_POPC.def
--2021-07-07 15:17:27--  https://raw.githubusercontent.com/patrickfuchs/buildH/master/def_files/Berger_POPC.def
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2135 (2.1K) [text/plain]
Saving to: ‘Berger_POPC.def’

Berger_POPC.def     100%[===================>]   2.08K  --.-KB/s    in 0s

2021-07-07 15:17:27 (8.49 MB/s) - ‘Berger_POPC.def’ saved [2135/2135]

[6]:
!wget https://raw.githubusercontent.com/patrickfuchs/buildH/master/def_files/Berger_CHOL.def
--2021-07-07 15:17:30--  https://raw.githubusercontent.com/patrickfuchs/buildH/master/def_files/Berger_CHOL.def
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1275 (1.2K) [text/plain]
Saving to: ‘Berger_CHOL.def’

Berger_CHOL.def     100%[===================>]   1.25K  --.-KB/s    in 0s

2021-07-07 15:17:31 (5.90 MB/s) - ‘Berger_CHOL.def’ saved [1275/1275]

[7]:
!ls
Berger_CHOL.def                   Notebook_02_buildH_calc_OP_outputwH.ipynb
Berger_POPC.def                   Notebook_03_mixture_POPC_POPE.ipynb
data                              Notebook_04_library.ipynb
endCONF_OK.gro                    Notebook_05_mixture_POPC_cholesterol.ipynb
img                               popcCHOL34molPER0-25ns_OK_dt1000.xtc
Notebook_01_buildH_calc_OP.ipynb

Recall, the def files present on the buildH def_files directory contain all the possible (apolar) H that can be reconstructed on each lipids. The polar hydrogen of cholesterol is already present, thus it does not need to be reconstructed. buildH will let it as is, like all other non apolar H atoms.

Dealing with POPC

When we have a mixture of lipids, buildH cannot reconstruct hydrogens on all lipids at the same time. So we start with H reconstruction and OP calculation on POPC (we’ll focus on cholesterol later). Since Berger POPC is a supported lipid, we can launch easily buildH with the classical flags: -c for reading the initial pdb or gro file, -t for reading the trajectory, -l for specifying the type of lipid, -d for specifying the def file, -o for the output file with order parameters, and last -opx for the output trajectory with hydrogens (recall not to put any extension, they’ll be added automatically by buildH). Importantly, when we want to output a trajectory with newly reconstructed hydrogens (option -opx), all possible H to reconstruct need to be present in the def file. This is fine since this is the case for all lipids in the def file directory of the buildH repository.

[8]:
!buildH -c endCONF_OK.gro -t popcCHOL34molPER0-25ns_OK_dt1000.xtc -l Berger_PLA -d Berger_POPC.def -o OP_POPC.out -opx traj_POPC_wH
Constructing the system...
System has 26026 atoms
Writing new pdb with hydrogens.
Writing trajectory with hydrogens in xtc file.
Dealing with frame 0 at 30000.0 ps.
Dealing with frame 1 at 31000.0 ps.
Dealing with frame 2 at 32000.0 ps.
Dealing with frame 3 at 33000.0 ps.
Dealing with frame 4 at 34000.0 ps.
Dealing with frame 5 at 35000.0 ps.
Dealing with frame 6 at 36000.0 ps.
Dealing with frame 7 at 37000.0 ps.
Dealing with frame 8 at 38000.0 ps.
Dealing with frame 9 at 39000.0 ps.
Dealing with frame 10 at 40000.0 ps.
Dealing with frame 11 at 41000.0 ps.
Dealing with frame 12 at 42000.0 ps.
Dealing with frame 13 at 43000.0 ps.
Dealing with frame 14 at 44000.0 ps.
Dealing with frame 15 at 45000.0 ps.
Dealing with frame 16 at 46000.0 ps.
Dealing with frame 17 at 47000.0 ps.
Dealing with frame 18 at 48000.0 ps.
Dealing with frame 19 at 49000.0 ps.
Dealing with frame 20 at 50000.0 ps.
Dealing with frame 21 at 51000.0 ps.
Dealing with frame 22 at 52000.0 ps.
Dealing with frame 23 at 53000.0 ps.
Dealing with frame 24 at 54000.0 ps.
Dealing with frame 25 at 55000.0 ps.
Results written to OP_POPC.out

[9]:
!ls
Berger_CHOL.def
Berger_POPC.def
data
endCONF_OK.gro
img
Notebook_01_buildH_calc_OP.ipynb
Notebook_02_buildH_calc_OP_outputwH.ipynb
Notebook_03_mixture_POPC_POPE.ipynb
Notebook_04_library.ipynb
Notebook_05_mixture_POPC_cholesterol.ipynb
OP_POPC.out
popcCHOL34molPER0-25ns_OK_dt1000.xtc
traj_POPC_wH.pdb
traj_POPC_wH.xtc

The order parameters of POPC lipids have been written to the file OP_POPC.dat

[10]:
!head OP_POPC.out
# OP_name            resname atom1 atom2  OP_mean OP_stddev OP_stem
#--------------------------------------------------------------------
gamma1_1             PLA     C1    H11    0.03609  0.16545  0.01805
gamma1_2             PLA     C1    H12   -0.01327  0.09031  0.00985
gamma1_3             PLA     C1    H13   -0.01714  0.11162  0.01218
gamma2_1             PLA     C2    H21    0.03573  0.16452  0.01795
gamma2_2             PLA     C2    H22   -0.01077  0.10390  0.01134
gamma2_3             PLA     C2    H23    0.00015  0.09757  0.01065
gamma3_1             PLA     C3    H31    0.03542  0.16105  0.01757
gamma3_2             PLA     C3    H32   -0.01826  0.09667  0.01055

A pdb traj_POPC_wH.pdb and an xtc traj_POPC_wH.xtc file have been produced with hydrogens on POPC only. So let’s check whether the POPC have hydrogens and not cholesterol (recall, here POPC residue name is PLA):

[11]:
!grep PLA traj_POPC_wH.pdb | head -20
ATOM      1  C1   PLA    1      10.670  42.050  27.850  1.00  0.00             C
ATOM      2  H11  PLA    1      10.727  41.123  27.280  1.00  0.00             H
ATOM      3  H12  PLA    1       9.962  41.929  28.670  1.00  0.00             H
ATOM      4  H13  PLA    1      11.654  42.290  28.252  1.00  0.00             H
ATOM      5  C2   PLA    1       8.900  42.780  26.440  1.00  0.00             C
ATOM      6  H21  PLA    1       8.966  41.826  25.916  1.00  0.00             H
ATOM      7  H22  PLA    1       8.564  43.552  25.748  1.00  0.00             H
ATOM      8  H23  PLA    1       8.189  42.694  27.262  1.00  0.00             H
ATOM      9  C3   PLA    1      11.120  43.130  25.800  1.00  0.00             C
ATOM     10  H31  PLA    1      11.123  42.136  25.353  1.00  0.00             H
ATOM     11  H32  PLA    1      12.130  43.389  26.117  1.00  0.00             H
ATOM     12  H33  PLA    1      10.771  43.857  25.067  1.00  0.00             H
ATOM     13  N4   PLA    1      10.220  43.140  26.970  1.00  0.00             N
ATOM     14  C5   PLA    1      10.120  44.420  27.670  1.00  0.00             C
ATOM     15  H51  PLA    1       9.433  44.285  28.506  1.00  0.00             H
ATOM     16  H52  PLA    1       9.704  45.146  26.971  1.00  0.00             H
ATOM     17  C6   PLA    1      11.420  45.010  28.230  1.00  0.00             C
ATOM     18  H61  PLA    1      12.062  44.193  28.559  1.00  0.00             H
ATOM     19  H62  PLA    1      11.177  45.647  29.081  1.00  0.00             H
ATOM     20  O7   PLA    1      12.130  45.790  27.260  1.00  0.00             O
grep: write error: Broken pipe
[12]:
!grep CHOL traj_POPC_wH.pdb | head -20
ATOM   2681  C1  CHOL   21       8.750  35.790  36.370  1.00  0.00             C
ATOM   2682  C2  CHOL   21       9.800  36.660  35.670  1.00  0.00             C
ATOM   2683  C3  CHOL   21       9.370  37.990  35.030  1.00  0.00             C
ATOM   2684  C4  CHOL   21       8.600  37.850  33.710  1.00  0.00             C
ATOM   2685  C5  CHOL   21       9.340  36.970  32.700  1.00  0.00             C
ATOM   2686  O6  CHOL   21       8.500  36.770  31.560  1.00  0.00             O
ATOM   2687  H   CHOL   21       8.170  37.670  31.260  1.00  0.00             H
ATOM   2688  C8  CHOL   21       9.890  35.630  33.200  1.00  0.00             C
ATOM   2689  C9  CHOL   21      10.480  35.810  34.600  1.00  0.00             C
ATOM   2690  C10 CHOL   21      11.690  35.180  34.860  1.00  0.00             C
ATOM   2691  C11 CHOL   21      12.450  35.230  36.190  1.00  0.00             C
ATOM   2692  C12 CHOL   21      11.660  35.960  37.280  1.00  0.00             C
ATOM   2693  C13 CHOL   21      10.840  37.110  36.690  1.00  0.00             C
ATOM   2694  C14 CHOL   21      10.220  37.900  37.850  1.00  0.00             C
ATOM   2695  C15 CHOL   21      11.100  38.390  39.000  1.00  0.00             C
ATOM   2696  C16 CHOL   21      11.860  37.210  39.620  1.00  0.00             C
ATOM   2697  C17 CHOL   21      10.960  36.250  40.390  1.00  0.00             C
ATOM   2698  C18 CHOL   21      12.510  36.490  38.440  1.00  0.00             C
ATOM   2699  C19 CHOL   21      13.680  35.670  38.990  1.00  0.00             C
ATOM   2700  C20 CHOL   21      14.070  36.390  40.280  1.00  0.00             C
grep: write error: Broken pipe

Yeah that is fine! POPC has all hydrogens reconstructed, but not cholesterol (we can only see the polar hydrogen on the OH group which is natively present in a united-atom structure).

Dealing with cholesterol

Now that POPC have all hydrogens, we can restart from that pdb file to reconstruct the hydrogens of cholesterol. Thus we can use the flags -c with the pdb file we just generated traj_POPC_wH.pdb (Hs on POPC but cholesterol). The -t will be used with the same trajectory with H on POPC (but not POPE!) traj_POPC_wH.xtc. We output order parameters for POPE with -o. Last, -opx will produce a file with hydrogens on POPE.

[13]:
!buildH -c traj_POPC_wH.pdb -t traj_POPC_wH.xtc -l Berger_CHOL -d Berger_CHOL.def -o OP_CHOL.out -opx traj_POPC_CHOL_wH
Constructing the system...
System has 32914 atoms
Writing new pdb with hydrogens.
Writing trajectory with hydrogens in xtc file.
Dealing with frame 0 at 0.0 ps.
Dealing with frame 1 at 0.0 ps.
Dealing with frame 2 at 0.0 ps.
Dealing with frame 3 at 0.0 ps.
Dealing with frame 4 at 0.0 ps.
Dealing with frame 5 at 0.0 ps.
Dealing with frame 6 at 0.0 ps.
Dealing with frame 7 at 0.0 ps.
Dealing with frame 8 at 0.0 ps.
Dealing with frame 9 at 0.0 ps.
Dealing with frame 10 at 0.0 ps.
Dealing with frame 11 at 0.0 ps.
Dealing with frame 12 at 0.0 ps.
Dealing with frame 13 at 0.0 ps.
Dealing with frame 14 at 0.0 ps.
Dealing with frame 15 at 0.0 ps.
Dealing with frame 16 at 0.0 ps.
Dealing with frame 17 at 0.0 ps.
Dealing with frame 18 at 0.0 ps.
Dealing with frame 19 at 0.0 ps.
Dealing with frame 20 at 0.0 ps.
Dealing with frame 21 at 0.0 ps.
Dealing with frame 22 at 0.0 ps.
Dealing with frame 23 at 0.0 ps.
Dealing with frame 24 at 0.0 ps.
Dealing with frame 25 at 0.0 ps.
Results written to OP_CHOL.out

[14]:
!ls
Berger_CHOL.def
Berger_POPC.def
data
endCONF_OK.gro
img
Notebook_01_buildH_calc_OP.ipynb
Notebook_02_buildH_calc_OP_outputwH.ipynb
Notebook_03_mixture_POPC_POPE.ipynb
Notebook_04_library.ipynb
Notebook_05_mixture_POPC_cholesterol.ipynb
OP_CHOL.out
OP_POPC.out
popcCHOL34molPER0-25ns_OK_dt1000.xtc
traj_POPC_CHOL_wH.pdb
traj_POPC_CHOL_wH.xtc
traj_POPC_wH.pdb
traj_POPC_wH.xtc

Great, we can now look at the order parameters of cholesterol:

[15]:
!head OP_CHOL.out
# OP_name            resname atom1 atom2  OP_mean OP_stddev OP_stem
#--------------------------------------------------------------------
cholesterol1a        CHOL    C1    H11   -0.13027  0.25110  0.03785
cholesterol1b        CHOL    C1    H12   -0.25855  0.18820  0.02837
cholesterol1c        CHOL    C1    H13    0.77977  0.24458  0.03687
cholesterol3a        CHOL    C3    H31   -0.27535  0.24273  0.03659
cholesterol3b        CHOL    C3    H32   -0.28172  0.23349  0.03520
cholesterol4a        CHOL    C4    H41   -0.27938  0.21471  0.03237
cholesterol4b        CHOL    C4    H42   -0.30714  0.14779  0.02228
cholesterol5a        CHOL    C5    H51   -0.30473  0.20913  0.03153

And check whether POPC and POPE have all hydrogens reconstructed:

[16]:
!grep CHOL traj_POPC_CHOL_wH.pdb | head -20
ATOM   2681  C1  CHOL   21       8.750  35.790  36.370  1.00  0.00             C
ATOM   2682  H11 CHOL   21       8.249  36.375  37.141  1.00  0.00             H
ATOM   2683  H12 CHOL   21       9.238  34.929  36.827  1.00  0.00             H
ATOM   2684  H13 CHOL   21       8.017  35.447  35.640  1.00  0.00             H
ATOM   2685  C2  CHOL   21       9.800  36.660  35.670  1.00  0.00             C
ATOM   2686  C3  CHOL   21       9.370  37.990  35.030  1.00  0.00             C
ATOM   2687  H31 CHOL   21      10.267  38.580  34.839  1.00  0.00             H
ATOM   2688  H32 CHOL   21       8.733  38.517  35.740  1.00  0.00             H
ATOM   2689  C4  CHOL   21       8.600  37.850  33.710  1.00  0.00             C
ATOM   2690  H41 CHOL   21       7.627  37.405  33.917  1.00  0.00             H
ATOM   2691  H42 CHOL   21       8.462  38.841  33.277  1.00  0.00             H
ATOM   2692  C5  CHOL   21       9.340  36.970  32.700  1.00  0.00             C
ATOM   2693  H51 CHOL   21      10.245  37.528  32.460  1.00  0.00             H
ATOM   2694  O6  CHOL   21       8.500  36.770  31.560  1.00  0.00             O
ATOM   2695  H   CHOL   21       8.170  37.670  31.260  1.00  0.00             H
ATOM   2696  C8  CHOL   21       9.890  35.630  33.200  1.00  0.00             C
ATOM   2697  H81 CHOL   21      10.667  35.280  32.521  1.00  0.00             H
ATOM   2698  H82 CHOL   21       9.084  34.898  33.237  1.00  0.00             H
ATOM   2699  C9  CHOL   21      10.480  35.810  34.600  1.00  0.00             C
ATOM   2700  C10 CHOL   21      11.690  35.180  34.860  1.00  0.00             C
grep: write error: Broken pipe
[17]:
!grep PLA traj_POPC_CHOL_wH.pdb | head -20
ATOM      1  C1   PLA    1      10.670  42.050  27.850  1.00  0.00             C
ATOM      2  H11  PLA    1      10.730  41.120  27.280  1.00  0.00             H
ATOM      3  H12  PLA    1       9.960  41.930  28.670  1.00  0.00             H
ATOM      4  H13  PLA    1      11.650  42.290  28.250  1.00  0.00             H
ATOM      5  C2   PLA    1       8.900  42.780  26.440  1.00  0.00             C
ATOM      6  H21  PLA    1       8.970  41.830  25.920  1.00  0.00             H
ATOM      7  H22  PLA    1       8.560  43.550  25.750  1.00  0.00             H
ATOM      8  H23  PLA    1       8.190  42.690  27.260  1.00  0.00             H
ATOM      9  C3   PLA    1      11.120  43.130  25.800  1.00  0.00             C
ATOM     10  H31  PLA    1      11.120  42.140  25.350  1.00  0.00             H
ATOM     11  H32  PLA    1      12.130  43.390  26.120  1.00  0.00             H
ATOM     12  H33  PLA    1      10.770  43.860  25.070  1.00  0.00             H
ATOM     13  N4   PLA    1      10.220  43.140  26.970  1.00  0.00             N
ATOM     14  C5   PLA    1      10.120  44.420  27.670  1.00  0.00             C
ATOM     15  H51  PLA    1       9.430  44.290  28.510  1.00  0.00             H
ATOM     16  H52  PLA    1       9.700  45.150  26.970  1.00  0.00             H
ATOM     17  C6   PLA    1      11.420  45.010  28.230  1.00  0.00             C
ATOM     18  H61  PLA    1      12.060  44.190  28.560  1.00  0.00             H
ATOM     19  H62  PLA    1      11.180  45.650  29.080  1.00  0.00             H
ATOM     20  O7   PLA    1      12.130  45.790  27.260  1.00  0.00             O
grep: write error: Broken pipe

Conclusion

In this notebook, we showed you how to use buildH on a mixture of POPC/cholesterol lipids. buildH has to be launched for each lipid separately. If a trajectory with all hydrogens on all lipids is wanted, one has to produce intermediate trajectories at each step. In the figure below is shown a snapshot with all the reconstructed hydrogens on cholesterol molecules (POPC and water are not shown for clarity, image rendered with VMD).

H reconstruction on a POPC/POPE mixture with buildH