# deernet.m

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

   [dist_axis,outcomes]=deernet(deer_trace,time_axis,net_dir)


## Arguments

   deer_trace - experimental DEER trace, a column vector

time_axis  - experimental time axis, a column vector in
microseconds, must start at zero and have
a uniform 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

   dist_axis  - distance axis, a column vector (Angstrom)

outcomes   - distance distributions, a horizontal array
of column vectors. The number of column
vectors is equal to the number of networks
in the ensemble.


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 ensemble to use in analysis
netset_location='net_set_any_peaks';


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

    % Load experimental data
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.

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

The input DEER trace must be cropped on the left to make the first point of the trace correspond to the maximum.

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