From 077137fd77d6f5798aaaa3ebdc9c4e86242ea621 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 8 Dec 2023 15:06:58 -0800 Subject: [PATCH 1/5] added faux support for alignment and TODOs if we actually get alignment info for keypoints --- frozen_dependencies.txt | 199 +++++++++--------- .../convert_session.py | 1 + .../fiberphotometryinterface.py | 27 ++- .../irvideointerface.py | 5 + .../keypointinterface.py | 5 + .../post_conversion/reproduce_figS3.py | 2 +- 6 files changed, 132 insertions(+), 107 deletions(-) diff --git a/frozen_dependencies.txt b/frozen_dependencies.txt index 116e3f5..b72a2b9 100644 --- a/frozen_dependencies.txt +++ b/frozen_dependencies.txt @@ -1,4 +1,5 @@ -aiohttp==3.8.5 +absl-py==1.4.0 +aiohttp==3.8.6 aiosignal==1.3.1 anyio==3.7.1 appdirs==1.4.4 @@ -9,211 +10,203 @@ arrow==1.2.3 asciitree==0.3.3 asttokens==2.2.1 async-lru==2.0.4 -async-timeout==4.0.2 +async-timeout==4.0.3 attrs==23.1.0 +av==10.0.0 Babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -bidsschematools==0.7.1 +bidsschematools==0.7.2 +black==23.3.0 bleach==6.0.0 blessed==1.20.0 -boto3==1.28.19 -botocore==1.31.19 -bqplot==0.12.40 -cellpose==2.2.2 +bokeh==2.4.3 +boto3==1.28.64 +botocore==1.31.64 certifi==2023.7.22 cffi==1.15.1 -cfgv==3.3.1 charset-normalizer==3.2.0 +chex==0.1.7 ci-info==0.3.0 -click==8.1.6 +click==8.1.3 click-didyoumean==0.3.0 +cloudpickle==2.2.1 +cmocean==3.0.3 colorcet==3.0.1 -comm==0.1.4 -contourpy==1.1.0 +comm==0.1.3 +contourpy==1.0.7 cycler==0.11.0 -dandi==0.58.0 +Cython==3.0.0 +dandi==0.56.2 dandischema==0.8.4 +dask==2022.4.0 +dask-jobqueue==0.8.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 -distlib==0.3.7 -dnspython==2.4.1 +dill==0.3.6 +distributed==2022.4.0 +dm-tree==0.1.8 +dnspython==2.4.2 email-validator==2.0.0.post2 -entrypoints==0.4 -etelemetry==0.3.0 +etelemetry==0.3.1 exceptiongroup==1.1.2 executing==1.2.0 -fasteners==0.18 +fasteners==0.19 fastjsonschema==2.18.0 -fastremap==1.13.5 -filelock==3.12.2 -fonttools==4.42.0 +ffprobe==0.5 +fonttools==4.39.4 fparse==1.20.1 fqdn==1.5.1 frozenlist==1.4.0 -fscacher==0.3.0 -fsspec==2023.6.0 -gast==0.4.0 -h5py==3.9.0 +fscacher==0.4.0 +fsspec==2023.5.0 +h5py==3.8.0 hdmf==3.6.1 -humanize==4.7.0 -identify==2.5.26 +humanize==4.8.0 +hyphyber @ file:///Users/pauladkisson/Documents/CatalystNeuro/NWB/DattaConv/hyphyber-master idna==3.4 -imagecodecs==2023.7.10 -imageio==2.31.1 -importlib-metadata==4.13.0 +importlib-metadata==6.8.0 interleave==0.2.1 -ipydatagrid==1.1.16 -ipydatawidgets==4.3.2 -ipyfilechooser==0.6.0 -ipykernel==6.25.1 -ipympl==0.9.3 -ipython==8.14.0 +ipykernel==6.23.1 +ipython==8.13.2 ipython-genutils==0.2.0 -ipyvolume==0.6.3 -ipyvue==1.9.2 -ipyvuetify==1.8.10 -ipywebrtc==0.6.0 -ipywidgets==8.1.0 +ipywidgets==8.0.6 isodate==0.6.1 isoduration==20.11.0 jaraco.classes==3.3.0 -jedi==0.19.0 +jax==0.4.10 +jaxlib==0.4.10 +jedi==0.18.2 Jinja2==3.1.2 jmespath==1.0.1 -joblib==1.3.1 +joblib==1.2.0 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.18.6 +jsonschema==4.19.0 jsonschema-specifications==2023.7.1 jupyter==1.0.0 jupyter-console==6.6.3 jupyter-events==0.7.0 jupyter-lsp==2.2.0 -jupyter_client==8.3.0 -jupyter_core==5.3.1 +jupyter_client==8.2.0 +jupyter_core==5.3.0 jupyter_server==2.7.0 jupyter_server_terminals==0.4.4 jupyterlab==4.0.4 jupyterlab-pygments==0.2.2 -jupyterlab-widgets==3.0.8 +jupyterlab-widgets==3.0.7 jupyterlab_server==2.24.0 keyring==24.2.0 keyrings.alt==5.0.0 kiwisolver==1.4.4 -lazy_loader==0.3 -llvmlite==0.40.1 -MarkupSafe==2.1.3 -matplotlib==3.7.2 +llvmlite==0.40.0 +locket==1.0.0 +MarkupSafe==2.1.2 +matplotlib==3.7.1 matplotlib-inline==0.1.6 mistune==3.0.1 +ml-dtypes==0.1.0 more-itertools==10.1.0 -mpmath==1.3.0 +msgpack==1.0.5 multidict==6.0.4 -natsort==8.4.0 +multipledispatch==0.6.0 +multiprocess==0.70.14 +mypy-extensions==1.0.0 +natsort==8.3.1 nbclient==0.8.0 nbconvert==7.7.3 nbformat==5.9.2 -# Editable install with no version control (ndx-depth-moseq==0.1.0) --e /opt/anaconda3/envs/datta_env/lib/python3.10/site-packages -ndx-events==0.2.0 -ndx-grayscalevolume==0.0.2 -ndx-icephys-meta==0.1.0 -ndx-moseq @ git+https://github.com/pauladkisson/ndx-moseq.git@cac0b4003525b3ac902fed9a68d90ca459a211f8 -ndx-photometry @ git+https://github.com/catalystneuro/ndx-photometry.git@7ea9d755ceac9524125f50ab528b403b135c4530 --e git+https://github.com/rly/ndx-pose.git@f9dd18a8290897e48bdd6ebeedcc0a7095d86265#egg=ndx_pose -ndx-spectrum==0.2.2 -nest-asyncio==1.5.7 +nest-asyncio==1.5.6 networkx==3.1 -neuroconv==0.4.0 -nodeenv==1.8.0 notebook==7.0.2 notebook_shim==0.2.3 -numba==0.57.1 -numcodecs==0.11.0 -numpy==1.24.4 -nwbinspector==0.4.29 -nwbwidgets==0.11.3 -opencv-python-headless==4.8.0.74 +numba==0.57.0 +numcodecs==0.12.0 +numexpr==2.8.1 +numpy==1.21.5 +numpyro==0.11.0 +opencv-python-headless==4.7.0.72 +opt-einsum==3.3.0 +optax==0.1.5 overrides==7.4.0 packaging==23.1 -pandas==2.0.3 +pandas==1.5.0 pandocfilters==1.5.0 param==1.13.0 parso==0.8.3 +partd==1.4.0 +pathspec==0.11.1 +patsy==0.5.3 pexpect==4.8.0 pickleshare==0.7.5 -Pillow==10.0.0 -platformdirs==3.10.0 -plotly==5.13.1 -pre-commit==3.3.3 +Pillow==9.5.0 +platformdirs==3.5.1 prometheus-client==0.17.1 -prompt-toolkit==3.0.39 +prompt-toolkit==3.0.38 psutil==5.9.5 ptyprocess==0.7.0 pure-eval==0.2.2 -py2vega==0.6.1 -pyarrow==12.0.1 +pyarrow==12.0.0 pycparser==2.21 -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 pyct==0.5.0 -pydantic==1.10.12 +pydantic==1.10.13 Pygments==2.15.1 pynwb==2.3.3 pyout==0.7.3 pyparsing==3.0.9 python-dateutil==2.8.2 python-json-logger==2.0.7 -pythreejs==2.4.2 pytz==2023.3 -PyWavelets==1.4.1 -PyYAML==6.0.1 -pyzmq==25.1.0 +PyYAML==6.0 +pyzmq==25.0.2 qtconsole==5.4.3 QtPy==2.3.1 -referencing==0.30.0 +referencing==0.30.2 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rfc3987==1.3.8 -roifile==2023.5.12 +rl-analysis @ file:///Users/pauladkisson/Documents/CatalystNeuro/NWB/DattaConv/dopamine-reinforces-spontaneous-behavior rpds-py==0.9.2 ruamel.yaml==0.17.32 ruamel.yaml.clib==0.2.7 -s3transfer==0.6.1 -scikit-image==0.21.0 -scipy==1.11.1 +s3fs==0.4.2 +s3transfer==0.7.0 +scikit-learn==1.2.2 +scipy==1.10.1 seaborn==0.12.2 semantic-version==2.10.0 Send2Trash==1.8.2 six==1.16.0 sniffio==1.3.0 +sortedcontainers==2.4.0 soupsieve==2.4.1 stack-data==0.6.2 -sympy==1.12 -tenacity==8.2.2 +statsmodels==0.14.0 +tbb==2021.9.0 +tblib==1.7.0 +tenacity==8.2.3 terminado==0.17.1 -tifffile==2023.7.18 +threadpoolctl==3.1.0 tinycss2==1.2.1 +toml==0.10.2 tomli==2.0.1 -torch==2.0.1 -tornado==6.3.2 +toolz==0.12.0 +tornado==6.2 tqdm==4.65.0 traitlets==5.9.0 -traittypes==0.2.1 -trimesh==3.23.0 -typing_extensions==4.7.1 -tzdata==2023.3 +typing_extensions==4.8.0 uri-template==1.3.0 -urllib3==1.26.16 -virtualenv==20.24.2 +urllib3==2.0.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -widgetsnbextension==4.0.8 +widgetsnbextension==4.0.7 yarl==1.9.2 -zarr==2.16.0 +zarr==2.16.1 zarr-checksum==0.2.9 -zipp==3.16.2 +zict==3.0.0 +zipp==3.17.0 diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/convert_session.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/convert_session.py index bd11a22..2b8c4c0 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/convert_session.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/convert_session.py @@ -42,6 +42,7 @@ def session_to_nwb( file_path=str(processed_path), tdt_path=str(tdt_path), tdt_metadata_path=str(tdt_metadata_path), + depth_timestamp_path="", session_metadata_path=str(session_metadata_path), subject_metadata_path=str(subject_metadata_path), session_uuid=subject_id, diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/fiberphotometryinterface.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/fiberphotometryinterface.py index 1e0878c..8b14acc 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/fiberphotometryinterface.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/fiberphotometryinterface.py @@ -6,7 +6,7 @@ # NWB Ecosystem from pynwb.file import NWBFile from pynwb.ophys import RoiResponseSeries -from ..markowitz_gillis_nature_2023.rawfiberphotometryinterface import RawFiberPhotometryInterface +from ..markowitz_gillis_nature_2023.rawfiberphotometryinterface import RawFiberPhotometryInterface, load_tdt_data from neuroconv.tools import nwb_helpers from hdmf.backends.hdf5.h5_utils import H5DataIO @@ -17,26 +17,47 @@ def __init__( file_path: str, tdt_path: str, tdt_metadata_path: str, + depth_timestamp_path: str, session_uuid: str, session_id: str, session_metadata_path: str, subject_metadata_path: str, + alignment_path: str = None, ): super().__init__( file_path=file_path, tdt_path=tdt_path, tdt_metadata_path=tdt_metadata_path, + depth_timestamp_path=depth_timestamp_path, session_uuid=session_uuid, session_id=session_id, session_metadata_path=session_metadata_path, subject_metadata_path=subject_metadata_path, + alignment_path=alignment_path, ) + def get_original_timestamps(self, metadata) -> np.ndarray: + processed_photometry = joblib.load(self.source_data["file_path"]) + timestamps = np.arange(processed_photometry["dlight"].shape[0]) / metadata["Constants"]["VIDEO_SAMPLING_RATE"] + return timestamps + + def align_processed_timestamps( + self, metadata: dict + ) -> np.ndarray: # TODO: align timestamps if we get alignment_df.parquet + timestamps = self.get_original_timestamps(metadata=metadata) + self.set_aligned_timestamps(aligned_timestamps=timestamps) + return self.aligned_timestamps + + def align_raw_timestamps(self, metadata: dict) -> np.ndarray: # TODO: remove if we get alignment_df.parquet + photometry_dict = load_tdt_data(self.source_data["tdt_path"], fs=metadata["FiberPhotometry"]["raw_rate"]) + timestamps = photometry_dict["tstep"] + self.set_aligned_timestamps(aligned_timestamps=timestamps) + return self.aligned_timestamps + def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None: - SAMPLING_RATE = 30 super().add_to_nwbfile(nwbfile, metadata) processed_photometry = joblib.load(self.source_data["file_path"]) - timestamps = np.arange(processed_photometry["dlight"].shape[0]) / SAMPLING_RATE + timestamps = self.align_processed_timestamps(metadata) signal_series = RoiResponseSeries( name="SignalF", description=( diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/irvideointerface.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/irvideointerface.py index c0fb761..f21f364 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/irvideointerface.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/irvideointerface.py @@ -16,6 +16,7 @@ def __init__( session_id: str, session_metadata_path: str, subject_metadata_path: str, + alignment_path: str = None, ): super().__init__( data_path=Path(data_path), @@ -23,8 +24,12 @@ def __init__( session_id=session_id, session_metadata_path=session_metadata_path, subject_metadata_path=subject_metadata_path, + alignment_path=alignment_path, ) + def get_original_timestamps(self, metadata) -> np.ndarray: + raise NotImplementedError # TODO: align timestamps if we get alignment_df.parquet + def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None: SAMPLING_RATE = metadata["Constants"]["VIDEO_SAMPLING_RATE"] matched_timestamp_path = ( diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py index dfececb..36e122e 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py @@ -20,6 +20,7 @@ def __init__( session_metadata_path: str, subject_metadata_path: str, summary_image_path: str, + alignment_path: str = None, ): super().__init__( file_path=file_path, @@ -28,6 +29,7 @@ def __init__( session_id=session_id, session_metadata_path=session_metadata_path, subject_metadata_path=subject_metadata_path, + alignment_path=alignment_path, ) def get_metadata_schema(self) -> dict: @@ -40,6 +42,9 @@ def get_metadata_schema(self) -> dict: } return metadata_schema + def get_original_timestamps(self, metadata) -> np.ndarray: + raise NotImplementedError # TODO: align timestamps if we get alignment_df.parquet + def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None: SAMPLING_RATE = metadata["Constants"]["VIDEO_SAMPLING_RATE"] keypoint_dict = joblib.load(self.source_data["file_path"]) diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/post_conversion/reproduce_figS3.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/post_conversion/reproduce_figS3.py index 16b964e..30ced06 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/post_conversion/reproduce_figS3.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/post_conversion/reproduce_figS3.py @@ -125,7 +125,7 @@ def reproduce_figS3(nwbfile_paths, config_path, metadata): timestamps = ( nwbfile.processing["behavior"] .data_interfaces["keypoints"] - .pose_estimation_series["rostral spine"] + .pose_estimation_series["rostral_spine"] .timestamps[:] ) positions_median = np.zeros((len(timestamps), 15, 3)) From 7b09d0c6c0aa33a6fe4d22736aca095dcb2663ef Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Thu, 14 Dec 2023 17:08:50 -0800 Subject: [PATCH 2/5] confirmed camera order for timestamps --- frozen_dependencies.txt | 199 +++++++++--------- .../keypointinterface.py | 2 +- 2 files changed, 104 insertions(+), 97 deletions(-) diff --git a/frozen_dependencies.txt b/frozen_dependencies.txt index b72a2b9..116e3f5 100644 --- a/frozen_dependencies.txt +++ b/frozen_dependencies.txt @@ -1,5 +1,4 @@ -absl-py==1.4.0 -aiohttp==3.8.6 +aiohttp==3.8.5 aiosignal==1.3.1 anyio==3.7.1 appdirs==1.4.4 @@ -10,203 +9,211 @@ arrow==1.2.3 asciitree==0.3.3 asttokens==2.2.1 async-lru==2.0.4 -async-timeout==4.0.3 +async-timeout==4.0.2 attrs==23.1.0 -av==10.0.0 Babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -bidsschematools==0.7.2 -black==23.3.0 +bidsschematools==0.7.1 bleach==6.0.0 blessed==1.20.0 -bokeh==2.4.3 -boto3==1.28.64 -botocore==1.31.64 +boto3==1.28.19 +botocore==1.31.19 +bqplot==0.12.40 +cellpose==2.2.2 certifi==2023.7.22 cffi==1.15.1 +cfgv==3.3.1 charset-normalizer==3.2.0 -chex==0.1.7 ci-info==0.3.0 -click==8.1.3 +click==8.1.6 click-didyoumean==0.3.0 -cloudpickle==2.2.1 -cmocean==3.0.3 colorcet==3.0.1 -comm==0.1.3 -contourpy==1.0.7 +comm==0.1.4 +contourpy==1.1.0 cycler==0.11.0 -Cython==3.0.0 -dandi==0.56.2 +dandi==0.58.0 dandischema==0.8.4 -dask==2022.4.0 -dask-jobqueue==0.8.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 -dill==0.3.6 -distributed==2022.4.0 -dm-tree==0.1.8 -dnspython==2.4.2 +distlib==0.3.7 +dnspython==2.4.1 email-validator==2.0.0.post2 -etelemetry==0.3.1 +entrypoints==0.4 +etelemetry==0.3.0 exceptiongroup==1.1.2 executing==1.2.0 -fasteners==0.19 +fasteners==0.18 fastjsonschema==2.18.0 -ffprobe==0.5 -fonttools==4.39.4 +fastremap==1.13.5 +filelock==3.12.2 +fonttools==4.42.0 fparse==1.20.1 fqdn==1.5.1 frozenlist==1.4.0 -fscacher==0.4.0 -fsspec==2023.5.0 -h5py==3.8.0 +fscacher==0.3.0 +fsspec==2023.6.0 +gast==0.4.0 +h5py==3.9.0 hdmf==3.6.1 -humanize==4.8.0 -hyphyber @ file:///Users/pauladkisson/Documents/CatalystNeuro/NWB/DattaConv/hyphyber-master +humanize==4.7.0 +identify==2.5.26 idna==3.4 -importlib-metadata==6.8.0 +imagecodecs==2023.7.10 +imageio==2.31.1 +importlib-metadata==4.13.0 interleave==0.2.1 -ipykernel==6.23.1 -ipython==8.13.2 +ipydatagrid==1.1.16 +ipydatawidgets==4.3.2 +ipyfilechooser==0.6.0 +ipykernel==6.25.1 +ipympl==0.9.3 +ipython==8.14.0 ipython-genutils==0.2.0 -ipywidgets==8.0.6 +ipyvolume==0.6.3 +ipyvue==1.9.2 +ipyvuetify==1.8.10 +ipywebrtc==0.6.0 +ipywidgets==8.1.0 isodate==0.6.1 isoduration==20.11.0 jaraco.classes==3.3.0 -jax==0.4.10 -jaxlib==0.4.10 -jedi==0.18.2 +jedi==0.19.0 Jinja2==3.1.2 jmespath==1.0.1 -joblib==1.2.0 +joblib==1.3.1 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.19.0 +jsonschema==4.18.6 jsonschema-specifications==2023.7.1 jupyter==1.0.0 jupyter-console==6.6.3 jupyter-events==0.7.0 jupyter-lsp==2.2.0 -jupyter_client==8.2.0 -jupyter_core==5.3.0 +jupyter_client==8.3.0 +jupyter_core==5.3.1 jupyter_server==2.7.0 jupyter_server_terminals==0.4.4 jupyterlab==4.0.4 jupyterlab-pygments==0.2.2 -jupyterlab-widgets==3.0.7 +jupyterlab-widgets==3.0.8 jupyterlab_server==2.24.0 keyring==24.2.0 keyrings.alt==5.0.0 kiwisolver==1.4.4 -llvmlite==0.40.0 -locket==1.0.0 -MarkupSafe==2.1.2 -matplotlib==3.7.1 +lazy_loader==0.3 +llvmlite==0.40.1 +MarkupSafe==2.1.3 +matplotlib==3.7.2 matplotlib-inline==0.1.6 mistune==3.0.1 -ml-dtypes==0.1.0 more-itertools==10.1.0 -msgpack==1.0.5 +mpmath==1.3.0 multidict==6.0.4 -multipledispatch==0.6.0 -multiprocess==0.70.14 -mypy-extensions==1.0.0 -natsort==8.3.1 +natsort==8.4.0 nbclient==0.8.0 nbconvert==7.7.3 nbformat==5.9.2 -nest-asyncio==1.5.6 +# Editable install with no version control (ndx-depth-moseq==0.1.0) +-e /opt/anaconda3/envs/datta_env/lib/python3.10/site-packages +ndx-events==0.2.0 +ndx-grayscalevolume==0.0.2 +ndx-icephys-meta==0.1.0 +ndx-moseq @ git+https://github.com/pauladkisson/ndx-moseq.git@cac0b4003525b3ac902fed9a68d90ca459a211f8 +ndx-photometry @ git+https://github.com/catalystneuro/ndx-photometry.git@7ea9d755ceac9524125f50ab528b403b135c4530 +-e git+https://github.com/rly/ndx-pose.git@f9dd18a8290897e48bdd6ebeedcc0a7095d86265#egg=ndx_pose +ndx-spectrum==0.2.2 +nest-asyncio==1.5.7 networkx==3.1 +neuroconv==0.4.0 +nodeenv==1.8.0 notebook==7.0.2 notebook_shim==0.2.3 -numba==0.57.0 -numcodecs==0.12.0 -numexpr==2.8.1 -numpy==1.21.5 -numpyro==0.11.0 -opencv-python-headless==4.7.0.72 -opt-einsum==3.3.0 -optax==0.1.5 +numba==0.57.1 +numcodecs==0.11.0 +numpy==1.24.4 +nwbinspector==0.4.29 +nwbwidgets==0.11.3 +opencv-python-headless==4.8.0.74 overrides==7.4.0 packaging==23.1 -pandas==1.5.0 +pandas==2.0.3 pandocfilters==1.5.0 param==1.13.0 parso==0.8.3 -partd==1.4.0 -pathspec==0.11.1 -patsy==0.5.3 pexpect==4.8.0 pickleshare==0.7.5 -Pillow==9.5.0 -platformdirs==3.5.1 +Pillow==10.0.0 +platformdirs==3.10.0 +plotly==5.13.1 +pre-commit==3.3.3 prometheus-client==0.17.1 -prompt-toolkit==3.0.38 +prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 pure-eval==0.2.2 -pyarrow==12.0.0 +py2vega==0.6.1 +pyarrow==12.0.1 pycparser==2.21 -pycryptodomex==3.19.0 +pycryptodomex==3.18.0 pyct==0.5.0 -pydantic==1.10.13 +pydantic==1.10.12 Pygments==2.15.1 pynwb==2.3.3 pyout==0.7.3 pyparsing==3.0.9 python-dateutil==2.8.2 python-json-logger==2.0.7 +pythreejs==2.4.2 pytz==2023.3 -PyYAML==6.0 -pyzmq==25.0.2 +PyWavelets==1.4.1 +PyYAML==6.0.1 +pyzmq==25.1.0 qtconsole==5.4.3 QtPy==2.3.1 -referencing==0.30.2 +referencing==0.30.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rfc3987==1.3.8 -rl-analysis @ file:///Users/pauladkisson/Documents/CatalystNeuro/NWB/DattaConv/dopamine-reinforces-spontaneous-behavior +roifile==2023.5.12 rpds-py==0.9.2 ruamel.yaml==0.17.32 ruamel.yaml.clib==0.2.7 -s3fs==0.4.2 -s3transfer==0.7.0 -scikit-learn==1.2.2 -scipy==1.10.1 +s3transfer==0.6.1 +scikit-image==0.21.0 +scipy==1.11.1 seaborn==0.12.2 semantic-version==2.10.0 Send2Trash==1.8.2 six==1.16.0 sniffio==1.3.0 -sortedcontainers==2.4.0 soupsieve==2.4.1 stack-data==0.6.2 -statsmodels==0.14.0 -tbb==2021.9.0 -tblib==1.7.0 -tenacity==8.2.3 +sympy==1.12 +tenacity==8.2.2 terminado==0.17.1 -threadpoolctl==3.1.0 +tifffile==2023.7.18 tinycss2==1.2.1 -toml==0.10.2 tomli==2.0.1 -toolz==0.12.0 -tornado==6.2 +torch==2.0.1 +tornado==6.3.2 tqdm==4.65.0 traitlets==5.9.0 -typing_extensions==4.8.0 +traittypes==0.2.1 +trimesh==3.23.0 +typing_extensions==4.7.1 +tzdata==2023.3 uri-template==1.3.0 -urllib3==2.0.2 +urllib3==1.26.16 +virtualenv==20.24.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -widgetsnbextension==4.0.7 +widgetsnbextension==4.0.8 yarl==1.9.2 -zarr==2.16.1 +zarr==2.16.0 zarr-checksum==0.2.9 -zict==3.0.0 -zipp==3.17.0 +zipp==3.16.2 diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py index 36e122e..306b2cc 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023_keypoint/keypointinterface.py @@ -52,7 +52,7 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None: timestamps = H5DataIO(np.arange(raw_keypoints.shape[0]) / SAMPLING_RATE, compression=True) index_to_name = metadata["Keypoint"]["index_to_name"] - camera_names = ["bottom", "side1", "side2", "side3", "side4", "top"] + camera_names = ["bottom", "side1", "side2", "side3", "side4", "top"] # as confirmed by email with authors keypoints = [] for camera in camera_names: nwbfile.create_device( From 077bdc039d7a48e4d215fd9dfca0c92f1920e5c4 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Thu, 14 Dec 2023 17:23:18 -0800 Subject: [PATCH 3/5] added session_start_times to keypoint metadata --- .../preconversion/extract_metadata.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py index 2ad173e..33d9fd0 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py @@ -457,15 +457,22 @@ def extract_reinforcement_photometry_metadata(data_path: str, example_uuids: str return session_metadata, subject_metadata -def extract_keypoint_metadata(data_path: str): +def extract_keypoint_metadata(): keypoint_subjects = ["dls-dlight-9", "dls-dlight-10", "dls-dlight-11", "dls-dlight-12", "dls-dlight-13"] + keypoint_start_times = [ + "2022-07-14T11:24:31-05:00", + "2022-07-13T11:49:49-05:00", + "2022-07-13T12:21:37-05:00", + "2022-07-13T17:03:55-05:00", + "2022-07-13T16:28:19-05:00", + ] session_metadata, subject_metadata = {}, {} - for subject in keypoint_subjects: + for subject, session_start_time in zip(keypoint_subjects, keypoint_start_times): session_metadata[subject] = dict( keypoint=True, photometry=True, session_description="keypoint session", - session_start_time="1901-01-01T00:00:00-05:00", # TODO: replace with real session start time + session_start_time=session_start_time, reference_max=np.NaN, signal_max=np.NaN, signal_reference_corr=np.NaN, From 5c3447b56d1084056416039bd8b35994dd630dec Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Thu, 14 Dec 2023 17:26:26 -0800 Subject: [PATCH 4/5] fixed keypoint metadata bug --- .../preconversion/extract_metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py index 33d9fd0..cf08f9f 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/preconversion/extract_metadata.py @@ -652,7 +652,7 @@ def get_session_name(session_df): velocity_session_metadata, velocity_subject_metadata = extract_velocity_modulation_metadata( data_path, ) - keypoint_session_metadata, keypoint_subject_metadata = extract_keypoint_metadata(data_path) + keypoint_session_metadata, keypoint_subject_metadata = extract_keypoint_metadata() path2metadata = { photometry_session_metadata_path: photometry_session_metadata, From 0ae94bf8c84af6f30a79ab3dd540f861303de245 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 16 Feb 2024 11:02:44 -0800 Subject: [PATCH 5/5] added note about lack of alignment for keypoint sessions --- .../markowitz_gillis_nature_2023/rawfiberphotometryinterface.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/rawfiberphotometryinterface.py b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/rawfiberphotometryinterface.py index 96f4a27..a873277 100644 --- a/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/rawfiberphotometryinterface.py +++ b/src/datta_lab_to_nwb/markowitz_gillis_nature_2023/rawfiberphotometryinterface.py @@ -287,6 +287,7 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata: dict) -> None: raw_photometry = RoiResponseSeries( name="RawPhotometry", description="The raw acquisition with mixed signal from both the blue light excitation (470nm) and UV excitation (405nm).", + comments=("Note: Raw photometry data is not temporally aligned for keypoint sessions."), data=H5DataIO(raw_photometry[ascending_timestamps_indices], compression=True), unit="F", timestamps=commanded_signal_series.timestamps,