Difference between revisions of "Deer lib gen.m"

From Spinach Documentation Wiki
Jump to: navigation, search
Line 6: Line 6:
 
     [time_grid,dist_grid,dist_distr_lib,...
 
     [time_grid,dist_grid,dist_distr_lib,...
 
       deer_ffact_lib,background_lib,deer_trace_lib,...
 
       deer_ffact_lib,background_lib,deer_trace_lib,...
−
       noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters)
+
       deer_clean_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters)
  
 
==Arguments==
 
==Arguments==
Line 37: Line 37:
 
                         modulation depth
 
                         modulation depth
 
   
 
   
−
     min_fwhm          - minimum FWHM for a skewed gaussian in
+
     min_fwhm          - minimum FWHM for a gaussian in the dis-
−
                         the distance distribution, fraction of
+
                         tance distribution, fraction of distance
−
                        distance
 
 
   
 
   
−
     max_fwhm          - maximum FWHM for a skewed gaussian in
+
     max_fwhm          - maximum FWHM for a gaussian in the dis-
−
                         the distance distribution, fraction of
+
                         tance distribution, fraction of distance
−
                        distance
+
                         range
−
 
−
    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
 
     max_mdep          - minimum DEER modulation depth
Line 84: Line 77:
 
                         stack of row vectors
 
                         stack of row vectors
 
   
 
   
−
     noise_line_lib   - all noise tracks as a horizonal
+
     deer_clean_lib   - DEER traces as they would come out, but
−
                         stack of row vectors
+
                         without the noise
 
    
 
    
 
     exchange_lib      - exchange interaction (MHz), a row vector
 
     exchange_lib      - exchange interaction (MHz), a row vector
Line 98: Line 91:
  
 
  % Load the training set parameters
 
  % Load the training set parameters
−
  run('net_set_any_peaks/netset_params.m');  
+
  netset_params;  
 
   
 
   
 
  % Specify number of traces to produce
 
  % Specify number of traces to produce
Line 108: Line 101:
 
  % Generate the training library
 
  % Generate the training library
 
  [time_grid,dist_grid,dist_distr_lib,...
 
  [time_grid,dist_grid,dist_distr_lib,...
−
  deer_ffact_lib,background_lib,deer_trace_lib,...
+
        deer_ffact_lib,background_lib,deer_trace_lib,...
−
  noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters);
+
        deer_clean_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters)
  
 
One of the resulting DEER traces is shown below.
 
One of the resulting DEER traces is shown below.

Revision as of 11:09, 10 November 2020

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,...
     deer_clean_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 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

   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

   deer_clean_lib    - DEER traces as they would come out, but
                       without the noise
 
   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
	netset_params; 

	% 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,...
        deer_clean_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters)

One of the resulting DEER traces is shown below.

Notes

Multiple caveats exist in the training process. Please read our paper carefully before training your own networks.

See also

Neural network module

DEER/PELDOR experiments


Version 2.5, authors: Ilya Kuprov, Steve Worswick, Jake Keeley, Gunnar Jeschke