NMRlipids databank API functions

The functions that help analyzing data in the NMRlipids databank are described here. These functions locate in databanklibrary.py. To get started using these functions, first create the folder where you want to work

mkdir NMRlipids/
cd NMRlipids

then clone the NMRlipids databank git into this folder

git clone https://github.com/NMRLipids/Databank.git
cd Databank
pip install -e .

You can then start to work with the template or write a code from the scratch. The minimum python code to intialize NMRlipids databank is

import DatabankLib
from DatabankLib.core import initialize_databank

systems = initialize_databank(databankPath)

After running this, systems is the list of dictionaries where each dictionary is a simulation in the NMRlipids databank. A simulation dictionary contains the content of the README.yaml for that simulation. The content of README.yaml files is described in User input and content of README.yaml files. systems can be then used to loop over all simulations:

for system in systems:
    print(system)

Examples on analyses over NMRlipids databank can be found from the template and codes used to analyze the results for the NMRlipids databank manuscript.

The functions available to analyze the simulations are listed in here:

Library contains all API functions and many functions used in building and analyzing the NMRlipids databank

DatabankLib.databankLibrary.CalcAreaPerMolecule(system)[source]

Calculates average area per lipid for a simulation defined with system. It is using the apl.json file where area per lipid as a function of time calculated by the calcAPL.py is stored.

Parameters:

system – NMRlipids databank dictionary defining a simulation.

Returns:

area per lipid (Å^2)

DatabankLib.databankLibrary.GetThickness(system)[source]

Gets thickness for a simulation defined with system from the thickness.json file where thickness calculated by the calc_thickness.py is stored.

Parameters:

system – NMRlipids databank dictionary defining a simulation.

Returns:

membrane thickess (nm) or None

DatabankLib.databankLibrary.ShowEquilibrationTimes(system: dict)[source]

Prints relative equilibration time for each lipid within a simulation defined by system. Relative equilibration times are calculated with NMRPCA_timerelax.py and stored in eq_times.json files.

Parameters:

system – NMRlipids databank dictionary defining a simulation.

DatabankLib.databankLibrary.GetNlipids(system)[source]

Returns the total number of lipids in a simulation defined by system.

Parameters:

system – NMRlipids databank dictionary defining a simulation.

Returns:

the total number of lipids in the system.

DatabankLib.databankLibrary.getLipids(system, molecules=dict_keys(['POPC', 'POPG', 'POPS', 'POPE', 'PYPC', 'PAzePCprot', 'PAzePCdeprot', 'DMPC', 'DPPC', 'DPPE', 'DPPG', 'DEPC', 'DRPC', 'DYPC', 'DLPC', 'DLIPC', 'DOG', 'DOPC', 'DOPE', 'DDOPC', 'DOPS', 'DSPC', 'DAPC', 'DMTAP', 'SDG', 'SDPE', 'SOPC', 'POPI', 'SAPI', 'SAPI24', 'SAPI25', 'SLPI', 'CER', 'CER180', 'CHOL', 'DCHOL', 'DHMDMAB', 'SLiPC', 'SM16', 'SM18', 'TOCL', 'TLCL_0H', 'TMCL', 'GM1', 'DPPGK', 'GB3', 'BOG']))[source]

Returns a string using MDAnalysis notation that can used to select all lipids from the system.

Parameters:

system – NMRlipids databank dictionary defining a simulation.

Returns:

a string using MDAnalysis notation that can used to select all lipids from the system.

DatabankLib.databankLibrary.simulation2universal_atomnames(system, molecule, atom)[source]

Get force field specific atom name corresponding to universal atom name from the system.

Parameters:
  • mapping_file – path for the mapping file

  • atom1 – universal atom name

Returns:

force field specific atom name

DatabankLib.databankLibrary.loadMappingFile(mapping_file)[source]

Load mapping file into a dictionary

Param:

name of the mapping file

Returns:

mapping dictionary

DatabankLib.databankLibrary.getAtoms(system, lipid)[source]

Return system specific atom names of a lipid

Parameters:
  • system – system dictionary

  • lipid – universal lipid name

Returns:

string of system specific atom names

DatabankLib.databankLibrary.getUniversalAtomName(system: dict, atomName: str, lipid: str)[source]

Returns the universal atom name corresponding the simulation specific atomName of a lipid in a simulation defined by the system.

Parameters:
  • system – system dictionary

  • atomName – simulation specific atomname

  • lipid – universal lipid name

Returns:

universal atomname (string) or None

DatabankLib.databankLibrary.system2MDanalysisUniverse(system)[source]

Takes the system dictionary as an input, downloads the required files to the NMRlipids databank directory and retuns MDAnalysis universe corressponding the system.

Parameters:

system – NMRlipids databank dictionary describing the simulation.

Returns:

MDAnalysis universe

DatabankLib.databankLibrary.read_trj_PN_angles(molname: str, atom1: str, atom2: str, MDAuniverse: Universe)[source]

Calculates the P-N vector angles with respect to membrane normal from the simulation defined by the MDAnalysis universe.

Parameters:
  • molname – residue name of the molecule for which the P-N vector angle will be calculated

  • atom1 – name of the P atom in the simulation

  • atom2 – name of the N atom in the simulation

  • MDAuniverse – MDAnalysis universe of the simulation to be analyzed

Returns:

tuple (angles of all molecules as a function of time, time averages for each molecule, the average angle over time and molecules, the error of the mean calculated over molecules)

DatabankLib.databankLibrary.calcArea(system)[source]

Returns area of the calculated based on the area per lipid stored in the databank.

Parameters:

system – a system dictionary

Returns:

area of the system (Å^2)

DatabankLib.databankLibrary.GetFormFactorMin(system)[source]

Return list of minima of form factor of system.

Parameters:

system – a system dictionary

Returns:

list of form factor minima

DatabankLib.databankLibrary.averageOrderParameters(system)[source]

Returns average order paramaters of sn-1 and sn-2 acyl chains based on universal atom names. The names starting with M_G1C will be assigned to sn-1 and names starting M_G2C to sn-2.

Parameters system:

a system dictionary

Returns:

average of sn-1 and sn-2 order parameters

DatabankLib.databankLibrary.calcLipidFraction(system, lipid)[source]

Returns the number fraction of lipid with respect to total number of lipids.

Parameters:
  • system – a system dictionary

  • lipid – universal molecule name of lipid

Returns:

number fraction of lipid with respect total number of lipids

DatabankLib.databankLibrary.getHydrationLevel(system)[source]

Returns hydration level of the system, i.e., number of water molecules divided by number of lipid molecules.

Parameters:

system – a system dictionary

Returns:

number of water molecules divided by number of lipid molecules