Difference between revisions of "Deernet.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Examples)
Line 4: Line 4:
 
==Syntax==
 
==Syntax==
  
−
     [dist_axis,outcomes]=deernet(deer_trace,time_axis,net_dir)
+
     dataset=deernet(deer_trace,time_axis)
  
 
==Arguments==
 
==Arguments==
  
−
     deer_trace - experimental DEER trace, a column vector
+
     deer_trace - experimental DEER trace, a real column vec-
 +
                tor, must be phased into pure absorption and
 +
                cropped on the left to make the first point
 +
                correspond to the echo modulation maximum
 
   
 
   
−
     time_axis  - experimental time axis, a column vector in
+
     time_axis  - experimental time axis in seconds, a column
−
                 microseconds, must start at zero and have
+
                 vector; must start at zero and have uniform
−
                 a uniform time step
+
                 time step
−
 
−
    net_dir    - directory containing the network ensemble
 
−
                as *.m files generated by [[train_one_net.m]]
 
−
                and the corresponding netset_params.m and
 
−
                good_nets.mat files.
 
  
 
==Outputs==
 
==Outputs==
 +
The function displays a figure if no outputs are requested, or returns a data structure with the following fields.
  
−
     dist_axis - distance axis, a column vector (Angstrom)
+
     dataset.input.
 +
 +
        time_axis  - time axis, as supplied by the user
 +
 +
        deer_trace - DEER trace, as supplied by the user
 +
 +
    dataset.deernet.
 +
 +
        parameters - the parameters of the library with which
 +
                    current DEERNet had been trained
 +
 +
        resampled_time_axis  - time axis after the data was re-
 +
                              sampled to match DEERNet input
 +
                              dimension
 +
 +
        resampled_deer_trace  - DEER trace after the data was
 +
                                resampled to match DEERNet in-
 +
                                put dimension
 +
 +
        deernet_rmin  - left edge of the distance grid as com-
 +
                        puted from the user-supplied time trace
 +
                        duration and DEERNEt input point count
 +
 +
        deernet_rmax  - right edge of the distance grid as com-
 +
                        puted from the user-supplied time trace
 +
                        duration and DEERNEt input point count
 +
 +
        input_rmin  - left edge of the distance grid as compu-
 +
                      ted from the user-supplied time trace du-
 +
                      duration and point count
 +
 +
        input_rmax  - right edge of the distance grid as compu-
 +
                      ted from the user-supplied time trace du-
 +
                      duration and point count
 +
 +
    dataset.output.
 +
 +
        backgrounds - background signal from each of the back-
 +
                      ground extraction networks in the netset
 +
 +
        background_mean - arithmetic mean of the background sig-
 +
                          nal over the netset
 +
 +
        background_lb - 95% confidence interval lower bound for
 +
                        the background signal obtained from net-
 +
                        set statistics
 +
 +
        background_ub - 95% confidence interval upper bound for
 +
                        the background signal obtained from net-
 +
                        set statistics
 +
 +
        bckg_time_axis - the time axis vector matching the back-
 +
                        ground signals and statistics above
 +
 +
        bckg_jacobs - Jacobians from each of the background ex-
 +
                      traction networks in the netset
 +
 +
        dist_distrs - distance distributions from all distance
 +
                      distribution networks in the netset
 +
 +
        dist_distr_mean - arithmetic mean of the distance dist-
 +
                          ributions over the netset
 +
 +
        dist_distr_lb - 95% confidence interval lower bound for
 +
                        the distance distribution obtained from
 +
                        netset statistics
 +
 +
        dist_distr_ub - 95% confidence interval upper bound for
 +
                        the distance distribution obtained from
 +
                        netset statistics
 +
 +
        dist_axis - the distance axis matching the distance dis-
 +
                    ribution and satisfying the constraints im-
 +
                    posed by both the timing of the input signal
 +
                    or the limits of DEERNet, whichever is more
 +
                    stringent
 
   
 
   
−
    outcomes  - distance distributions, a horizontal array
+
        dist_jacobs - Jacobians from each of the distance dist-
−
                of column vectors. The number of column
+
                      ribution networks in the netset
−
                vectors is equal to the number of networks
 
−
                in the ensemble.
 
  
 
If no output parameters are specified, the function produces a plot.
 
If no output parameters are specified, the function produces a plot.
Line 62: Line 134:
  
 
==Notes==
 
==Notes==
−
The input DEER trace must be cropped on the left to make the first point of the trace correspond to the maximum.
+
#The input DEER trace must be cropped on the left to make the first point of the trace correspond to the maximum.
 +
#Do not supply excessively long baseline tails in the input data - unlike Tikhonov tools, DEERNet does not need those, it works better if you cut off baseline tails.
  
 
[[file:deernet_preprocess.png]]
 
[[file:deernet_preprocess.png]]

Revision as of 10:12, 10 November 2020

Uses pre-trained neural networks to extract distance distributions from DEER data. See our paper (https://dx.doi.org/10.1126/sciadv.aat5218) for further details.

Syntax

   dataset=deernet(deer_trace,time_axis)

Arguments

   deer_trace - experimental DEER trace, a real column vec-
                tor, must be phased into pure absorption and
                cropped on the left to make the first point
                correspond to the echo modulation maximum

   time_axis  - experimental time axis in seconds, a column
                vector; must start at zero and have uniform
                time step

Outputs

The function displays a figure if no outputs are requested, or returns a data structure with the following fields.

   dataset.input.

       time_axis  - time axis, as supplied by the user

       deer_trace - DEER trace, as supplied by the user

   dataset.deernet.

       parameters - the parameters of the library with which 
                    current DEERNet had been trained

       resampled_time_axis  - time axis after the data was re-
                              sampled to match DEERNet input
                              dimension

       resampled_deer_trace  - DEER trace after the data was
                               resampled to match DEERNet in-
                               put dimension

       deernet_rmin  - left edge of the distance grid as com-
                       puted from the user-supplied time trace
                       duration and DEERNEt input point count

       deernet_rmax  - right edge of the distance grid as com-
                       puted from the user-supplied time trace
                       duration and DEERNEt input point count

       input_rmin  - left edge of the distance grid as compu-
                     ted from the user-supplied time trace du-
                     duration and point count

       input_rmax  - right edge of the distance grid as compu-
                     ted from the user-supplied time trace du-
                     duration and point count

   dataset.output.

       backgrounds - background signal from each of the back-
                     ground extraction networks in the netset

       background_mean - arithmetic mean of the background sig-
                         nal over the netset

       background_lb - 95% confidence interval lower bound for
                       the background signal obtained from net-
                       set statistics

       background_ub - 95% confidence interval upper bound for
                       the background signal obtained from net-
                       set statistics

       bckg_time_axis - the time axis vector matching the back-
                        ground signals and statistics above

       bckg_jacobs - Jacobians from each of the background ex-
                     traction networks in the netset

       dist_distrs - distance distributions from all distance
                     distribution networks in the netset

       dist_distr_mean - arithmetic mean of the distance dist-
                         ributions over the netset

       dist_distr_lb - 95% confidence interval lower bound for
                       the distance distribution obtained from
                       netset statistics

       dist_distr_ub - 95% confidence interval upper bound for
                       the distance distribution obtained from
                       netset statistics

       dist_axis - the distance axis matching the distance dis-
                   ribution and satisfying the constraints im-
                   posed by both the timing of the input signal
                   or the limits of DEERNet, whichever is more
                   stringent

       dist_jacobs - Jacobians from each of the distance dist-
                     ribution networks in the netset

If no output parameters are specified, the function produces a plot.

Examples

The example below shows the use of DEERNet to extract a distance distribution for Sample V (as described in our paper on the subject). This example may be run from within examples/deernet/. First the network ensemble optimized for processing any width of distribution is selected:

    % Select the network set
    netset_location='./net_set_dipolar';

The experimental data is loaded, and the time axis is converted to microseconds:

    % Load experimental data
    expt_data=load('sample_set_paper/sample_V_DEERNet_input.dat','-ASCII');
    deer_trace=expt_data(:,2);
    time_axis=expt_data(:,1)*1e-6;

The data is then presented to the selected network ensemble:

    % Run deernet analysis
    deernet(deer_trace,time_axis,netset_location);

With no output arguments requested in the call to DEERNet, the following plot is produced.

Deernet sampleV.png


Further examples are available under examples/deernet/

  • example_set_paper.m - The six examples used in the paper on DEERNet.
  • example_set_deeran.m - Selection of the examples included with the DeerAnalysis package.
  • example_set_exchange.m - Examples of DEER traces in the presence of significant exchange interaction. Data provided by Sabine Richert et al., from the supplementary information of their paper available here.

Notes

  1. The input DEER trace must be cropped on the left to make the first point of the trace correspond to the maximum.
  2. Do not supply excessively long baseline tails in the input data - unlike Tikhonov tools, DEERNet does not need those, it works better if you cut off baseline tails.

Deernet preprocess.png

This is done automatically in elexsys2deernet.m, and this is the only preprocessing required by DEERNet - it can handle background and noise.

See also

Neural network module

DEER/PELDOR experiments


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