Skip to content
Open
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
562 changes: 302 additions & 260 deletions doc/spike-triggered_analysis.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pylabianca/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .data import (
get_data_path, get_fieldtrip_data, get_test_data_link, download_test_data,
create_random_spikes
get_data_path, get_fieldtrip_data, get_fieldtrip_metadata,
get_test_data_link, download_test_data, create_random_spikes
)
from .base import (
_deal_with_picks, _get_trial_boundaries, _get_cellinfo, find_cells,
Expand Down
34 changes: 34 additions & 0 deletions pylabianca/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ def get_data_path():


def get_fieldtrip_data():
"""
Download fieldtrip plexon nex data.
If the data is already downloaded, it will not be downloaded again.

Returns
-------
fname : str
Path to the downloaded file.
"""
import pooch

data_path = get_data_path()
Expand All @@ -30,6 +39,31 @@ def get_fieldtrip_data():
return fname


def get_fieldtrip_metadata():
"""
Download metadata for the fieldtrip plexon nex data.
The metadata table was created based on the events present in the nex file
and information provided in the fieldtrip spike-field tutorial.

Returns
-------
fname : str
Path to the downloaded file.
"""
import pooch

data_path = get_data_path()
file_url = ('https://www.dropbox.com/scl/fi/0snol5gx92kpzm1aqmb6f/monkey'
'_stim.csv?rlkey=pfqcjg2tuaevbfjgntak5r7gm&st=nueys5na&dl=1')
known_hash = ('5d4728fb31d85e4126d0c7b096014ce5c03fe8b30eb26c969948965a'
'a189f668')
fname = pooch.retrieve(
url=file_url, known_hash=known_hash,
fname='monkey_stim.csv', path=data_path
)
return fname


def get_test_data_link():
dropbox_lnk = ('https://www.dropbox.com/scl/fo/757tf3ujqga3sa2qocm4l/h?'
'rlkey=mlz44bcqtg4ds3gsc29b2k62x&dl=1')
Expand Down