Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question of PSS using on NREM (ClusterStates_GetMetrics.m) #422

Open
lizijie-cmu opened this issue Nov 16, 2023 · 6 comments
Open

Question of PSS using on NREM (ClusterStates_GetMetrics.m) #422

lizijie-cmu opened this issue Nov 16, 2023 · 6 comments

Comments

@lizijie-cmu
Copy link

Hello.
I find in ClusterStates_GetMetrics.m section Calculate broadbandslowwave metric you using PSS at the frequency range of 4-90Hz as default for NREM slow wave detection.
I have two questions:
1 Why you use this frequency range, have you mentioned this in any research paper?
2 Why you don't use the frequency range 0 - 4 Hz ? I think it's a usual detection frequency range for NREM.

Best Wishes!

@dlevenstein
Copy link
Collaborator

Hi there. Both questions should be answered in the series of papers that describe the current approach:

-Watson et al 2016 (https://www.cell.com/neuron/fulltext/S0896-6273(16)30056-3)
-Levenstein et al 2019 (https://www.nature.com/articles/s41467-019-10327-5)
-Levenstein et al 2021 (https://www.biorxiv.org/content/10.1101/2021.09.20.461152v3)

Briefly:
-in Watson et al 2016 we found that the first PC of the log-frequency spectrogram predominantly corresponded to NREM vs WAKE (better than any individual frequency bands or single range). Note that the weights vary continuously from positive weight at low frequencies to negative weight at high frequencies, indicating that this component predominantly reflects the slope of the (log-log) power spectrum, AKA the 1/f exponent of the linear spectrum.
-in Levenstein et al 2019 (methods) we replaced PC1 with a weighted sum of powers, using the average weights derived from the original dataset. This improved robustness of the algorithm to shorter recordings with less time in the homecage, and those with lots of broadband noise.
-finally, in Levenstein et al 2021 (methods), we replaced the weighted sum with an explicit calculation of the power spectrum slope, which corresponded to findings of the relationship of the slope with sleep/wake state in human patients, and we found was significantly more robust on recordings from a range of different brain regions. The range for calculating the slope was chosen because it gave the best match of state designation between hippocampus and cortical recordings, and allowed calculating the slope in small (2s, sliding) windows.

All of these options are now able to be used with optional inputs to the SSM function, however in our hands the (default) PSS approach is by far the most reliable/robust.

Hope that helps!
Dan

@brendonw1
Copy link
Collaborator

brendonw1 commented Nov 16, 2023 via email

@dlevenstein
Copy link
Collaborator

TBH I'm not using buzcode anymore. Have completely switched over to python/pynapple 😅. So I wouldn't be the best one to ask re: dev->master.

We don't yet have a python implementation of SleepScoreMaster et al, but it's in the works. The lab here basically only uses Matlab to sleep score, but I think they have a local version which I don't think they're keeping up to date with the GitHub repo.

@brendonw1
Copy link
Collaborator

brendonw1 commented Nov 16, 2023 via email

@lizijie-cmu
Copy link
Author

@brendonw1 @dlevenstein
I'm glad both experts could respond to me. This is my first time participating in discussions on GitHub, and I have understood the part about PSS.
I also have a small question about the freqeuncy of SLOPE. You said that you actually use the SLOPE from 1-90hz, while in Dldev branch line 114 and 115, the code is here
[specslope,spec] = bz_PowerSpectrumSlope(lfp,window,window-noverlap,'frange',[4 90],'IRASA',IRASA);
broadbandSlowWave = -specslope.data; %So NREM is higher as opposed to lower
It means you use frequency range 4 - 90 Hz, or I misunderstand it or I choose the wrong branch?
Link: https://github.com/dlevenstein/buzcode/blob/DLdev/detectors/detectStates/SleepScoreMaster/ClusterStates_GetMetrics.m

Tank you very much and best Wishes!

@brendonw1
Copy link
Collaborator

brendonw1 commented Dec 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants