Exporting membrane normals
You can configure gorder
to export dynamically calculated membrane normals into an external file. This can be useful for verifying the correctness of the calculation, reusing results for further analyses, or ensuring reproducibility.
To export dynamically calculated membrane normals, add the export
keyword to the membrane_normal
section of your configuration file and specify the path to the output file:
membrane_normal: !Dynamic
heads: "name P"
export: "normals.yaml" # or collect: "normals.yaml"
Alternatively, you can use the collect
keyword instead of export
.
The membrane normal is estimated from the shape of the membrane for each lipid molecule in every analyzed frame (for details, see this section of the manual). The calculated membrane normals are collected and written to normals.yaml
. The data are exported in YAML format and can be directly reused in subsequent gorder
run using membrane_normal: !FromFile normals.yaml
. Since the output file is a valid YAML, you an also easily process it using other software.
Note that exporting membrane normals is only supported for dynamically calculated normals. You cannot export static normals (aligned with the
x
,y
, orz
axis) or manually assigned normals, since that would be pointless.
Below is an example of exported membrane normals from a very short trajectory of only a few lipids (part of a larger system that is ignored here for brevity):
# Membrane normals file generated by 'gorder v1.2.0' using trajectory file 'md.xtc'.
POPC:
# Frame index 1
- [[ 0.001220,-0.097192,-0.995265],[ 0.056732, 0.043663,-0.997434],[ 0.027993,-0.050879,-0.998312],[ 0.104689,-0.052774,-0.993104],[ 0.019110,-0.122940, 0.992230]]
# Frame index 2
- [[ 0.027892, 0.110019, 0.993538],[ 0.084509, 0.029770,-0.995978],[-0.040769, 0.034053, 0.998588],[ 0.134922,-0.062836,-0.988862],[ 0.020835,-0.139281, 0.990034]]
# Frame index 3
- [[ 0.036983, 0.024326, 0.999020],[ 0.113137,-0.034967,-0.992964],[-0.104049, 0.023076, 0.994304],[ 0.105232,-0.030009,-0.993995],[ 0.022746, 0.074999,-0.996924]]
POPE:
# Frame index 1
- [[ 0.000173,-0.064731,-0.997903],[ 0.097800,-0.069111,-0.992804],[ 0.004671, 0.137453, 0.990497],[ 0.041146,-0.053463,-0.997722],[ 0.002555,-0.003166, 0.999992]]
# Frame index 2
- [[ 0.037803,-0.048073,-0.998128],[ 0.058845,-0.095387,-0.993700],[ 0.007233, 0.204367, 0.978868],[-0.067056, 0.023346, 0.997476],[ 0.057067,-0.034264, 0.997782]]
# Frame index 3
- [[ 0.081806,-0.077921,-0.993598],[ 0.084231,-0.018487,-0.996275],[ 0.052119, 0.126407, 0.990608],[-0.071433,-0.016294, 0.997312],[ 0.046818,-0.043789, 0.997943]]
Data are written separately for each molecule type. Within each block, every line beginning with -
corresponds to one analyzed trajectory frame. Each inner [x, y, z]
vector represents the membrane normal for a specific molecule in that frame. Molecules are listed in the order in which their first atom appears in the input structure file.
Note: The above data come from a planar membrane built in the
xy
plane. Therefore, thex
andy
components of each normal vector are close to0
, while thez
components are close to±1
. Thez
component may be close to+1
or close to−1
because a normal vector can point in two valid directions—in the case of a planar membrane, either "up" or "down". The orientation chosen bygorder
is undefined and should not be relied upon. While this does not affect the calculated order parameters, you should keep it in mind if you plan to reuse the normal vectors in applications where their direction is important.
Missing membrane normals
When calculating membrane normals in a dynamically selected region of a membrane, normals are computed only for lipids that are actually needed—that is, lipids with at least one bond located within the specified region in a given frame. As a result, some membrane normals may be missing in the exported file.
Below is an example of exported membrane normals from the same system, but with order parameters calculated only inside a z
-axis–oriented cylinder at the center of the membrane:
# Membrane normals file generated by 'gorder v1.2.0' using trajectory file 'md.xtc'.
POPC:
# Frame index 1
- [[.nan ,.nan ,.nan ],[ 0.056732, 0.043663,-0.997434],[.nan ,.nan ,.nan ],[.nan ,.nan ,.nan ],[ 0.019110,-0.122940, 0.992230]]
# Frame index 2
- [[ 0.027892, 0.110019, 0.993538],[ 0.084509, 0.029770,-0.995978],[.nan ,.nan ,.nan ],[.nan ,.nan ,.nan ],[ 0.020835,-0.139281, 0.990034]]
# Frame index 3
- [[ 0.036983, 0.024326, 0.999020],[ 0.113137,-0.034967,-0.992964],[.nan ,.nan ,.nan ],[.nan ,.nan ,.nan ],[.nan ,.nan ,.nan ]]
POPE:
# Frame index 1
- [[ 0.000173,-0.064731,-0.997903],[.nan ,.nan ,.nan ],[.nan ,.nan ,.nan ],[ 0.041146,-0.053463,-0.997722],[ 0.002555,-0.003166, 0.999992]]
# Frame index 2
- [[ 0.037803,-0.048073,-0.998128],[.nan ,.nan ,.nan ],[ 0.007233, 0.204367, 0.978868],[-0.067056, 0.023346, 0.997476],[ 0.057067,-0.034264, 0.997782]]
# Frame index 3
- [[ 0.081806,-0.077921,-0.993598],[.nan ,.nan ,.nan ],[.nan ,.nan ,.nan ],[-0.071433,-0.016294, 0.997312],[ 0.046818,-0.043789, 0.997943]]
Missing membrane normals are represented as [nan, nan, nan]
. This allows you to identify which specific lipids were included in the calculation of order parameters in each frame. However, if you want to obtain all membrane normals, you must compute order parameters for the full set of lipids.