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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ Play around with it and raise Github issues if anything fails
conda env create --file=processing_env.yml
```

For kilosorting you will also need:
1. Install kilosort and the GUI, run `python -m pip install kilosort[gui]`. If you're on a zsh server, you may need to use `python -m pip install "kilosort[gui]"`
2. You can also just install the minimal version of kilosort with python -m pip install kilosort.
3. Next, if the CPU version of pytorch was installed (will happen on Windows), remove it with `pip uninstall torch`
4. Then install the GPU version of pytorch `conda install pytorch pytorch-cuda=11.8 -c pytorch -c nvidia`

If you installed the base environment and want to update later on:
```shell
conda env --file=processing_env.yml
conda env update --file=processing_env.yml
```
And then do the kilosort step
4. Create your configuration file:
```shell
bnd init # Provide the path to local and remote data storage
Expand Down
12 changes: 8 additions & 4 deletions bnd/pipeline/kilosort.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,19 @@ def run_kilosort_on_session(session_path: Path) -> None:
logger.warning(f"Kilosort output already exists. Skipping kilosort call")

else:
ephys_recording_folders = config.get_subdirectories_from_pattern(
session_path, "*_g?"
)
# Check kilosort is installed in environment
if torch.cuda.is_available():
logger.info(f"CUDA is available. GPU device: {torch.cuda.get_device_name(0)}")
else:
logger.warning("CUDA is not available. GPU computations will not be enabled.")
return
ephys_recording_folders = config.get_subdirectories_from_pattern(
session_path, "*_g?"
)
if len(ephys_recording_folders) > 1:
raise ValueError(
"It seems you are trying to run kilosort without GPU. Look at the README on instrucstions of how to do this. "
)

for recording_path in ephys_recording_folders:
logger.info(f"Processing recording: {recording_path.name}")
run_kilosort_on_recording(
Expand Down
2 changes: 1 addition & 1 deletion bnd/pipeline/nwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def run_nwb_conversion(session_path: Path, kilosort_flag: bool, custom_map: bool
.strip()
.lower()
)
if response != "y":
if "y" not in response:
logger.warning(f"Aborting nwb conversion")
return
else:
Expand Down
4 changes: 2 additions & 2 deletions bnd/pipeline/pyaldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,12 +857,12 @@ def save(self):
.lower()
.strip()
)
if user_input == "y":
if "y" in user_input:
self._partition_and_save_to_mat()
logger.info("Session has been overwritten.")
break

elif user_input == "n":
elif "n" in user_input:
logger.info("Session was not overwritten.")
break

Expand Down
3 changes: 0 additions & 3 deletions processing_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ dependencies:
- python=3.10
- pytest
- typer
- pytorch
- pytorch-cuda=11.8
- pynwb
- numpy
- pandas
- scipy
- spikeinterface
- pip:
- kilosort
- ndx_pose
- neuroconv
- -e ./
Loading