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

Associate cluster waveforms and electrode table regions with unit times #431

Closed
NileGraddis opened this issue Apr 5, 2018 · 9 comments
Closed
Assignees
Milestone

Comments

@NileGraddis
Copy link
Member

UnitTimes provide a nice way to store event times associated with sorted units. There should be a way to associate mean/std waveforms (such as those in ClusterWaveforms) as well as electrodes (such as those in ElectrodeTableRegion) to the units defined by a UnitTimes container.

Since UnitTimes supports simulated data and ophys data as well as ephys data, the solution to this problem should probably involve referencing units in UnitTimes from other containers rather than altering UnitTimes itself.

@ajtritt ajtritt assigned NileGraddis, oruebel and ajtritt and unassigned oruebel and NileGraddis Apr 5, 2018
@ajtritt
Copy link
Member

ajtritt commented Apr 5, 2018

What about a type that maps between the different IDs? It could be a table with two columns. For example, in the ElectrodeTable to UnitTimes case, the first column would be an id from the electrode table and the second column would be an id from UnitTimes.unit_id.

@tjd2002
Copy link
Contributor

tjd2002 commented Apr 13, 2018

I support a separate class to represent Units (independent of UnitTimes/ClusterWaveforms).And NB we definitely want to refer to electrodetableregions and not just electrodeids.

What is the reason to separate this list of Units from the UnitMetrics class as proposed at PR #435? Are there cases where there will not be a 1:1 correspondence between UnitMetrics and Units?

@NileGraddis
Copy link
Member Author

The way that I am currently leaning towards implementing Units is as a group with two datasets:

  1. a list of unit ids
  2. a table of associations, with one column of unit ids and another of links, like this:
  - neurodata_type_def: UnitAssociations
    neurodata_type_inc: NWBData
    doc: table of unit associations
    attributes:
      - name: help
        doc: a help string
        dtype: text
        value: table of unit associations
    dtype:
      - name: unit_id
        doc: id of unit
        dtype: int
      - name: association
        doc: a reference
        dtype:
          target_type: NWBBaseType
          reftype: object

This would allow us to attach electrode groups, event times, waveforms and other data to units while preserving the type of the attached data. We could then units obtained from different modalities (ecephys, ophys, models) in a cohesive framework.

I think that @tjd2002's suggestion is reasonable. The UnitMetrics could be attached to the file as a subgroup of the Units

@bendichter
Copy link
Contributor

These all sound like good solutions. I just want to make sure that whatever we pick can support, either by links or some other means, indicating the relationship between individual units and:

  • average waveform
  • continuous variable like mean firing rate
  • categorical variable like cell type
  • spike train
  • tuning properties/receptive field (often described as a matrix, e.g. STRF, location preference, etc.)
    any more?

@NileGraddis
Copy link
Member Author

@bendichter I think that UnitwiseMetrics covers scalar values such as cell type and mean firing rate. The solution I propose above is flexible enough to support the others as long as we create types for the ones that are not currently in spec, such as receptive field.

If there are no objections, I will go ahead and implement this.

@tjd2002
Copy link
Contributor

tjd2002 commented Apr 14, 2018 via email

@tjd2002
Copy link
Contributor

tjd2002 commented Apr 14, 2018

For discussion of extensions see: NeurodataWithoutBorders/nwb-schema#141

@campagnola
Copy link

I like the solution proposed by @NileGraddis; it's simple, it solves the composition problem (and solves it in a way that makes sense when you are dealing with hundreds/thousands of units), and unlike #141 it does not require any changes to NWB.

Things to consider:

  • There is a possibility that by making this part of the spec freely extendable, it will be difficult to handle by analysis tools. This could be mitigated by wrapping the UnitAssociations table in a nice pynwb read API (ideally, NWB users should not need to parse and interpret the table manually). @NileGraddis do you already have an idea of how the read API should look?
  • Given that this composition problem appears in so many places, it would be nice if we can come up with a common solution rather than having it solved a different way each time.

@oruebel oruebel added this to the NWB 2.x milestone May 18, 2018
@rly
Copy link
Contributor

rly commented Apr 11, 2024

The Units data type now has columns for waveform mean/sd and electrodes https://github.com/NeurodataWithoutBorders/nwb-schema/blob/dev/core/nwb.misc.yaml#L177

@rly rly closed this as completed Apr 11, 2024
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

7 participants