API Documentation

Lipid order —

Author:

Ricardo Ramirez

Year:

2024

This code is intended to compute the order parameters of lipids from all atom MD simulations. The functions used to compute order parameters are sn1 and sn2 for the first and the second chain correpondingly. sni function calls to the correponding function order_sni and it calls to the function get_vectors. Thus, getting the order parameters for a period of time using the following equation:

\[SCD = \left|\frac{3}{2}cos^2(\theta_i)-\frac{1}{2}\right|\]

Module

lipidorder.lipid_order.get_vectors(lista)[source]

This function gets a list with a specific carbon (e.g. C34 or C22) and :program: its respective hidrogens (e.g. H4X, H4Y). It computes the vectors that connect the carbons and the hydrogens, computes the \(cos(\theta)^2\) of the angle of these vectors and return the mean of it \(\braket{cos(\theta)^2}\)

Parameters:

lista (list) – Vector of the shape \([C*i, HiX,HiY, HiZ]\), the minimun len is 2 (when the carbon only have one hydrogen) and the maximun is 4 (when there is three hydrogens) Note: If there is N lipids, there will be N carbons and the i represents the position of the carbon in the lipid tail

Returns:

order – Float with the mean of \(\braket{cos(\theta)^2}\)

Return type:

float

Notes

The average of the angle of the i-th carbon for all the lipids in the selection is computed as follows:

\[\braket{cos(\theta_i)^2}\]

where \(\theta_i\) is the angle between the vector that connect the i-th carbon and the hydrogen.

lipidorder.lipid_order.order_sn1(sel, lipid, n_chain)[source]

Code to loop over the number of carbons in the lipid tail and return a vector \([C3i, HiX, HiY, ...]\) that is used in get_vectors Then, make an array of dim n_chain with the mean \(\braket{cos(\theta_i)^2}\)

Parameters:
  • lipid (str) – Name of the lipid to compute the order parameters

  • n_chain (int) – Number of carbond in the lipid tail sn1

Returns:

chains – Vector dim n_chains with the mean

Return type:

ndarray

Notes

The return is a vector containing the value \(\braket{cos^2(\theta_i}\). As follows:

\[[\braket{cos^2(\theta_2}, \braket{cos^2(\theta_3}, ..., \braket{cos^2(\theta_{n_chain}}]\]

The index starts at 2 because since that carbond we account for the lipid tail.

lipidorder.lipid_order.order_sn2(sel, lipid, n_chain)[source]

Code to loop over the number of carbons in the lipid tail and return a vector \([C3i, HiX, HiY, ...]\) that is used in get_vectors Then, make an array of dim n_chain with the mean \(\braket{cos(\theta_i)^2}\)

Parameters:
  • lipid (str) – Name of the lipid to compute the order parameters

  • n_chain (int) – Number of carbond in the lipid tail sn1

Returns:

chains – Vector dim n_chains with the mean

Return type:

ndarray

Notes

The return is a vector containing the value \(\braket{cos^2(\theta_i}\). As follows:

\[[\braket{cos^2(\theta_2}, \braket{cos^2(\theta_3}, ..., \braket{cos^2(\theta_{n_chain}}]\]

The index starts at 2 because since that carbond we account for the lipid tail.

lipidorder.lipid_order.sn1(u, sel_string, lipid, n_chain, start=0, stop=-1, step=1)[source]

Code to compute the order parameters for the sn1 tail. This sn1 tail is caracterized by C3* as the name of the carbons and H*X, H*Y, H*Z for the hydrogens

Parameters:
  • u (universe) – universe element or selection element

  • sel_string (str) – selection of lipids to compute SCD (e.g “resname DSPC”)

  • lipid (str) – lipid to compute the SCD. (May be modified in the future since is a bit redundant)

  • n_chain (int) – integer containing the number of carbons in the lipid tail

  • start (int) – initial frame to start to compute the SCD

  • stop (int) – final frame to compute SCD

  • step (int) – skip frames

Returns:

  • order_parameters ((array dim (2,n_chain))) – array with the values of SCD

  • serror ((array dim n_chain)) – array with the std error of the values

Notes

The formula to compute order parameters is

\[\frac{1}{2} |\braket{3cos(\theta)^2-1}|\]
lipidorder.lipid_order.sn2(u, sel_string, lipid, n_chain, start=0, stop=-1, step=1)[source]

Code to compute the order parameters for the sn2 tail. This sn1 tail is caracterized by C2* as the name of the carbons and H*X, H*Y, H*Z for the hydrogens

Parameters:
  • u (universe) – universe element or selection element

  • sel_string (str) – selection of lipids to compute SCD (e.g “resname DSPC”)

  • lipid (str) – lipid to compute the SCD. (May be modified in the future since is a bit redundant)

  • n_chain (int) – integer containing the number of carbons in the lipid tail

  • start (int) – initial frame to start to compute the SCD

  • stop (int) – final frame to compute SCD

  • step (int) – skip frames

Returns:

  • order_parameters ((array dim n_chain)) – array with the values of SCD

  • serror ((array dim (2,n_chain))) – array with the std error of the values

Notes

The formula to compute order parameters is

\[\frac{1}{2} |\braket{3cos(\theta)^2-1}|\]