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

Spike Unit Annotation #1027

Merged
merged 18 commits into from
Jul 30, 2024
Merged

Spike Unit Annotation #1027

merged 18 commits into from
Jul 30, 2024

Conversation

samuelbray32
Copy link
Collaborator

@samuelbray32 samuelbray32 commented Jul 10, 2024

Description

Resolves #1012

  • makes standard unit_id = "{spikesorting_merge_id}_{unit_number}" for linking units across analyses
  • Add option return_unit_ids to fetch_spike_data in:
    • SortedSpikesGroup
    • SortedSpikesDecodingV1
  • Implement new spikesorting analysis table UnitAnnotation and part table Annotation
    • Designed to allow users to query intersect of labels across analyses
    • Allows users to fetch subset of units based on annotation restriction
  • Add new tutorial notebook 11_Spike_Sorting_Analysis containing SortedSpikesGroup and UnitAnnotation tutorials

Checklist:

  • no This PR should be accompanied by a release: (yes/no/unsure)
  • n/a If release, I have updated the CITATION.cff
  • no This PR makes edits to table definitions: (yes/no)
  • n/a If table edits, I have included an alter snippet for release notes.
  • n/a If this PR makes changes to position, I ran the relevant tests locally.
  • I have updated the CHANGELOG.md with PR number and description.
  • I have added/edited docs/notebooks to reflect the changes

@samuelbray32
Copy link
Collaborator Author

Draft Note:

The UnitAnnotation table might want more feedback. That said, I think the return_unit_ids feature would be useful (at least to me) on it's own, and I would be fine reducing the PR to just that

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@samuelbray32 samuelbray32 marked this pull request as ready for review July 15, 2024 17:56
@edeno edeno requested review from edeno, khl02007 and CBroz1 July 16, 2024 18:10
Copy link
Collaborator

@edeno edeno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. What's the difference between a label and a quantification? Is that explained in the tutorial notebook anywhere?
  2. I think the notebook needs to be added to the docs

@samuelbray32
Copy link
Collaborator Author

What's the difference between a label and a quantification? Is that explained in the tutorial notebook anywhere?

A label would be a string identifieer (e.g. {"annotation":"cell_type", "label":"pyridimal cell"}) whereas a quantification is a float number (e.g. {"annotation":"firing_rate", "quantification": 6.3})

I'll make sure the notebook includes example of both

Copy link
Member

@CBroz1 CBroz1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @samuelbray32. Thanks for these adds. I have a systematic suggestion in here about avoiding string concatenation.

Related to docs ...

  1. Please make mention of the new notebook in ...
    • notebooks/README.md
    • docs/mkdocs.yml
  2. Please try serving the mkdocs to check the docstrings of new tables - the stdout will report formatting issues when it builds api.

notebooks/py_scripts/11_Spike_Sorting_Analysis.py Outdated Show resolved Hide resolved
src/spyglass/decoding/v1/sorted_spikes.py Outdated Show resolved Hide resolved
src/spyglass/spikesorting/analysis/v1/group.py Outdated Show resolved Hide resolved
src/spyglass/spikesorting/analysis/v1/group.py Outdated Show resolved Hide resolved
src/spyglass/spikesorting/analysis/v1/unit_annotation.py Outdated Show resolved Hide resolved
src/spyglass/spikesorting/analysis/v1/unit_annotation.py Outdated Show resolved Hide resolved
src/spyglass/spikesorting/analysis/v1/unit_annotation.py Outdated Show resolved Hide resolved
src/spyglass/utils/dj_merge_tables.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@edeno edeno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor spelling error fix.

@samuelbray32 samuelbray32 requested a review from edeno July 22, 2024 21:43
@edeno edeno merged commit f6f76a7 into master Jul 30, 2024
7 checks passed
@edeno edeno deleted the spike_unit_id branch July 30, 2024 15:10
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

Successfully merging this pull request may close these issues.

Spikesorting Unit Annotation
3 participants