clophfit.prenspire#
Parse EnSpire files and optionally build titrations using a note file.
Exceptions:
Exception raised when the lines list has issues. |
|
Raised when there are multiple lines containing a specified search string. |
Classes:
|
Read an EnSpire-generated csv file. |
|
Read and processes an Experimental Note file. |
|
Store titration data and fit results. |
Functions:
|
Return print function when verbose output is True. |
- exception clophfit.prenspire.CsvLineError#
Exception raised when the lines list has issues.
- class clophfit.prenspire.EnspireFile(file, verbose=0)#
Read an EnSpire-generated csv file.
Read the files and check the formats. extract_measurements(): create the measurements dictionary structure storing all data and metadata (description of measurement).
- Parameters:
file (Path) – Path to the EnSpire csv file
verbose (int) – Level of verbosity; 0 is silent, higher values are more verbose (default=0).
- Raises:
Exception – If unexpected format is found.
Examples
>>> from clophfit.prenspire import EnspireFile >>> from pathlib import Path >>> ef = EnspireFile(Path("tests/EnSpire/h148g-spettroC.csv"), verbose=0) >>> ef.measurements['A']['lambda'][2] 274.0
Attributes:
General metadata.
Spectra and metadata for each label, such as "MeasB".
List of exported wells.
Methods:
export_measurements([out_dir])Save measurements, metadata and plots into out_dir.
-
file:
Path#
-
verbose:
int= 0#
-
metadata:
dict[str,str|list[str]]# General metadata.
-
measurements:
dict[str,Any]# Spectra and metadata for each label, such as “MeasB”.
-
wells:
list[str]# List of exported wells.
- export_measurements(out_dir=PosixPath('Meas-0.8.1'))#
Save measurements, metadata and plots into out_dir.
- Return type:
None- Parameters:
out_dir (Path) –
- class clophfit.prenspire.ExpNote(note_file, verbose=0)#
Read and processes an Experimental Note file.
This class is responsible for handling Experimental Note files that describe an EnSpire experiment collecting spectrum. It reads the files and stores the extracted information as a list of lines: note_list and list of wells.
- Parameters:
note_file (Path) – The path to the Experimental Note file to be processed.
verbose (int) – Level of verbosity; 0 is silent, higher values are more verbose (default=0).
Example
>>> from clophfit.prenspire import ExpNote >>> en = ExpNote("tests/EnSpire/h148g-spettroC-nota") >>> en.wells[2] 'A03'
Attributes:
A list of wells generated from the note file.
A list of titrations extracted from the note file.
Methods:
build_titrations(ef)Extract titrations from the given ef (_note file like: <well, pH, Cl>).
-
note_file:
Path#
-
verbose:
int= 0#
-
wells:
list[str]# A list of wells generated from the note file.
- build_titrations(ef)#
Extract titrations from the given ef (_note file like: <well, pH, Cl>).
- Return type:
None- Parameters:
ef (EnspireFile) –
- exception clophfit.prenspire.ManyLinesFoundError#
Raised when there are multiple lines containing a specified search string.
- class clophfit.prenspire.Titration(conc, data, cl=None, ph=None)#
Store titration data and fit results.
Methods:
plot()Plot the titration spectra.
- Parameters:
conc (Sequence[float]) –
data (dict[str, pd.DataFrame]) –
cl (str | None) –
ph (str | None) –
- plot()#
Plot the titration spectra.
- Return type:
None
- clophfit.prenspire.verbose_print(verbose)#
Return print function when verbose output is True.
- Return type:
Callable[...,Any]- Parameters:
verbose (int) –