Code Monkey home page Code Monkey logo

ndx-simulation-output's Introduction

ndx-simulation-output Extension for NWB

An extension for output data of large-scale simulations

This extension defines two NWB neuorodata_types, CompartmentSeries and Compartments. CompartmentSeries stores continuous data (e.g. membrane potential, calcium concentration) from many compartments of many cells, and scales to hundreds of thousands of compartments. Compartments stores the meta-data associated with those compartments, and is stored in SimulationMetaData. Collaboration with Stanford University and the Allen Institute. Funded by the Ripple U19.

Image of CompartmentSeries

Guide

python

installation

pip install ndx-simulation-output

usage

from pynwb import NWBHDF5IO, NWBFile
from datetime import datetime
from ndx_simulation_output import CompartmentSeries, Compartments, SimulationMetaData
import numpy as np


compartments = Compartments()
compartments.add_row(number=[0, 1, 2, 3, 4], position=[0.1, 0.2, 0.3, 0.4, 0.5])
compartments.add_row(number=[0], position=[np.nan])

nwbfile = NWBFile('description', 'id', datetime.now().astimezone())

nwbfile.add_lab_meta_data(SimulationMetaData(compartments=compartments))
cs = CompartmentSeries('membrane_potential', np.random.randn(10, 6),
                       compartments=compartments, unit='V', rate=100.)
nwbfile.add_acquisition(cs)

with NWBHDF5IO('test_compartment_series.nwb', 'w') as io:
    io.write(nwbfile)

conversion from SONTATA:

from ndx_simulation_output.io.from_sonata import sonata2nwb
sonata2nwb('path_to_data_dir', 'nwb_path')

from ndx_simulation_output.io.to_sonata import nwb2sonata
nwb2sonata('nwb_path', 'data_dir2')

MATLAB

installation

command line:

git clone https://github.com/bendichter/ndx-simulation-output.git

in matlab:

generateExtension('/path/to/ndx-simulation-output/spec/ndx-simulation-output.namespace.yaml');

usage

nwb = nwbfile()

[number, number_index] = util.create_indexed_column( ...
    {[0, 1, 2, 3, 4], 0}, '/acquisition/compartments/number');

[position, position_index] = util.create_indexed_column( ...
    {[0.1, 0.2, 0.3, 0.4, 0.5], 0}, '/acquisition/compartments/position');

compartments = types.ndx_simulation_output.Compartments( ...
    'colnames', {'number', 'position'}, ...
    'description', 'membrane potential from various compartments', ...
    'id', types.core.ElementIdentifiers('data', int64(0:5)));

compartments.position = position;
compartments.position_index = position_index;
compartments.number = number;
compartments.number_index = number_index;

membrane_potential = types.ndx_simulation_output.CompartmentSeries( ...
    'data', randn(10,6), ...
    'compartments', types.untyped.SoftLink('/acquisition/compartments'), ...
    'data_unit', 'V', ...
    'starting_time_rate', 100., ...
    'starting_time', 0.0);
    
simulation = types.ndx_simulation_output.SimulationMetaData('compartments', compartments);
    
nwb.general.set('simulation', simulation);

nwb.acquisition.set('membrane_potential', membrane_potential);

Community engagement

Talks

Ben Dichter*, Kael Dai*, Aaron Milstein, Yazan Billeh, Andrew Tritt, Jean-Christophe Fillion-Robin, Anton Akhipov, Oliver Ruebel, Nicholas Cain, Kristofer Bouchard, Ivan Soltesz. NWB extension for storing results of large-scale neural network simulations. NeuroInformatics. Montreal, Canada (2018). video.

Cited by

Dai K, Hernando J, Billeh YN, Gratiy SL, Planas J, et al. (2020) The SONATA data format for efficient description of large-scale network models. PLOS Computational Biology 16(2): e1007696. https://doi.org/10.1371/journal.pcbi.1007696

Credits

Developed in collaboration between the Soltesz lab and the Allen Institute during NWB Hackathon #4 by Ben Dichter*, Kael Dai*, Aaron Milstein, Yazan Billeh, Andrew Tritt, Jean-Christophe Fillion-Robin, Anton Akhipov, Oliver Ruebel, Nicholas Cain, Kristofer Bouchard, and Ivan Soltesz

ndx-simulation-output's People

Contributors

bendichter avatar kaeldai avatar rly avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ndx-simulation-output's Issues

link from CompartmentSeries to Compartments should be a table reference

Using a dynamic table reference instead of a link to the table will allow you to:

  • provide meta-data for compartments without needing to provide all of the data for all of those compartments
  • have different types of data associated with different compartments without duplicating the compartments table

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.