fairmd.lipids.api module

API functions for analyzing the FAIRMD Lipids Databank.

Functionality are organized into few groups:

  1. Class UniverseConstructor, which help one to create MDAnalysis.Universe from Databank’s System

  2. Functions that extract computed properties:

  3. Functions that extract post-processed properties:

  4. Auxiliary functions for better interface with MDAnalysis

fairmd.lipids.api.get_thickness(system: System) float[source]

Get thickness for a simulation defined with system from the thickness.json.

Parameters:

system – Simulation object.

Returns:

membrane thickess (nm) or raise exception

fairmd.lipids.api.get_eqtimes(system: System) dict[source]

Return relative equilibration time for each lipid of system.

Parameters:

system – Simulation object.

Returns:

dictionary of relative equilibration times for each lipid

fairmd.lipids.api.get_OP(system: System) dict[source]

Return a dictionary with the order parameter data for each lipid in system.

Parameters:

system – Simulation object.

Returns:

dictionary contaning, for each lipid, the order parameter data: average OP, standard deviation, and standard error of mean. Contains None if LipidNameOrderParameters.json missing.

fairmd.lipids.api.get_FF(system: System) ndarray[source]

Get numpy table of FormFactor curve.

Parameters:

system – Simulation object

Returns:

(q,FF,err) numpy table

fairmd.lipids.api.get_mean_ApL(system: System) float[source]

Calculate average area per lipid for a system.

Parameters:

system – Simulation object.

Returns:

area per lipid (Å^2)

fairmd.lipids.api.get_total_area(system: System) float[source]

Return area of the membrane in the simulation box.

Parameters:

system – Simulation object.

Returns:

area of the system (Å^2)

exception fairmd.lipids.api.UniverseConstructError[source]

Bases: Exception

Specific error for UniverseConstructor

class fairmd.lipids.api.UniverseConstructor(s: System)[source]

Bases: object

Class operating with downloading and constructing Universe for the System.

To use this class, one instantinate it with a particular system, and then download.

s = systems.loc(120)
uc = UniverseConstructor(s)
uc.download_mddata()

After this, the pointer uc.paths will show which files are available to work with. Finally, you can run uc.build_universe() to get the MDAnalysis.Universe object.

property system: System

Link to simulation object.

property paths: dict[str, str | None]

Return dicts of absolute paths of downloaded files.

Allowed fields are: struc, traj, top, energy. If they are not None, then the corresponding file is downloaded and the full path is the value.

download_mddata(*, skip_traj: bool = False) None[source]

Download all the files. Previously downloaded are skipped.

Parameters:

skip_traj – Download only TOP&struc for further constructing single-frame universe

clear_mddata() None[source]

Clear downloaded MD data. For DOI=localhost, do nothing.

build_universe() Universe[source]

Build MDAnalysis Universe.

Replaces outdated system2MDanalysisUniverse.

fairmd.lipids.api.mda_gen_selection_mols(system: System, molecules: Container[Molecule] | None = None) str[source]

Return a MDAnalysis selection string covering all the molecules (default None means “lipids”).

Parameters:
  • system – FAIRMD Lipids dictionary defining a simulation.

  • molecules – container of molecule objects to be included in the selection.

Returns:

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

fairmd.lipids.api.mda_read_trj_tilt_angles(resname: str, a_name: str, b_name: str, universe: Universe)[source]

Calculate the AB vector angles with respect to membrane normal from the simulation.

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

  • a_name – name of the A atom in the simulation

  • b_name – name of the B atom in the simulation

  • universe – 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)