pic
Description¶
This module contains all the functions used to quantify and analyze MU persistent inward currents.
Currently includes delta F.
          compute_deltaf(emgfile, smoothfits, average_method='test_unit_average', normalisation='False', recruitment_difference_cutoff=1.0, corr_cutoff=0.7, controlunitmodulation_cutoff=0.5, clean=True)
¶
  Quantify delta F via paired motor unit analysis.
Conducts a paired motor unit analysis, quantifying delta F between the supplied collection of motor units. Origional framework for deltaF provided in Gorassini et. al., 2002: https://journals.physiology.org/doi/full/10.1152/jn.00024.2001
Author: James (Drew) Beauchamp
| PARAMETER | DESCRIPTION | 
|---|---|
emgfile | 
          
             The dictionary containing the emgfile. 
                
                  TYPE:
                      | 
        
smoothfits | 
          
             Smoothed discharge rate estimates. Each array: motor unit discharge rate x samples aligned in time; instances of non-firing = NaN Your choice of smoothing. See compute_svr gen_svr for example. 
                
                  TYPE:
                      | 
        
average_method | 
          
             The method for test MU deltaF value. More to be added. 
 
 
                
                  TYPE:
                      | 
        
normalisation | 
          
             The method for deltaF nomalization. 
 
                
                  TYPE:
                      | 
        
recruitment_difference_cutoff | 
          
             An exlusion criteria corresponding to the necessary difference between control and test MU recruitement in seconds. 
                
                  TYPE:
                      | 
        
corr_cutoff | 
          
             An exclusion criteria corresponding to the correlation between control and test unit discharge rate. 
                
                  TYPE:
                      | 
        
controlunitmodulation_cutoff | 
          
             An exclusion criteria corresponding to the necessary modulation of control unit discharge rate during test unit firing in Hz. 
                
                  TYPE:
                      | 
        
clean | 
          
             To remove values that do not meet exclusion criteria 
                
                  TYPE:
                      | 
        
| RETURNS | DESCRIPTION | 
|---|---|
              delta_f
           | 
          
             A pd.DataFrame containing deltaF values and corresponding MU number. The resulting df will be different depending on average_method. In particular, if average_method="all", delta_f[MU][row] will contain a tuple representing the indices of the two motor units for each given pair (reporter, test) and their corresponding deltaF value. 
                
                  TYPE:
                      | 
        
See also¶
- compute_svr : fit MU discharge rates with Support Vector Regression, nonlinear regression.
 
Examples:
Quantify delta F using svr fits.
>>> import openhdemg.library as emg
>>> emgfile = emg.emg_from_samplefile()
>>> emgfile = emg.sort_mus(emgfile=emgfile)
>>> svrfits = emg.compute_svr(emgfile)
>>> delta_f = emg.compute_deltaf(
...     emgfile=emgfile, smoothfits=svrfits["gensvr"],
... )
delta_f
   MU        dF
0   0       NaN
1   1       NaN
2   2       NaN
3   3  1.838382
4   4  2.709522
For all possible combinations, not test unit average, MU in this case is pairs (reporter, test).