fairmd.lipids.experiment module
Module for handling experimental data entries in the databank.
This module defines classes to represent different types of experimental datasets,
they inherit from a common abstract base class Experiment which implements
internal SampleComposition class for retrieving sample composition information.
Two concrete experiment types are implemented: OPExperiment for ssNMR order parameter data
and FFExperiment for form factor data.
- exception fairmd.lipids.experiment.ExperimentError[source]
Bases:
ExceptionExperiment-related exception
- class fairmd.lipids.experiment.Experiment(exp_id: str, path: str)[source]
Bases:
SampleCompositionAbstract base class representing an experimental dataset in the databank.
Implements important methods from
SampleComposition:get_hydration(),membrane_composition(), andsolution_composition(). Additionally, defines abstract properties for accessing experiment data (data) and metadata.- property metadata: dict
Access the experiment’s metadata.
- property readme: dict
Provides access to the experiment’s metadata (for backward compatibility).
- property exp_id: str
The unique identifier of the experiment.
- property path: str
The absolute path to the experiment’s directory.
- abstract property data: dict
Provide access to the experiment’s data.
- abstractmethod verify_data() None[source]
Verify the integrity and consistency of the experiment’s data.
- abstract property exptype: str
The type of the experiment.
- 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)
- class fairmd.lipids.experiment.OPExperiment(exp_id: str, path: str)[source]
Bases:
ExperimentRepresents an ssNMR order parameter experiment.
dataprovides access to a dictionary where keys are lipid names and values are dictionaries mapping atom unique names to their order parameters.verify_data()checks that all atom unique names in the data correspond to known atoms in the lipid mapping.- property data: dict
Provide access to the experiment’s data.
- property exptype: str
The type of the experiment.
- class fairmd.lipids.experiment.FFExperiment(exp_id: str, path: str)[source]
Bases:
ExperimentRepresent a SAXS form-factor experiment.
dataprovides access to a table with the first column is Q(A-1), second is the intensity, and third is error.verify_data()is not currently implemented for FF.- property data: dict
Provide access to the experiment’s data.
- property exptype: str
The type of the experiment.
- class fairmd.lipids.experiment.ExperimentCollection(*args, **kwargs)[source]
Bases:
CollectionSingleton[Experiment]A collection of experiments.
- static load_from_data(exp_type: Literal['OPExperiment', 'FFExperiment'] = 'OPExperiment') ExperimentCollection[source]
Load experiment data from the designated directory.