deer_lib_gen.m
Generates a library of distance distributions and corresponding DEER or RIDME traces for use in neural network training. Full details are given in our papers on the subject:
https://doi.org/10.1126/sciadv.aat5218 https://doi.org/10.1073/pnas.2016917118 https://doi.org/10.1016/j.jmr.2022.107186
Syntax
library=deer_lib_gen(file_name,parameters)
Arguments
Required fields of the parameters.* structure:
max_time - DEER trace duration, seconds max_exch - maximum exchange coupling, fraction of the maximum frequency representable on the current time discretisation grid max_exch - minimum exchange coupling, fraction of the maximum frequency representable on the current time discretisation grid ntraces - number of traces you wish to generate ndistmax - maximum number of skewed gaussians in the distance distribution np_time - number of digitisation points in the DEER trace np_dist - number of digitisation points in the distance distribution npt_acq - number of digitization points actually acquired in a sparsely sampled dataset; points are distributed randomly with uniform sampling probability noise_lvl - maximum RMS noise level as a fraction of the modulation depth (min is zero) min_fwhm - minimum FWHM for a gaussian in the dis- tance distribution, fraction of distance max_fwhm - maximum FWHM for a gaussian in the dis- tance distribution, fraction of distance range max_mdep - minimum DEER modulation depth min_mdep - maximum DEER modulation depth expt - background model, 'deer' or 'ridme' max_brate - maximum background signal decay rate, s^-1 (DEER backgrounds only) min_brate - minimum background signal decay rate, s^-1 (DEER backgrounds only) min_bdim - minimum background dimensionality (DEER backgrounds only) max_bdim - maximum background dimensionality (DEER backgrounds only) max_tshift - maximum number of time discretisation points to shift the trace by, either forward or backward
Outputs
The function returns library.* structure with the following fields:
time_grid - time grid (seconds) as a row vector dist_grid - distance grid (Angsrom) as a row vector dist_distr_lib - all distance distributions as a horizon- tal stack of column vectors background_lib - all background signals as a horizonal stack of column vectors, shifted and scaled to match DEER/RIDME traces deer_noisy_lib - all complete DEER/RIDME traces as a horizonal stack of column vectors deer_clean_lib - DEER traces as they would come out, but without the noise; horizonal stack of column vectors exchange_lib - exchange interaction (MHz), a row vector containing the value for each example parameters - parameters array as received
If a file name is provided, these variables are written into that file.
Examples
The example below generates a library of 1000 DEER traces.
% Load default parameters parameters=library_dd; % Number of traces parameters.ntraces=1000; % Time and distance point counts parameters.np_time=512; parameters.np_dist=512; % PDS experiment type parameters.expt='deer'; % Generate the training library library=deer_lib_gen([],parameters);
One of the resulting DEER traces is shown below.
Notes
Multiple caveats exist in the training process. Please read our papers carefully before training your own networks.
See also
Version 2.8, authors: Ilya Kuprov, Steve Worswick, Jake Keeley, Gunnar Jeschke