pynapple-org / pynapple

PYthon Neural Analysis Package :pineapple:
https://pynapple.org/
MIT License
279 stars 63 forks source link

Decoding for calcium imaging #285

Open ZhaomingPsych opened 5 months ago

ZhaomingPsych commented 5 months ago

Hi everyone, I have some questions regarding the shuffle method, tuning curves, and decoding in your library:

  1. Shuffle Method: Is the TsDataFrame suitable for the shuffle method? Can TsDataFrame be transformed into a TsGroup?
  2. Tuning Curves: It appears that Tsd cannot be used as an input for tuning curves, despite the documentation indicating that it should be possible.
  3. Decoding: Can TsDataFrame be used as an input for the decoding process?

Thank you for your assistance.

gviejo commented 5 months ago

Hey,

  1. Currently the shuffle methods works only for timestamps object (Ts) or TsGroup. In what case would you want to shuffle a TsdFrame? In any case, you can transform a Tsd into a TsGroup but not a TsdFrame.
  2. Which function did you try to use?
  3. Not yet. It's in the roadmap. Feel free to describe your use case here.
ZhaomingPsych commented 5 months ago

Thank you for your reply!

  1. You're right! I transformed TsDataframe to Tsd, and now it works!
  2. compute_1d_tuning_curves_continuous
  3. Currently, I am trying to analyze place fields from two-photon calcium imaging using pynapple. Our goal is to decode the mouse's position from the calcium imaging data. Do you have any suggestions?
gviejo commented 5 months ago

For 3. it's in the roadmap to add more capabilities for decoding with calcium imaging data but it's not ready yet. I would just try to train a machine learning model from scikit-learn if you want to do some decoding. I can leave this issue open until new decoding functions are implemented.