https://github.com/alleninstitute/npc_sessions

Tools for accessing and packaging data from behavior and epyhys sessions from the Mindscope Neuropixels team, in the cloud.

https://github.com/alleninstitute/npc_sessions

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 7 committers (42.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.4%) to scientific vocabulary

Keywords from Contributors

interpretability standardization animal hack autograder report
Last synced: 10 months ago · JSON representation

Repository

Tools for accessing and packaging data from behavior and epyhys sessions from the Mindscope Neuropixels team, in the cloud.

Basic Info
  • Host: GitHub
  • Owner: AllenInstitute
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 29.2 MB
Statistics
  • Stars: 2
  • Watchers: 6
  • Forks: 1
  • Open Issues: 53
  • Releases: 0
Created almost 3 years ago · Last pushed 11 months ago
Metadata Files
Readme

README.md

npc_sessions

neuropixels cloud sessions

Tools for accessing data and metadata for behavior and epyhys sessions from the Mindscope Neuropixels team - in the cloud.

PyPI Python version

Coverage CI/CD GitHub issues

quickstart

Make a conda environment with python>=3.9 and simply pip install the npc_sessions package:

bash conda create -n npc_sessions python>=3.9 conda activate npc_sessions pip install npc_sessions

```python

from npcsessions import DynamicRoutingSession, getsessions;

each object is used to get metadata and paths for a session:

session = DynamicRoutingSession('6687552023-08-31')
session.is
ephys
True session.stimpaths[0].stem
'DynamicRouting1
66875520230831131418'

data is processed on-demand to generate individual pynwb modules:

session.subject # doctest: +SKIP subject pynwb.file.Subject at 0x1999418231888 Fields: age: P205D age_reference: birth dateofbirth: 2023-02-06 20:23:02-08:00 genotype: wt/wt sex: M species: Mus musculus strain: C57BL6J(NP) subjectid: 668755

a full NWBFile instance can also be generated with all currently-available data:

session.nwb # doctest: +SKIP root pynwb.file.NWBFile at 0x... Fields: acquisition: { lick spout } devices: { 18005102491 , 18005114452 , 18005123131 , 18194810652 , 19192719021 , 19192719061 } ...

loop over all currently-tracked sessions using the session-generator:

all(s.sessionstarttime.year >= 2022 for s in getsessions()) # doctest: +SKIP True trialsdfs = {} for session in getsessions(): # doctest: +SKIP ... trialsdfs[session.id] = session.trials[:]

```

to develop with conda

To install with the intention of contributing to this package:

1) create a conda environment: bash conda create -n npc_sessions python>=3.9 conda activate npc_sessions 2) clone npcsessions from github: ```bash git clone git@github.com:AllenInstitute/npcsessions.git 3) pip install all dependencies: bash cd npc_sessions pip install -e . ```

Hierarchy of required packages

packages

Current NWB components

key data types

(the following all have a description field, as well as other type-specific attributes)

  • DynamicTable: for general tabular data

    • e.g. nwb.units
    • each column in the table is stored as a vector, which can be accessed individually (fast)
    • can be accessed as a pandas dataframe with nwb.units[:], but requires reading all data in all columns (slow)
    • as well as individual values, cells in the table can contain multidimensional arrays. These are represented differently depending on location:
    • in the pandas dataframe, these are represented as one would expect:
      • nwb.units[:].spike_times.iloc[0] is a 1-D array
      • nwb.units[:].waveform_mean.iloc[0] is a 2-D array (time x channels)
    • in the non-dataframe memory representation, there are sometimes two components, where the *_index is the one that should be used:
      • nwb.units.spike_times is a 1-D array of all spike times for all units, in chronological order (float)
      • nwb.units.spike_times_index is a list (len = num units) of arrays (len = num spikes for each unit)
    • on disk, these columns separated columns are different again, for example:
      • /nwb/units/spike_times is a 1-D array of all spike times for all units, in chronological order (float)
      • /nwb/units/spike_times_index is a 1-D array of values corresponding to the end of each unit's times in /nwb/units/spike_times:
      • the first unit's spike times are in spike_times[: spike_times_index[0]]
      • the second unit's are in spike_times[spike_times_index[0]: spike_times_index[1]]
  • TimeIntervals: for tabular data where each row is an interval of time

    • a subclass of DynamicTable which must have a start_time and stop_time column, plus any other user-defined columns
  • TimeSeries: for general array data

    • has an array of data (1-D or N-D, with time as first dimension)
    • has units as a string
    • has either:
    • timestamps (same length as data)
    • starting_time and rate (assumed to be constant)
  • ElectricalSeries: for ephys array data

    • a subclass of TimeSeries with units fixed as volts
  • Events: an NWB extension for discrete event times

    • like the TimeSeries class, but only has timestamps, without values for data (think: lick times)

  • session metadata (multiple attributes)
  • subject (multiple attributes)
  • devices: DynamicTable
    • physical probes (model, serial number)
    • currently only neuropixels probes
  • electrode_groups: DynamicTable
    • represents the group of channels on one probe inserted in the brain
    • has session-specific info, like position relative to other probes or stereotactic coords
  • electrodes: DynamicTable
    • individual channels on a probe
    • has CCF coords
  • units: DynamicTable

    • metrics, links to electrodes via peak_channel
  • epochs: TimeIntervals

    • start/stop time of each stim block
    • has a list of tags (includes TaskControl subclass name)
  • intervals: Mapping[str, TimeIntervals]

    • 1x table per stim epoch with trials
    • behavior performance table (each block an interval)
  • trials: TimeIntervals

    • same as intervals[DynamicRouting1]
  • invalid_times: TimeIntervals

  • acquisition: Mapping[str, Any] raw data

    • if is_ephys:
    • raw AP: Mapping[str, ElectricalSeries]
    • raw LFP: Mapping[str, ElectricalSeries]
    • if is_sync:
    • licksensorrising_edges: Events
    • licksensorfalling_edges: Events
    • if is_task:
    • rewards: Events
    • if is_video:
    • video frame times: 1x Events per camera
  • processing: Mapping[str, Any] processed/filtered data

    • behavior: Mapping[str, Any]
      • licks: Events
      • from sync or stim file
      • running_speed: TimeSeries
      • from stim file, enhanced with sync info if available
    • ecephys: Mapping[str, Any]
  • analysis: Mapping[str, Any] derived data, results

    • if is_ephys:
    • allspikehistograms: 1x TimeSeries per probe
    • drift_maps: ImageSeries
    • if is_task:
    • performance: TimeIntervals

Todo: - filtered LFP - stimulus templates (vis, aud, opto) - OptogeneticStimulusSite - analysis -> RFMaps - per-unit response metric for each stim modality

Owner

  • Name: Allen Institute
  • Login: AllenInstitute
  • Kind: organization
  • Location: Seattle, WA

Please visit http://alleninstitute.github.io/ for more information.

GitHub Events

Total
  • Issues event: 24
  • Watch event: 1
  • Issue comment event: 9
  • Push event: 72
  • Pull request event: 1
  • Create event: 19
Last Year
  • Issues event: 24
  • Watch event: 1
  • Issue comment event: 9
  • Push event: 72
  • Pull request event: 1
  • Create event: 19

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 1,817
  • Total Committers: 7
  • Avg Commits per committer: 259.571
  • Development Distribution Score (DDS): 0.152
Past Year
  • Commits: 332
  • Committers: 3
  • Avg Commits per committer: 110.667
  • Development Distribution Score (DDS): 0.054
Top Committers
Name Email Commits
bjhardcastle b****e@a****g 1,541
github-actions 4****] 169
arjun.sridhar12345 a****8@g****m 67
egmcbride e****e@g****m 29
Corbett Bennett c****b@a****g 8
Christopher c****m@a****g 2
Sam Gale s****e@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 182
  • Total pull requests: 1
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 6
  • Total pull request authors: 1
  • Average comments per issue: 0.76
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: about 1 month
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bjhardcastle (112)
  • arjunsridhar12345 (7)
  • corbennett (6)
  • egmcbride (4)
  • olsenshawn (2)
  • rcpeene (2)
  • samgale (1)
  • shailajaAkella (1)
Pull Request Authors
  • bjhardcastle (6)
  • mochic (2)
  • egmcbride (1)
  • arjunsridhar12345 (1)
Top Labels
Issue Labels
nwb (9) qc-sprint (7) stalled (6) sync (5) good first issue (4) qc (3) upload (2) enhancement (2) qc fail (1)
Pull Request Labels
tracking (1) enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,288 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 269
  • Total maintainers: 1
pypi.org: npc_sessions

NWB-conversion for behavior and epyhys sessions from the Mindscope Neuropixels team, in the cloud.

  • Versions: 269
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,288 Last month
Rankings
Downloads: 6.9%
Dependent packages count: 7.5%
Forks count: 30.2%
Average: 30.7%
Stargazers count: 39.1%
Dependent repos count: 69.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/publish.yml actions
  • EndBug/add-and-commit v9 composite
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • codecov/codecov-action v3 composite
  • pdm-project/setup-pdm v3 composite
pyproject.toml pypi
  • DynamicRoutingTask >=0.1.14
  • SimpleITK >=2.2.1
  • crc32c >=2.3.post0
  • h5py >=3.9.0
  • ipykernel >=6.25.2
  • ipympl >=0.9.3
  • ipywidgets >=8.1.0
  • matplotlib >=3.7.2
  • ndx-events >=0.2.0
  • npc-lims >=0.1.64
  • numba >=0.57.1
  • nwbwidgets >=0.11.3
  • opencv-python-headless >=4.8.0.76
  • pandas [aws,excel,fss,hdf5,performance,plot]>=1.1.5
  • polars [all]>=0.18.14
  • pyarrow >=13.0.0
  • pynwb >=2.5.0
  • python-dotenv >=1.0.0
  • rich >=13.5.2
  • s3fs >=2023.6.0
  • scipy >=1.9.3
  • spikeinterface >=0.98.2
  • universal-pathlib >=0.1.1
  • wavpack-numcodecs >=0.1.4
  • zarr >=2.16.1
requirements.txt pypi
  • DynamicRoutingTask ==0.1.17
  • SimpleITK ==2.3.0
  • adbc-driver-manager ==0.7.0
  • adbc-driver-sqlite ==0.7.0
  • aind-codeocean-api ==0.2.5
  • aiobotocore ==2.5.4
  • aiohttp ==3.8.5
  • aioitertools ==0.11.0
  • aiosignal ==1.3.1
  • appnope ==0.1.3
  • asciitree ==0.3.3
  • asttokens ==2.4.0
  • async-timeout ==4.0.3
  • attrs ==23.1.0
  • backcall ==0.2.0
  • beautifulsoup4 ==4.12.2
  • bleach ==6.0.0
  • blosc2 ==2.0.0
  • boto3 ==1.28.17
  • botocore ==1.31.17
  • bottleneck ==1.3.7
  • certifi ==2023.7.22
  • cffi ==1.16.0
  • charset-normalizer ==3.2.0
  • cloudpickle ==2.2.1
  • colorama ==0.4.6
  • comm ==0.1.4
  • connectorx ==0.3.2
  • contourpy ==1.1.0
  • crc32c ==2.3.post0
  • cryptography ==41.0.4
  • cycler ==0.12.0
  • cython ==3.0.2
  • debugpy ==1.8.0
  • decorator ==5.1.1
  • defusedxml ==0.7.1
  • deltalake ==0.10.1
  • entrypoints ==0.4
  • et-xmlfile ==1.1.0
  • exceptiongroup ==1.1.3
  • executing ==1.2.0
  • fasteners ==0.19
  • fastjsonschema ==2.18.1
  • fonttools ==4.42.1
  • frozenlist ==1.4.0
  • fsspec ==2023.9.2
  • gevent ==23.9.1
  • greenlet ==3.0.0rc3
  • h5py ==3.9.0
  • hdmf ==3.10.0
  • hdmf-zarr ==0.4.0
  • idna ==3.4
  • importlib-metadata ==4.13.0
  • importlib-resources ==6.1.0
  • ipykernel ==6.25.2
  • ipympl ==0.9.3
  • ipython ==8.15.0
  • ipython-genutils ==0.2.0
  • ipywidgets ==8.1.1
  • jedi ==0.19.0
  • jinja2 ==3.1.2
  • jmespath ==1.0.1
  • joblib ==1.3.2
  • jsonschema ==4.19.1
  • jsonschema-specifications ==2023.7.1
  • jupyter-client ==8.3.1
  • jupyter-core ==5.3.2
  • jupyterlab-pygments ==0.2.2
  • jupyterlab-widgets ==3.0.9
  • kiwisolver ==1.4.5
  • llvmlite ==0.41.0
  • loky ==3.4.1
  • markdown-it-py ==3.0.0
  • markupsafe ==2.1.3
  • matplotlib ==3.8.0
  • matplotlib-inline ==0.1.6
  • mdurl ==0.1.2
  • mistune ==3.0.2
  • msgpack ==1.0.7
  • multidict ==6.0.4
  • nbclient ==0.8.0
  • nbconvert ==7.9.2
  • nbformat ==5.9.2
  • ndx-events ==0.2.0
  • neo ==0.12.0
  • nest-asyncio ==1.5.8
  • npc-lims ==0.1.92
  • npc-session ==0.1.30
  • numba ==0.58.0
  • numcodecs ==0.11.0
  • numexpr ==2.8.7
  • numpy ==1.25.2
  • odfpy ==1.4.1
  • opencv-python-headless ==4.8.1.78
  • openpyxl ==3.1.2
  • packaging ==23.1
  • pandas ==2.1.0
  • pandocfilters ==1.5.0
  • parso ==0.8.3
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • pillow ==10.0.1
  • platformdirs ==3.10.0
  • polars ==0.19.3
  • probeinterface ==0.2.17
  • prompt-toolkit ==3.0.39
  • psutil ==5.9.5
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • py-cpuinfo ==9.0.0
  • pyarrow ==13.0.0
  • pycparser ==2.21
  • pydantic ==1.10.13
  • pydbhub-bjh ==0.0.9
  • pygments ==2.16.1
  • pynwb ==2.5.0
  • pyopenssl ==23.2.0
  • pyparsing ==3.1.1
  • python-dateutil ==2.8.2
  • python-dotenv ==1.0.0
  • pytz ==2023.3.post1
  • pywin32 ==306
  • pyxlsb ==1.0.10
  • pyyaml ==6.0.1
  • pyzmq ==25.1.1
  • quantities ==0.14.1
  • redis ==5.0.1
  • referencing ==0.30.2
  • requests ==2.31.0
  • rich ==13.6.0
  • rpds-py ==0.10.3
  • ruamel-yaml ==0.17.33
  • ruamel-yaml-clib ==0.2.7
  • s3fs ==2023.9.2
  • s3transfer ==0.6.2
  • scipy ==1.9.3
  • setuptools ==68.2.2
  • six ==1.16.0
  • soupsieve ==2.5
  • spikeinterface ==0.98.2
  • sqlalchemy ==2.0.21
  • stack-data ==0.6.2
  • tables ==3.8.0
  • threadpoolctl ==3.2.0
  • tinycss2 ==1.2.1
  • tornado ==6.3.3
  • tqdm ==4.66.1
  • traitlets ==5.9.0
  • typing-extensions ==4.8.0
  • tzdata ==2023.3
  • universal-pathlib ==0.1.3
  • urllib3 ==1.26.16
  • wavpack-numcodecs ==0.1.4
  • wcwidth ==0.2.7
  • webencodings ==0.5.1
  • widgetsnbextension ==4.0.9
  • wrapt ==1.15.0
  • xlrd ==2.0.1
  • xlsx2csv ==0.8.1
  • xlsxwriter ==3.1.5
  • yarl ==1.9.2
  • zarr ==2.16.1
  • zipp ==3.17.0
  • zope-event ==5.0
  • zope-interface ==6.0
.github/workflows/cache_ephys.yml actions
  • actions/checkout v3 composite
  • pdm-project/setup-pdm v3 composite
.github/workflows/cache_training.yml actions
  • actions/checkout v3 composite
  • pdm-project/setup-pdm v3 composite
.github/workflows/qc_notebooks.yml actions
  • actions/checkout v3 composite
  • pdm-project/setup-pdm v3 composite