bycycle-tools / bycycle

Cycle-by-cycle analysis of neural oscillations.
https://bycycle-tools.github.io/
Apache License 2.0
82 stars 21 forks source link

[WIP] optimize trough cyclepoints #114

Closed ryanhammonds closed 1 year ago

ryanhammonds commented 3 years ago

This adds an option to have redefine troughs on a burst-by-burst basis (assuming a fixed cycle duration), providing a solution to periods fluctuating +/- 10% of the simulated length when an oscillation is combined with noise. Outside of simulations, I don't think this update will be useful since a fixed cycle duration can't be assumed.

What led me here was poor fits when transforming motifs to individual cycles (i.e. when a simulated cycle has 50 samples, but bycycle defines the cycle as 45 samples, and transforming a 50 sample motif to the cycle leads to a poor fit, typically at the edge that is over/under defined). This is shown in the image below - this example has a tiny amount of noise that still throws off the cyclepoint definitions a little. Screenshot_20210909_184422

codecov-commenter commented 3 years ago

Codecov Report

Merging #114 (019ca8b) into main (0d42a1a) will decrease coverage by 2.56%. The diff coverage is 15.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
- Coverage   96.90%   94.34%   -2.57%     
==========================================
  Files          29       29              
  Lines        1391     1432      +41     
==========================================
+ Hits         1348     1351       +3     
- Misses         43       81      +38     
Impacted Files Coverage Δ
bycycle/cyclepoints/extrema.py 58.76% <15.55%> (-37.67%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0d42a1a...019ca8b. Read the comment docs.