Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions src/lerner_lab_to_nwb/seiler_2024/seiler_2024_convert_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@
from lerner_lab_to_nwb.seiler_2024.seiler_2024csvbehaviorinterface import Seiler2024CSVBehaviorInterface


SUBJECTS_TO_SKIP = { # subject IDs that are not in the demographics sheet
"289.407",
"244.464",
"264.477",
"264.478",
"102.260",
"262.259", # parsed from "Scrambled/2021-10-29_262_259 - Copy.478", a copy of 262.478's 10/29/21 run
"289.408",
"264.475",
"129.425",
"250.427",
"95.259",
"309.399",
"433.421",
"416.405",
"364.426",
}


def dataset_to_nwb(
*,
data_dir_path: Union[str, Path],
Expand All @@ -77,23 +96,6 @@ def dataset_to_nwb(
verbose : bool, optional
Whether to print verbose output, by default True
"""
subjects_to_skip = {
"289.407",
"244.464",
"264.477",
"264.478",
"102.260",
"262.478",
"289.408",
"264.475",
"129.425",
"250.427",
"95.259",
"309.399",
"433.421",
"416.405",
"364.426",
}
start_variable = "Start Date"
data_dir_path = Path(data_dir_path)
output_dir_path = Path(output_dir_path)
Expand Down Expand Up @@ -124,7 +126,7 @@ def dataset_to_nwb(
if session_key in no_port_entry_duration_sessions:
session_to_nwb_kwargs["has_port_entry_durations"] = False
subject_id = session_to_nwb_kwargs["subject_id"]
if subject_id in subjects_to_skip:
if subject_id in SUBJECTS_TO_SKIP:
continue
session_to_nwb_args_per_session.append(session_to_nwb_kwargs)

Expand Down
3 changes: 1 addition & 2 deletions src/lerner_lab_to_nwb/seiler_2024/seiler_2024_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ None
359.43 --> 359.430
28.392 --> 028.392
227.43 --> 227.430
262.478 --> 262.259
354.43 --> 354.430
430.42 --> 430.420
342.483 --> 342.400
Expand All @@ -231,7 +230,7 @@ None
"244.464",
"264.477",
"102.260",
"262.478",
"262.259",
"289.408",
"264.475",
"129.425",
Expand Down
14 changes: 14 additions & 0 deletions tests/test_subject_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from pathlib import Path

from lerner_lab_to_nwb.seiler_2024.seiler_2024_convert_dataset import SUBJECTS_TO_SKIP, get_opto_subject_id


class TestSubject262478:
def test_nphr_run_is_converted(self):
subject_id = get_opto_subject_id(Path("Group 2/NpHr/2021-10-29_262_259.478"))
assert subject_id == "262.478"
assert subject_id not in SUBJECTS_TO_SKIP

def test_scrambled_copy_is_skipped(self):
subject_id = get_opto_subject_id(Path("Group 2/Scrambled/2021-10-29_262_259 - Copy.478"))
assert subject_id in SUBJECTS_TO_SKIP