fairmd.lipids.core module

Core databank class and system initialization function.

Imported by fairmd.lipids.databankLibrary by default. Can be imported without additional libraries to scan Databank system file tree!

class fairmd.lipids.core.System(data: dict | Mapping)[source]

Bases: MutableMapping

Main Databank single object.

It is an extension of a dictionary with additional functionality.

property readme: dict

Get the README dictionary of the system in true dict format.

Returns:

dict-type README (dict)

property content: dict[str, Molecule]

Returns dictionary of molecule objects.

property lipids: dict[str, Lipid]

Returns dictionary of lipid molecule objects.

property n_lipids: int

Returns total number of lipid molecules in the system.

membrane_composition(basis: Literal['molar', 'mass'] = 'molar') dict[str, float][source]

Return the composition of the membrane in system.

Parameters:

which – Type of composition to return. Options are: - “molar”: compute molar fraction - “mass”: compute mass fraction

Returns:

dictionary (universal molecule name -> value)

get_hydration(basis: Literal['number', 'mass'] = 'number') float[source]

Get system hydration.

class fairmd.lipids.core.SystemsCollection(iterable: Sequence[System] = [])[source]

Bases: Sequence[System]

Immutable collection of system dicts. Can be accessed by ID using loc().

loc(sid: int) System[source]

Locate system by its ID.

Parameters:

sid – System ID

Returns:

System object with ID sid

class fairmd.lipids.core.Databank[source]

Bases: object

Representation of all simulation in the NMR lipids databank.

path should be the local location of {FMDL_DATA_PATH}/Simulations/ in the FAIRMD Lipids folder. Example usage to loop over systems:

path = 'BilayerData/Simulations/'
db_data = databank(path)
systems = db_data.get_systems()

for system in systems:
    print(system)
get_systems() SystemsCollection[source]

List all systems in the FAIRMD Lipids.

fairmd.lipids.core.initialize_databank() SystemsCollection[source]

Intialize the FAIRMD Lipids.

Returns:

list of dictionaries that contain the content of README.yaml files for each system.

fairmd.lipids.core.print_README(system: str | Mapping) None[source]

Print the content of system dictionary in human readable format.

Parameters:

system – FAIRMD Lipids dictionary defining a simulation or “example”.