Scripts.DatabankLib.databankLibrary module

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

Scripts.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)

Scripts.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

Scripts.DatabankLib.databankLibrary.ShowEquilibrationTimes(system: System)[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.

Scripts.DatabankLib.databankLibrary.GetEquilibrationTimes(system: System)[source]

Returns 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.

Returns:

dictionary of relative equilibration times for each lipid

Scripts.DatabankLib.databankLibrary.GetNlipids(system: 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.

Scripts.DatabankLib.databankLibrary.getLipids(system: System, molecules=LipidSet[{'TOCL', 'CHOL', 'POPC', 'POPE', 'DPPC'}])[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.

Scripts.DatabankLib.databankLibrary.simulation2universal_atomnames(system: System, molname: str, atom: str)[source]

Maps an atomic name from the simulation system to the corresponding universal atomic name based on the provided molecule and atom. This function attempts to retrieve the atomic name using the mapping dictionary or None.

Parameters:
  • system – The simulation system object

  • molname – The name of the molecule

  • atom – The specific atom name

Returns:

The universal atomic name or None (if not found)

Scripts.DatabankLib.databankLibrary.loadMappingFile(mapping_file)[source]

This function is deprecated. Use Molecule.register_mapping() from DatbankLib.settings.molecules instead.

Scripts.DatabankLib.databankLibrary.getAtoms(system: System, lipid: str)[source]

Return system specific atom names of a lipid

Parameters:
  • system – System simulation object

  • lipid – universal lipid name

Returns:

string of system specific atom names

Scripts.DatabankLib.databankLibrary.getUniversalAtomName(system: System, atom_name: str, molname: 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

  • atom_name – simulation specific atomname

  • molname – universal lipid name

Returns:

universal atomname (string) or None

Scripts.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

Scripts.DatabankLib.databankLibrary.read_trj_PN_angles(molname: str, atom1: str, atom2: str, mda_universe: 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)

Scripts.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)

Scripts.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

Scripts.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

Scripts.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

Scripts.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