Use cases

This section provides several examples of how basic operations might be structured. A typical analysis routine is generally divided into two parts: first, the settings are defined using the screamlab.settings.Properties class, followed by the determination of peak information using screamlab.datset.Dataset.

Specifying properties

This Python code is configuring properties related to an experiment, specifically designed to handle SCREAM-DNP data provided from Bruker’s TopSpin software. Important in any cases is to specify the path to a folder where the experiments are saved, determine the experiments to be analyzed (using experiment numbers), and defines the output folder for the results. The experiments can be provided in two different formats. A list like [1,8] means that all experiments from 1 to 8 should be included, or it can be more specific by defining a list with all the experiments, e.g., [1,5,9,12,13,18].”

1from screamlab import settings, dataset
2
3props = settings.Properties()
4props.path_to_experiment = r"/path/to/dataset"
5props.expno = [1, 8]
6props.output_folder = r"/path/to/output"

There is also the option of further, optional customisation depending on the requirements. In many cases, it is practical to carry out a prefit on one specific spectrum in order to minimise computing times. To do this specify the following:

1props.prefit = True             # Default option is False
2props.spectrum_for_prefit = 3   # Default option is -1 meaning the last entry in the expno list

Note that the value in spectrum_for_prefit refers to the position on an experiment in the expno list and not to the experiment number. Also it can be specified wich buildup model should be used for evaluation. There are four options: exponential, exponential with offset, biexponential, and biexponential with offset and either one or multiple can performt during one analysis by providing a list as follows:

1props.buildup_types = [ "exponential",]
2#Performs buidlup fit using a simple exponential. Default option
3
4props.buildup_types = [ "exponential", "exponential_with_offset", "biexponential", ]
5#Performs three buildup fits using first an exponential model,
6#then an exponential wiht offset followd by a biexponential model.

Adding peaks and start analysis

In this code segment, a new dataset object is instantiated and assigned to the variable ds. Following this, the properties of the dataset are set by assigning the props object to ds.props, thereby configuring the dataset with parameters set in the paragraph before.

1ds = dataset.Dataset()
2ds.props = props

The add_peak() function adds a single peak to a dataset. The only required argument is the peak center, which must be specified with an accuracy of ±1 ppm. Multiple peaks can be added by repeatedly calling the add_peak() method.

1ds.add_peak(-16)
2ds.start_analysis()

This section outlines the minimum required specifications for conducting a functional evaluation of SCREAM-DNP data. While default settings are provided, several parameters for each peak can be customized to refine the analysis:

  • Peak label: By default, peaks are labeled as “Peak_at_<xxx>_ppm”, where <xxx> corresponds to the chemical shift in ppm. Custom labels can be assigned as needed.

1ds.add_peak(25, peak_label="C_alpha")
  • Peak sign: The default sign is set to negative (“-“), but users may explicitly define the expected peak polarity.

1ds.add_peak(25, peak_sign="+")
  • Peak profile: Peaks are fitted using a Voigt profile (“voigt”) by default. Alternatively, a Gaussian (“gauss”) or Lorentzian (“lorentz”) line shape can be specified.

1ds.add_peak(25, fitting_type="gauss")
  • Fitting interval for line broadening: The line broadening parameters — sigma (Gaussian width) and gamma (Lorentzian width) — are allowed to vary within a default interval of 0 to 3 ppm. This range can be adjusted to accommodate specific fitting requirements.

1ds.add_peak(25, fitting_type="gauss", line_broadening={"sigma": {"min": 1, "max": 5}})
2ds.add_peak(25, fitting_type="lorentz", line_broadening={"gamma": {"min": 2, "max": 12}})
3ds.add_peak(25, fitting_type="voigt", line_broadening={"sigma": {"min": 0, "max": 1}, "gamma": {"min": 1, "max": 2}})

These options provide flexibility in tailoring the analysis to the characteristics of the measured data, ensuring accurate and reproducible spectral fitting.