KiloSort data conversion#
Install NeuroConv with the additional dependencies necessary for reading kilosort data.
pip install "neuroconv[kilosort]"
Convert KiloSort data to NWB using
KiloSortSortingInterface
.
>>> from datetime import datetime
>>> from zoneinfo import ZoneInfo
>>> from pathlib import Path
>>>
>>> from neuroconv.datainterfaces import KiloSortSortingInterface
>>>
>>> folder_path = f"{ECEPHY_DATA_PATH}/phy/phy_example_0"
>>> # Change the folder_path to the location of the data in your system
>>> interface = KiloSortSortingInterface(folder_path=folder_path, verbose=False)
>>>
>>> metadata = interface.get_metadata()
>>> session_start_time = datetime(2020, 1, 1, 12, 30, 0, tzinfo=ZoneInfo("US/Pacific"))
>>> metadata["NWBFile"].update(session_start_time=session_start_time)
>>> nwbfile_path = f"{path_to_save_nwbfile}" # This should be something like: "./saved_file.nwb"
>>> interface.run_conversion(nwbfile_path=nwbfile_path, metadata=metadata)