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

Decoding pipeline edits for imported data #782

Merged
merged 197 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 196 commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
6b9b66f
Add non-local detector and remove replay_trajectory_classification
edeno Oct 19, 2023
f12ec07
Merge branch 'master' into decoding-pipeline
edeno Nov 7, 2023
9cc8984
Reorganize
edeno Nov 30, 2023
ac14e19
Merge branch 'master' into decoding-pipeline
edeno Nov 30, 2023
d2eb290
Fix formatting and imports
edeno Nov 30, 2023
a861483
Merge branch 'master' into decoding-pipeline
edeno Dec 14, 2023
69dc63d
Update .gitignore
edeno Dec 18, 2023
d4ccca3
Merge branch 'master' into decoding-pipeline
edeno Dec 18, 2023
e9e0870
Remove because of circular import
edeno Dec 18, 2023
d0d5e9d
Merge branch 'master' into decoding-pipeline
edeno Dec 19, 2023
654db5f
Merge branch 'master' into decoding-pipeline
edeno Dec 20, 2023
5787a04
Fix name of parameter
edeno Dec 20, 2023
61018fe
Handle case where ther is only one interval
edeno Dec 20, 2023
4516618
Fix settings
edeno Dec 20, 2023
d4148eb
Handle single interval
edeno Dec 20, 2023
d101f53
Merge branch 'master' into decoding-pipeline
edeno Dec 20, 2023
a165c8d
Merge branch 'master' into decoding-pipeline
edeno Dec 20, 2023
34dec96
Merge branch 'master' into decoding-pipeline
edeno Dec 20, 2023
1a18770
Merge branch 'master' into decoding-pipeline
edeno Dec 20, 2023
6282392
Merge branch 'master' into decoding-pipeline
edeno Dec 20, 2023
554eb8d
Merge branch 'master' into decoding-pipeline
edeno Dec 21, 2023
bc7c4f1
from_unit_dict does not exist in 0.98.2 of spike interface
edeno Dec 21, 2023
2dfd1f8
Simplify call
edeno Dec 21, 2023
3edb261
Update for SpikeSorting merge table and add spyglass mixin
edeno Dec 21, 2023
711fba7
Merge branch 'master' into decoding-pipeline
edeno Dec 21, 2023
1aa4589
Merge branch 'master' into decoding-pipeline
edeno Dec 21, 2023
4b5771c
Fix dependencies
edeno Dec 21, 2023
baca5fc
Fix merge conflict
edeno Dec 21, 2023
4d4c080
Update src/spyglass/decoding/v1/clusterless.py
edeno Dec 21, 2023
947c763
Update src/spyglass/decoding/v1/clusterless.py
edeno Dec 21, 2023
f9bc8d3
Update src/spyglass/decoding/v1/clusterless.py
edeno Dec 21, 2023
9e40004
Update src/spyglass/decoding/v1/clusterless.py
edeno Dec 21, 2023
6c17c7c
Apply suggestions from code review
edeno Dec 21, 2023
8008280
Remove unused imports and format
edeno Dec 21, 2023
78af559
Add saving of waveform features
edeno Dec 22, 2023
ad9f7df
Don't store electrodes, full waveforms, waveform mean
edeno Dec 22, 2023
851a32a
Fix spike times and add convenience method
edeno Dec 22, 2023
8e8aebf
Add spike location and some formatting
edeno Dec 22, 2023
84503d4
Merge branch 'master' into decoding-pipeline
edeno Dec 22, 2023
bdb99ee
Remove circular import
edeno Dec 22, 2023
9dbb790
Fix dict expansion
edeno Dec 22, 2023
72aa0f9
Initial working clusterless pipeline
edeno Dec 22, 2023
bfe16ba
Add position group
edeno Dec 23, 2023
7e533e1
Rename classifier to decoding
edeno Dec 23, 2023
a1dff9c
Handle encoding and decoding intervals
edeno Dec 23, 2023
284ebdd
Put old files under v0, try/except for old decoding package
edeno Dec 23, 2023
f6612ab
Rename visualization and remove from v0
edeno Dec 23, 2023
a9d14b6
Place parameters and position group in core.py
edeno Dec 23, 2023
386027b
Add sorted spikes decoding
edeno Dec 23, 2023
17b1abb
Add objects to init for convenience
edeno Dec 23, 2023
34c65ec
Remove unused imports
edeno Dec 23, 2023
6cb5a27
Fix fetching of spike times
edeno Dec 23, 2023
6105b55
Insert into merge table
edeno Dec 23, 2023
c8cf692
Update CHANGELOG.md
edeno Dec 23, 2023
17c050a
Function for removing decoding outputs not in DecodingOutput
edeno Dec 24, 2023
25c75ab
Fix name
edeno Dec 24, 2023
11457e5
Add draft of tutorials and rearrange notebooks
edeno Dec 24, 2023
3b60150
Fix config loading
edeno Dec 26, 2023
cf4de2c
Add 1D decoding and some notes on estimate_parameters kwarg
edeno Dec 27, 2023
74d7b1f
Update 43_Decoding_SortedSpikes.ipynb
edeno Dec 27, 2023
f7cf9fc
Remove old decoding notebook
edeno Dec 27, 2023
5828bea
Merge branch 'master' into decoding-pipeline
edeno Dec 27, 2023
011191e
Save initial conditions and discrete transitions
edeno Dec 27, 2023
5d6dc19
Apply suggestions from code review
edeno Jan 2, 2024
a37c51c
Be more specific with import error
edeno Jan 2, 2024
a304472
Remove unneeded comments
edeno Jan 2, 2024
b0ba523
Remove incorrect dimension name
edeno Jan 2, 2024
ba28472
Project merge_id from SpikeSortingOutput for clarity
edeno Jan 2, 2024
c9a0cdc
Update src/spyglass/decoding/v0/clusterless.py
edeno Jan 2, 2024
d8e883e
Update src/spyglass/decoding/v0/clusterless.py
edeno Jan 2, 2024
74a50eb
Update src/spyglass/decoding/v0/clusterless.py
edeno Jan 2, 2024
3fcbc48
Fix linting
edeno Jan 2, 2024
987e024
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
edeno Jan 2, 2024
87c340a
Update notebooks
edeno Jan 2, 2024
5247948
Ignore .pem
edeno Jan 3, 2024
18b3e57
Add session as a primary key for Groups
edeno Jan 3, 2024
12e8360
Add some helper methods
edeno Jan 3, 2024
799fbbe
Update notebooks
edeno Jan 3, 2024
0179414
Update README.md
edeno Jan 3, 2024
c483988
Update pyscripts
edeno Jan 3, 2024
2fc0e9d
Update 42_Decoding_Clusterless.ipynb
edeno Jan 3, 2024
f780bd6
Update CHANGELOG.md
edeno Jan 3, 2024
6c0a2f9
Add fetch and insert
edeno Jan 3, 2024
c918569
Merge branch 'master' into decoding-pipeline
edeno Jan 3, 2024
4999c78
Simplify class conversion
edeno Jan 3, 2024
935fde8
Do the dictionary conversion of class for the user
edeno Jan 3, 2024
b14ac06
Update CHANGELOG.md
edeno Jan 3, 2024
b6ed2ad
Merge branch 'master' into decoding-pipeline
edeno Jan 3, 2024
6ff7181
Update .gitignore
edeno Jan 3, 2024
9e527ce
Use methods in populate
edeno Jan 3, 2024
18d7af2
Avoid fetching interval range if not needed
edeno Jan 3, 2024
53fb7ef
Generalize finding class from modules
edeno Jan 4, 2024
2d5fa9c
Use args/kwargs
edeno Jan 4, 2024
33fbf61
Simplify tuple unpacking
edeno Jan 4, 2024
c8b4efb
Make decoding kwargs nullable
edeno Jan 4, 2024
1b06dac
Add function for get_recording and get_sorting to the spikesorting me…
samuelbray32 Jan 4, 2024
28d44f7
make decoding waveform features agnostic to spikesorting source
samuelbray32 Jan 4, 2024
7eed4af
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
samuelbray32 Jan 4, 2024
c267cba
Fix spelling
edeno Jan 5, 2024
a891747
Use fetch1_dataframe for position
edeno Jan 5, 2024
74c927d
Use self instead of class
edeno Jan 5, 2024
bd4211e
Update src/spyglass/decoding/v1/sorted_spikes.py
edeno Jan 8, 2024
fa3c13d
Be more careful about populating select keys
edeno Jan 8, 2024
3807db6
Make more readable/remove unused imports
edeno Jan 8, 2024
3995e24
Save classifier
edeno Jan 8, 2024
d14f40f
Clean up saved model paths
edeno Jan 8, 2024
560a22a
add function load_linear_position_info
samuelbray32 Jan 8, 2024
3ead87e
Update src/spyglass/decoding/v1/sorted_spikes.py
edeno Jan 8, 2024
08c4c20
Update 41_Extracting_Clusterless_Waveform_Features.py
edeno Jan 9, 2024
158f4bc
Update docstring
edeno Jan 9, 2024
e4ae6d9
Merge branch 'master' into decoding-pipeline
edeno Jan 9, 2024
4ec0f50
Apply suggestions from code review
edeno Jan 10, 2024
c01baad
Update src/spyglass/decoding/v1/clusterless.py
edeno Jan 10, 2024
17dad85
Update src/spyglass/decoding/v1/clusterless.py
edeno Jan 10, 2024
34600d2
Fix linting
edeno Jan 10, 2024
6d25232
Fix syntax
edeno Jan 10, 2024
7358ced
Rename variable to avoid confusion
edeno Jan 10, 2024
9aaa454
Merge branch 'master' into decoding-pipeline
edeno Jan 10, 2024
135d4e7
Merge branch 'master' into decoding-pipeline
edeno Jan 10, 2024
561f95e
Restrict UnitWaveformFeaturesGroup and SortedSpikesGroup
edeno Jan 10, 2024
1794df2
Concatenate linear position and position dataframes
edeno Jan 11, 2024
4d507eb
Static methods don't require instantiating class
edeno Jan 11, 2024
7d98e7c
Avoid merge restrict
edeno Jan 12, 2024
4b36706
Merge branch 'master' into decoding-pipeline
edeno Jan 12, 2024
f10d0e8
Merge branch 'master' into decoding-pipeline
edeno Jan 12, 2024
a062494
Merge branch 'master' into decoding-pipeline
edeno Jan 12, 2024
dca2ab6
Add version to defaults
edeno Jan 13, 2024
fe857b6
Remove unused import
edeno Jan 13, 2024
bae756d
Fix classifier path
edeno Jan 14, 2024
2d01c36
Add dry run
edeno Jan 14, 2024
ae0de1b
Remove non-default
edeno Jan 15, 2024
46bc1c4
Handle permissions and file not found
edeno Jan 15, 2024
1608923
Keep position info within encoding/decoding interval
edeno Jan 16, 2024
fe9cebb
Add methods to get the spike_times, spike_indicators, firing rate
edeno Jan 16, 2024
208c8ef
Fix docstring to match default
edeno Jan 16, 2024
bd5e3a8
Implement function rather than import
edeno Jan 16, 2024
ab1370a
Remove unused broken imports
edeno Jan 18, 2024
345de1a
Add decoding cleanup
edeno Jan 18, 2024
6fb1d08
Fix import
edeno Jan 18, 2024
39e0b3e
Put old vis code back
edeno Jan 18, 2024
aeefd7c
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
edeno Jan 18, 2024
e3c141a
Fix import
edeno Jan 18, 2024
b4e83cd
Add draft helper functions
edeno Jan 18, 2024
386714c
Limit options on input
edeno Jan 18, 2024
ecb7f9d
Fix logic
edeno Jan 18, 2024
da8dd38
Fix where the key is passed
edeno Jan 18, 2024
7148479
Update notebooks
edeno Jan 18, 2024
3061898
Host main visualizations in non_local_detector repo
edeno Jan 18, 2024
456b65e
Update notebooks/py_scripts/41_Extracting_Clusterless_Waveform_Featur…
edeno Jan 18, 2024
d64cefc
Update src/spyglass/spikesorting/merge.py
edeno Jan 18, 2024
c08d4fc
Update src/spyglass/decoding/decoding_merge.py
edeno Jan 18, 2024
47fa5fe
Revert "Limit options on input"
edeno Jan 18, 2024
ed6b22f
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
edeno Jan 18, 2024
d664125
Use f-string for version
edeno Jan 18, 2024
f935256
Add useful imports to the top level
edeno Jan 18, 2024
082fa42
Make source class a hidden attribute
edeno Jan 18, 2024
4007787
Update CHANGELOG.md
edeno Jan 19, 2024
d4a97b2
Merge branch 'master' into decoding-pipeline
edeno Jan 19, 2024
6567487
Merge branch 'master' into decoding-pipeline
edeno Jan 19, 2024
743e28c
Centralize get_class logic in Merge (#749)
CBroz1 Jan 19, 2024
6da9d86
Merge branch 'master' into decoding-pipeline
edeno Jan 20, 2024
8b32701
Merge branch 'master' into decoding-pipeline
edeno Jan 20, 2024
bab84c4
Add _nwb_table for fetch_nwb
edeno Jan 20, 2024
963de80
Method is static method
edeno Jan 20, 2024
7d5638e
Add merge insert
edeno Jan 20, 2024
af16e48
string split is brittle, use defaults if it didn't work
edeno Jan 21, 2024
ca2171d
WIP: Mixin resolves _nwb_table attr for Merge (#783)
CBroz1 Jan 21, 2024
b96641d
Change import
edeno Jan 21, 2024
6ea5572
Handle single position 3D case
edeno Jan 21, 2024
bbcd6a9
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
edeno Jan 21, 2024
b6b2e04
Fix getting source from key
edeno Jan 22, 2024
093211d
Use merge_restrict_class for fetch_nwb on merge tables
edeno Jan 22, 2024
42c3a36
Move this back
edeno Jan 22, 2024
cbc1e6a
Remove for now
edeno Jan 22, 2024
281bf36
Temp patch for tests
edeno Jan 22, 2024
d70ecd7
Revert "Temp patch for tests"
edeno Jan 22, 2024
688f0ca
Temp patch for tests
edeno Jan 22, 2024
10053c0
Handle None decoding kwargs
edeno Jan 22, 2024
0b81aa8
fetch_nwb is a method not a class method now
edeno Jan 22, 2024
4d2fcbb
Fix _merge_repr for numeric data types (#786)
CBroz1 Jan 22, 2024
a730682
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
edeno Jan 22, 2024
63daa88
Merge branch 'master' into decoding-pipeline
edeno Jan 22, 2024
e7edaa2
Easily calculate firing rate
edeno Jan 22, 2024
6fd7a85
Merge branch 'decoding-pipeline' of https://github.com/LorenFrankLab/…
edeno Jan 22, 2024
c1f4be1
Add sorting spike times by place field and ahead behind distance
edeno Jan 23, 2024
32546d2
Account for differently named position variables
edeno Jan 23, 2024
0347062
Handle orientation name and fix linear position fetch
edeno Jan 23, 2024
ede41e7
Fix 2D ahead/behind
edeno Jan 23, 2024
08daa0c
Add `UnitSelection` table (#788)
khl02007 Jan 23, 2024
41d0c36
Rename table
edeno Jan 23, 2024
e2b4cf6
Addressing #789, failing tests (#795)
CBroz1 Jan 24, 2024
e41bacd
Apply suggestions from code review
edeno Jan 25, 2024
aaadf04
Fix formatting
edeno Jan 25, 2024
0f4e09b
Update src/spyglass/common/common_behav.py
edeno Jan 25, 2024
5de0e46
Update src/spyglass/settings.py
edeno Jan 25, 2024
c8df1c7
Fix syntax
edeno Jan 25, 2024
4e5e5dc
Update merge.py
edeno Jan 25, 2024
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
### Pipelines

- Spike sorting: Add SpikeSorting V1 pipeline. #651
- LFP: Minor fixes to LFPBandV1 populator. #706
- LFP: Minor fixes to LFPBandV1 populator and `make`. #706, #795
- Linearization:
- Minor fixes to LinearizedPositionV1 pipeline #695
- Rename `position_linearization` -> `linearization`. #717
Expand All @@ -34,6 +34,7 @@
- Use the new `non_local_detector` package for decoding #731
- Allow multiple spike waveform features for clusterelss decoding #731
- Reorder notebooks #731
- Add fetch class functionality to `Merge` table. #783, #786

## [0.4.3] (November 7, 2023)

Expand Down
22 changes: 18 additions & 4 deletions dj_local_conf_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"display.show_tuple_count": true,
"database.use_tls": null,
"enable_python_native_blobs": true,
"filepath_checksum_size_limit": null,
"filepath_checksum_size_limit": 1073741824,
"stores": {
"raw": {
"protocol": "file",
Expand All @@ -28,14 +28,28 @@
}
},
"custom": {
"debug_mode": "false",
"test_mode": "false",
"spyglass_dirs": {
"base": "/your/path/like/stelmo/nwb/"
"base": "/your/base/path",
"raw": "/your/base/path/raw",
"analysis": "/your/base/path/analysis",
"recording": "/your/base/path/recording",
"sorting": "/your/base/path/spikesorting",
"waveforms": "/your/base/path/waveforms",
"temp": "/your/base/path/tmp",
"video": "/your/base/path/video"
},
"kachery_dirs": {
"cloud": "/your/path/.kachery-cloud"
"cloud": "/your/base/path/kachery_storage",
"storage": "/your/base/path/kachery_storage",
"temp": "/your/base/path/tmp"
},
"dlc_dirs": {
"base": "/your/path/like/nimbus/deeplabcut/"
"base": "/your/base/path/deeplabcut",
"project": "/your/base/path/deeplabcut/projects",
"video": "/your/base/path/deeplabcut/video",
"output": "/your/base/path/deeplabcut/output"
},
"kachery_zone": "franklab.default"
}
Expand Down
77 changes: 40 additions & 37 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,49 @@

![Figure 1](./images/fig1.png)

**Spyglass** is an open-source software framework designed to offer reliable
and reproducible analysis of neuroscience data and sharing of the results
with collaborators and the broader community.
**Spyglass** is an open-source software framework designed to offer reliable and
reproducible analysis of neuroscience data and sharing of the results with
collaborators and the broader community.

Features of Spyglass include:

+ **Standardized data storage** - Spyglass uses the open-source
[Neurodata Without Borders: Neurophysiology (NWB:N)](https://www.nwb.org/)
format to ingest and store processed data. NWB:N is a standard set by the BRAIN
Initiative for neurophysiological data ([Rübel et al., 2022](https://doi.org/10.7554/elife.78362)).
+ **Reproducible analysis** - Spyglass uses [DataJoint](https://datajoint.com/)
to ensure that all analysis is reproducible. DataJoint is a data management
system that automatically tracks dependencies between data and analysis code. This
ensures that all analysis is reproducible and that the results are
automatically updated when the data or analysis code changes.
+ **Common analysis tools** - Spyglass provides easy usage of the open-source packages
[SpikeInterface](https://github.com/SpikeInterface/spikeinterface),
[Ghostipy](https://github.com/kemerelab/ghostipy), and [DeepLabCut](https://github.com/DeepLabCut/DeepLabCut)
for common analysis tasks. These packages are well-documented and have active
developer communities.
+ **Interactive data visualization** - Spyglass uses [figurl](https://github.com/flatironinstitute/figurl)
to create interactive data visualizations that can be shared with collaborators
and the broader community. These visualizations are hosted on the web
and can be viewed in any modern web browser. The interactivity allows users to
explore the data and analysis results in detail.
+ **Sharing results** - Spyglass enables sharing of data and analysis results via
[Kachery](https://github.com/flatironinstitute/kachery-cloud), a
decentralized content addressable data sharing platform. Kachery Cloud allows
users to access the database and pull data and analysis results directly
to their local machine.
+ **Pipeline versioning** - Processing and analysis of data in neuroscience is
often dynamic, requiring new features. Spyglass uses *Merge tables* to ensure that
analysis pipelines can be versioned. This allows users to easily use and compare
results from different versions of the analysis pipeline while retaining
the ability to access previously generated results.
+ **Cautious Delete** - Spyglass uses a `cautious delete` feature to ensure
that data is not accidentally deleted by other users. When a user deletes data,
Spyglass will first check to see if the data belongs to another team of users.
This enables teams of users to work collaboratively on the same database without
worrying about accidentally deleting each other's data.
- **Standardized data storage** - Spyglass uses the open-source
[Neurodata Without Borders: Neurophysiology (NWB:N)](https://www.nwb.org/)
format to ingest and store processed data. NWB:N is a standard set by the
BRAIN Initiative for neurophysiological data
([Rübel et al., 2022](https://doi.org/10.7554/elife.78362)).
- **Reproducible analysis** - Spyglass uses [DataJoint](https://datajoint.com/)
to ensure that all analysis is reproducible. DataJoint is a data management
system that automatically tracks dependencies between data and analysis
code. This ensures that all analysis is reproducible and that the results
are automatically updated when the data or analysis code changes.
- **Common analysis tools** - Spyglass provides easy usage of the open-source
packages [SpikeInterface](https://github.com/SpikeInterface/spikeinterface),
[Ghostipy](https://github.com/kemerelab/ghostipy), and
[DeepLabCut](https://github.com/DeepLabCut/DeepLabCut) for common analysis
tasks. These packages are well-documented and have active developer
communities.
- **Interactive data visualization** - Spyglass uses
[figurl](https://github.com/flatironinstitute/figurl) to create interactive
data visualizations that can be shared with collaborators and the broader
community. These visualizations are hosted on the web and can be viewed in
any modern web browser. The interactivity allows users to explore the data
and analysis results in detail.
- **Sharing results** - Spyglass enables sharing of data and analysis results
via [Kachery](https://github.com/flatironinstitute/kachery-cloud), a
decentralized content addressable data sharing platform. Kachery Cloud
allows users to access the database and pull data and analysis results
directly to their local machine.
- **Pipeline versioning** - Processing and analysis of data in neuroscience is
often dynamic, requiring new features. Spyglass uses *Merge tables* to
ensure that analysis pipelines can be versioned. This allows users to easily
use and compare results from different versions of the analysis pipeline
while retaining the ability to access previously generated results.
- **Cautious Delete** - Spyglass uses a `cautious delete` feature to ensure that
data is not accidentally deleted by other users. When a user deletes data,
Spyglass will first check to see if the data belongs to another team of
users. This enables teams of users to work collaboratively on the same
database without worrying about accidentally deleting each other's data.

## Getting Started

Expand Down
61 changes: 32 additions & 29 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pip install spikeinterface[full,widgets]
pip install mountainsort4
```

WARNING: If you are on an M1 Mac, you need to install `pyfftw` via `conda`
__WARNING:__ If you are on an M1 Mac, you need to install `pyfftw` via `conda`
BEFORE installing `ghostipy`:

```bash
Expand All @@ -49,40 +49,30 @@ additional details, see the

#### Via File (Recommended)

A `dj_local_conf.json` file in your Spyglass directory (or wherever python is
launched) can hold all the specifics needed to connect to a database. This can
include different directories for different pipelines. If only the `base` is
specified, the subfolder names below are included as defaults.

```json
{
"custom": {
"database.prefix": "username_",
"spyglass_dirs": {
"base": "/your/base/path",
"raw": "/your/base/path/raw",
"analysis": "/your/base/path/analysis",
"recording": "/your/base/path/recording",
"spike_sorting_storage": "/your/base/path/spikesorting",
"waveforms": "/your/base/path/waveforms",
"temp": "/your/base/path/tmp"
}
}
}
```

`dj_local_conf_example.json` can be copied and saved as `dj_local_conf.json` to
set the configuration for a given folder. Alternatively, it can be saved as
`.datajoint_config.json` in a user's home directory to be accessed globally. See
A `dj_local_conf.json` file in your current directory when launching python can
hold all the specifics needed to connect to a database. This can include
different directories for different pipelines. If only the Spyglass `base` is
specified, other subfolder names are assumed from defaults. See
`dj_local_conf_example.json` for the full set of options. This example can be
copied and saved as `dj_local_conf.json` to set the configuration for a given
folder. Alternatively, it can be saved as `.datajoint_config.json` in a user's
home directory to be accessed globally. See
[DataJoint docs](https://datajoint.com/docs/core/datajoint-python/0.14/quick-start/#connection)
for more details.

Note that raw and analysis folder locations should be specified under both
`stores` and `custom` sections of the config file. The `stores` section is used
by DataJoint to store the location of files referenced in database, while the
`custom` section is used by Spyglass. Spyglass will check that these sections
match on startup.

#### Via Environment Variables

Older versions of Spyglass relied exclusively on environment for config. If
`spyglass_dirs` is not found in the config file, Spyglass will look for
environment variables. These can be set either once in a terminal session, or
permanently in a `.bashrc` file.
permanently in a unix settings file (e.g., `.bashrc` or `.bash_profile`) in your
home directory.

```bash
export SPYGLASS_BASE_DIR="/stelmo/nwb"
Expand All @@ -102,14 +92,21 @@ A temporary directory will speed up spike sorting. If unspecified by either
method above, it will be assumed as a `tmp` subfolder relative to the base path.
Be sure it has enough free space (ideally at least 500GB).

#### Subfolders

If subfolders do not exist, they will be created automatically. If unspecified
by either method above, they will be assumed as `recording`, `sorting`, `video`,
etc. subfolders relative to the base path.

## File manager

[`kachery-cloud`](https://github.com/flatironinstitute/kachery-cloud) is a file
manager for Frank Lab collaborators who do not have access to the lab's
production database.

To customize `kachery` file paths, the following can similarly be pasted into
your `.bashrc`. If unspecified, the defaults below are assumed.
To customize `kachery` file paths, see `dj_local_conf_example.json` or set the
following variables in your unix settings file (e.g., `.bashrc`). If
unspecified, the defaults below are assumed.

```bash
export KACHERY_CLOUD_DIR="$SPYGLASS_BASE_DIR/.kachery-cloud"
Expand All @@ -122,3 +119,9 @@ Be sure to load these with `source ~/.bashrc` to persist changes.

Finally, open up a python console (e.g., run `ipython` from terminal) and import
`spyglass` to check that the installation has worked.

```python
from spyglass.common import Nwbfile

Nwbfile()
```
Loading
Loading