MagliaLab / HoleyPy

Work in progress data analysis package Maglia lab
0 stars 0 forks source link

How to get the Fs,event of the data? #16

Closed JunyiLiu2002 closed 1 year ago

JunyiLiu2002 commented 1 year ago

Hi,

I'd like to ask how can I get the Fs,event(Hz) in the paper (equation 10) since it seems that the 'event' and 'feature' didn't return the parameters of the fitted gNDF function.

Thanks in advance!

flrlucas commented 1 year ago

The regular fit does not return the gNDF, for the gNDF you require event optimisation.

You will have to run the following code: event_analysis = Events(signal_data) event_analysis.run() results = event_analysis.optimise_events() results will contain a list with named tuples with the parameters you are looking for.

Note that the gNDF optimisation may take some time, as it will fit a gNDF around each event. By default it stores the results in a SQL file next to your original file, so you can easily reload the results, it will also (by default) try to load this sql file.

I have also added this to the readme.

JunyiLiu2002 commented 1 year ago

Thanks for your guidence and I have already plot the relationship between the Fs,event and the I_ex.(shown below)

1665999264861

However, by using the 'results = event_analysis.optimise_events()',I didn't found the change in shape and position caused when filter frequency is too low.

image

Which should be like that:

1665999178098

Thanks in advance!

flrlucas commented 1 year ago

Hi Juny,

The gNDF fit stores the events in an sql file (same name as the original data), here it also stores the non-optimised results. It's likely that it can't write the second analysis as the table already exists (or overwrites depending on sql version). In the article we produced the results by running them in individual folders.

Could you run a copy of the same data in seperate folders and see if it reproduces.

  1. make two folders, 500Hz and 100000Hz
  2. Copy the data to both folders
  3. run the script at 500Hz and 100000Hz respectively.

Also, the excluded current after optimisation should be calculated as follows (the I_ex from features is based on Rapid Event Detection): Iex = 1 - ( results["Amplitude_block"]/abs(results["Open_current"]) )