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

Add epochs to week long session #20

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alessandratrapani
Copy link
Collaborator

@alessandratrapani alessandratrapani commented Nov 20, 2024

This pull request refactors the codebase to improve code reusability and organization:

  1. Moved get_miniscope_folder_path to miniscope_imaging_interface
  2. Relocated get_edf_slicing_time_range to utils.py and renamed it to get_session_slicing_time_range

Time Range Extraction Improvements:

  1. Extracts sub-session (epochs) time ranges within a week-long session
  2. Saves start and stop timestamps as seconds from the start time of EDF signal acquisition
  3. Use pynwb epoch module directly.

Handling Missing Miniscope Data:

  • When miniscope data is available: Uses metadata.json and timeStamps.csv files in the miniscope folder

  • When miniscope data is unavailable:

    • Uses date and time string extracted from {subject_id}_SessionTimes.csv to determine the start time.
    • Calculates stop time using running time reported in the automatically generated .txt file in the experiment folder.

@alessandratrapani alessandratrapani self-assigned this Nov 20, 2024
@alessandratrapani alessandratrapani marked this pull request as draft November 21, 2024 14:29
@alessandratrapani alessandratrapani marked this pull request as ready for review November 21, 2024 15:40
@h-mayorquin h-mayorquin mentioned this pull request Nov 25, 2024
29 tasks
Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

Can you tell me about the missing miniscope data, when is it missing? is this for the week long session or is it missing in some other cases?

@alessandratrapani
Copy link
Collaborator Author

Can you tell me about the missing miniscope data, when is it missing? is this for the week long session or is it missing in some other cases?

From the notes in the experimental design Excel file that Joe sent us, we can see that some of the sessions (either offline, encoding, or recall sessions) might have had problems with the miniscope recording. Therefore, these incomplete sessions only contain behavioral data. These remain edge cases. That's why it first tries to extract the start and stop time from the miniscope data, and only if this data is missing it opts for the other solution.
The epoch table refers to all the sessions (either offline, encoding, or recall sessions) happening during the week-long session. This would be the final structure of the dataset:
cai-conversion-ouput-dataset-structure

Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

Thanks that diagram looks very cool. This is fine for me, feel free to merge.

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.

2 participants