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

PSTH / PETH #93

Closed
bendichter opened this issue Aug 1, 2023 · 12 comments
Closed

PSTH / PETH #93

bendichter opened this issue Aug 1, 2023 · 12 comments

Comments

@bendichter
Copy link
Contributor

bendichter commented Aug 1, 2023

peristimiulus time histogram / peri-event time histogram

Here's an example of the NWB widget for this

image

Features:

  • Select a specific unit (neuron)
  • Trial-align spike times based on some event time within the trials table
    • bonus: use any TimeIntervals table or event times from an AnnotatedEvents table
    • bonus: allow user to select multiple trial events to align to and render the PETH plots side by side
  • allow user to set before and after window around trial events
  • bin and/or smooth spike times. Express firing rate in units of Hz
    • bonus: control parameters of binning or smoothing
  • user selects from categorical columns of trials table to group trials. Trials are ordered and colored by the values of that column.
    • bonus: user can multi-select which values to view in that category, controlling which values to include and exclude

source data: https://dandiarchive.org/dandiset/000128/0.220113.0400/files?location=sub-Jenkins

@bendichter
Copy link
Contributor Author

Wow, this is fantastic!

@CodyCBakerPhD
Copy link
Contributor

CodyCBakerPhD commented Aug 2, 2023

I'm impressed at how responsive this is

I use the IBL BWM as reference: https://flatironinstitute.github.io/neurosift/?p=/nwb&url=https://dandiarchive.s3.amazonaws.com/blobs/14a/556/14a55630-cce3-4318-913a-d6d637ac9f4b&tab=view:PSTH|/intervals/trials

I'd love an easy way to 'select all' units, since one feedback we often get about the NWB Widgets version is to have a nice way of 'scanning' quickly through all the different units. Which is very easy to do here, I just scroll through with my mouse wheel

In a perfect world, such a 'mass select' functionality could also take categorial sets of values from the Units table columns (such as brain region location, or quality of units (good/bad boolean or number of quality metrics 'passed', etc.)

Also, do you think the Gaussian smoothing would be too costly to apply on-the-fly? I know some people prefer the strict histogram view, but others prefer the smooth line and I personally like to be able to see the variance as a function of time as well (especially when/if spikes are sparse over a certain window) Here's the reference code we use for smoothing

@CodyCBakerPhD
Copy link
Contributor

Also would be cool to have an upper bound on the Hz axis scale to get a feel for the value range of the firing rate

@magland
Copy link
Collaborator

magland commented Aug 2, 2023

@CodyCBakerPhD there is now a 'select all' checkbox... and now the loading doesn't actually begin until the unit box becomes visible (to prevent overloading for a large number of units)

image

@magland
Copy link
Collaborator

magland commented Aug 2, 2023

@CodyCBakerPhD I implemented a couple other features you requested. The y axis firing rate is now labeled on the histogram, and there's an option to set the number of bins, and apply Gaussian smoothing.

Image

I'm not going to do the following for now (it can be opened in a separate low-priority issue):

In a perfect world, such a 'mass select' functionality could also take categorial sets of values from the Units table columns (such as brain region location, or quality of units (good/bad boolean or number of quality metrics 'passed', etc.)

So if you think this looks good I'll mark this issue as complete.

@CodyCBakerPhD
Copy link
Contributor

Yep, this is a great implementation! I'll raise separate issues for any other ideas over time

@magland
Copy link
Collaborator

magland commented Aug 3, 2023

The weirdest thing happened with the issue tracker. The title of this issue showed up as "PSTH / THING" instead of "PSTH / PETH" for just a minute, and I snapped a screenshot of it. Did someone change the title and then switch it back? It's just weird...

Image

@magland
Copy link
Collaborator

magland commented Aug 3, 2023

And you'll also notice that "magland" was replaced by "to land" throughout. Is github glitching? Or is someone hacking my browser?

@bendichter
Copy link
Contributor Author

My guess would be some sort of translation layer translating from another language that it is detecting

@magland
Copy link
Collaborator

magland commented Aug 3, 2023

My guess would be some sort of translation layer translating from another language that it is detecting

Ah, probably so...

@magland
Copy link
Collaborator

magland commented Aug 3, 2023

@magland magland closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants