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: Exception

Experiment-related exception

class fairmd.lipids.experiment.Experiment(exp_id: str, path: str)[source]

Bases: SampleComposition

Abstract base class representing an experimental dataset in the databank.

Implements important methods from SampleComposition: get_hydration(), membrane_composition(), and solution_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.

classmethod target_folder() str[source]

Get target folder name for the experiment type.

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

Get system hydration.

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)

solution_composition(basis='molar')[source]

Return the composition of the solution in system.

class fairmd.lipids.experiment.OPExperiment(exp_id: str, path: str)[source]

Bases: Experiment

Represents an ssNMR order parameter experiment.

data provides 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.

verify_data() None[source]

Verify the integrity and consistency of the experiment’s data.

property exptype: str

The type of the experiment.

classmethod target_folder() str[source]

Get target folder name for the experiment type.

class fairmd.lipids.experiment.FFExperiment(exp_id: str, path: str)[source]

Bases: Experiment

Represent a SAXS form-factor experiment.

data provides 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.

verify_data() None[source]

Verify the integrity and consistency of the experiment’s data.

property exptype: str

The type of the experiment.

classmethod target_folder() str[source]

Get target folder name for the experiment type.

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.