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

Moseq Pipeline #1056

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Moseq Pipeline #1056

wants to merge 23 commits into from

Conversation

samuelbray32
Copy link
Collaborator

@samuelbray32 samuelbray32 commented Aug 6, 2024

Description

  • Implementation of moseq withing spyglass pipelines.

    • Keypoint data sourced from PositionOutput
      • Added PositionOutput.get_pose_dataframe to allow fetching of full pose rather than centroid for appropriate pipelines.
    • PoseGroup used to combine multiple epochs of pose data into a training set (analagous to PositionGroup in decoding pipeline)
    • Model parameters and training arguments stored in MoseqModelParams
      • Can define initial model as an existing entry in MoseqModel for reuse and extended training
    • MoseqModelSelection combines PoseGroup andmodel parameters
    • MoseqModel trains model and stores in external project file
    • MoseqSyllable (and it's selction table) apply a trained model to an entry from PositionOutput
      • stores syllables and latent variables as a dataframe in an AnalysisNwbfile entry
  • Added utility function get_position_interval_epoch

My To-dos

  • improve the tutorial with more explanations of the steps
  • update notebook image to use PositionOutput
  • change the model stored directories to the spyglass config
  • make a better standard version for getting epoch from the position interval name (as mentioned by Chris before)
  • update changelog

Checklist:

  • N This PR should be accompanied by a release: (yes/no/unsure)
  • NA If release, I have updated the CITATION.cff
  • N This PR makes edits to table definitions: (yes/no)
  • NA If table edits, I have included an alter snippet for release notes.
  • NA 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

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@edeno edeno requested a review from CBroz1 August 8, 2024 18:37
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.

Took a first pass on the behavior subpackage - Can continue review tomorrow

src/spyglass/behavior/core.py Outdated Show resolved Hide resolved
src/spyglass/behavior/core.py Outdated Show resolved Hide resolved
src/spyglass/behavior/core.py Outdated Show resolved Hide resolved
src/spyglass/behavior/core.py Outdated Show resolved Hide resolved
src/spyglass/behavior/core.py Outdated Show resolved Hide resolved
src/spyglass/behavior/moseq.py Outdated Show resolved Hide resolved
src/spyglass/behavior/moseq.py Show resolved Hide resolved
src/spyglass/behavior/moseq.py Outdated Show resolved Hide resolved
src/spyglass/behavior/moseq.py Outdated Show resolved Hide resolved
src/spyglass/behavior/moseq.py Outdated Show resolved Hide resolved
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.

Looking good so far!

comments=pos_obj.comments,
description=pos_obj.description,
)
if isinstance(pos_nwb["dlc_position"], pd.DataFrame):
Copy link
Member

Choose a reason for hiding this comment

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

I think I would migrate these to a separate method to clean up the indenting, something like declare_pos_analysis_file

src/spyglass/position/v1/position_dlc_pose_estimation.py Outdated Show resolved Hide resolved
src/spyglass/position/v1/position_trodes_position.py Outdated Show resolved Hide resolved
@edeno edeno added enhancement New feature or request position labels Sep 25, 2024
@samuelbray32
Copy link
Collaborator Author

samuelbray32 commented Dec 20, 2024

I've now merged in the main branch and have tested it working with a dependency on PositionOutput rather than the introduced PoseOutput table proposed before.

@samuelbray32 samuelbray32 marked this pull request as ready for review December 27, 2024 19:58
@edeno edeno requested review from CBroz1 and edeno December 27, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request position
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants