Difference between revisions of "Deer lib gen.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Examples)
Line 95: Line 95:
  
 
==Examples==
 
==Examples==
−
The example below first loads the netset parameters from the ensemble optimised for all peak widths, and then generates a library of 1000 trace/distribution pairs. The example may be run from the '''examples/deernet/''' directory.
+
The example below loads the parameters from one of the example files and generates a library of 1000 DEER traces.
  
 
  % Load the training set parameters
 
  % Load the training set parameters
Line 111: Line 111:
 
   noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters);
 
   noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters);
  
−
This example will add the output libraries to the MATLAB workspace, as well as saving them in the working directory as '''"dlg_example_set.mat"'''
+
One of the resulting DEER traces is shown below.
  
 
<gallery widths=400 heights=300>
 
<gallery widths=400 heights=300>

Revision as of 16:26, 22 August 2018

Generates a library of distance distributions and corresponding DEER traces for use in neural network training. Full details are given in our paper on the subject.

Syntax

    [time_grid,dist_grid,dist_distr_lib,...
     deer_ffact_lib,background_lib,deer_trace_lib,...
     noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters)

Arguments

Required fields of the parameters.* structure:

   min_dist          - lower limit of distance distributions, 
                       Angstrom

   max_dist          - upper limit of distance distributions, 
                       Angstrom

   max_time          - DEER trace duration, seconds

   max_exch          - maximum exchange coupling, MHz
                       (NMR convention)

   min_exch          - minimum exchange coupling, MHz
                       (NMR convention)

   ntraces           - number of traces you wish to generate

   ndistmax          - maximum number of skewed gaussians 
                       in the distance distribution

   npoints           - number of digitisation points in the
                       DEER trace and the distance distribu-
                       tion

   noise_lvl         - RMS noise level as a fraction of the
                       modulation depth

   min_fwhm          - minimum FWHM for a skewed gaussian in
                       the distance distribution, fraction of
                       distance

   max_fwhm          - maximum FWHM for a skewed gaussian in
                       the distance distribution, fraction of
                       distance

   min_skew          - minimum shape parameter for a skewed 
                       gaussian in the distance distribution

   max_skew          - maximum shape parameter for a skewed 
                       gaussian in the distance distribution

   max_mdep          - minimum DEER modulation depth

   min_mdep          - maximum DEER modulation depth

   max_brate         - maximum background signal decay
                       rate, s^-1

   min_brate         - minimum background signal decay 
                       rate, s^-1

   min_bdim          - minimum background dimensionality

   max_bdim          - maximum background dimensionality

Outputs

   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 horizonal 
                       stack of row vectors

   deer_ffact_lib    - all DEER form factors as a horizonal 
                       stack of row vectors

   background_lib    - all background signals as a horizonal 
                       stack of row vectors, shifted and scaled
                       to match DEER traces

   deer_trace_lib    - all complete DEER traces as a horizonal 
                       stack of row vectors

   noise_line_lib    - all noise tracks as a horizonal 
                       stack of row vectors
 
   exchange_lib      - exchange interaction (MHz), a row vector
                       conataining 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 loads the parameters from one of the example files and generates a library of 1000 DEER traces.

	% Load the training set parameters
	run('net_set_any_peaks/netset_params.m'); 

	% Specify number of traces to produce
	parameters.ntraces=1000;

	% Set the training database name
	file_name='dlg_example_set.mat';

	% Generate the training library
	[time_grid,dist_grid,dist_distr_lib,...
 	deer_ffact_lib,background_lib,deer_trace_lib,...
 	noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters);

One of the resulting DEER traces is shown below.

Notes

  • As the dipolar modulation frequency is a cubic function of the inter-spin distance, a scaling relationship exists betweent the distance range and the duration of the DEER signal.

\[\frac{t_A}{r_A^3}=\frac{t_B}{r_B^3} \]

  • An important factor when generating data for training is the dynamic range - the ratio between the longest and shortest distances represented in the training set.
  • The training set DEER traces should be sufficiently discretised (parameters.npoints) to reproduce all frequencies present.

See also

netset_curate.m, train_one_net.m


Version 2.2, authors: Ilya Kuprov, Steve Worswick, Gunnar Jeschke