neuronunit package¶
Subpackages¶
- neuronunit.capabilities package
- neuronunit.models package
- Subpackages
- neuronunit.models.backends package
- Submodules
- neuronunit.models.backends.base module
- neuronunit.models.backends.brian_multi_comp_ca2_HH module
- neuronunit.models.backends.fhn module
- neuronunit.models.backends.general_pyNN module
- neuronunit.models.backends.geppetto module
- neuronunit.models.backends.glif module
- neuronunit.models.backends.hhrawf module
- neuronunit.models.backends.jNeuroML module
- neuronunit.models.backends.neuron module
- neuronunit.models.backends.parse_glif module
- neuronunit.models.backends.rawpy module
- Module contents
- neuronunit.models.backends package
- Submodules
- neuronunit.models.bindings module
- neuronunit.models.channel module
- neuronunit.models.lems module
- neuronunit.models.morphology module
- neuronunit.models.reduced module
- neuronunit.models.section_extension module
- neuronunit.models.static module
- neuronunit.models.very_reduced module
- Module contents
- Subpackages
- neuronunit.neuroconstruct package
- neuronunit.optimization package
- Submodules
- neuronunit.optimization.algorithms module
- neuronunit.optimization.bp_opt module
- neuronunit.optimization.covariance_adaption_approach module
- neuronunit.optimization.data_transport_container module
- neuronunit.optimization.exhaustive_search module
- neuronunit.optimization.get_neab module
- neuronunit.optimization.model_parameters module
- neuronunit.optimization.opt_man module
- neuronunit.optimization.optimization_management module
- neuronunit.optimization.results_analysis module
- Module contents
- neuronunit.tests package
Submodules¶
neuronunit.aibs module¶
NeuronUnit module for interaction with the AIBS Cell Types Database.
-
neuronunit.aibs.
get_observation
(dataset_id, kind, cached=True, quiet=False)[source]¶ Get an observation.
Get an observation of kind ‘kind’ from the dataset with id ‘dataset_id’. optionally using the cached value retrieved previously.
-
neuronunit.aibs.
get_sp
(experiment_params, sweep_ids)[source]¶ Get sweep parameters.
A candidate method for replacing ‘get_sweep_params’. This fix is necessary due to changes in the allensdk. Warning: This method may not properly convey the original meaning of ‘get_sweep_params’.
-
neuronunit.aibs.
get_sweep_params
(dataset_id, sweep_id)[source]¶ Get sweep parameters.
Get those corresponding to the sweep with id ‘sweep_id’ from the dataset with id ‘dataset_id’.
-
neuronunit.aibs.
get_value_dict
(experiment_params, sweep_ids, kind)[source]¶ Get a dictionary of data values from the experiment.
A candidate method for replacing ‘get_observation’. This fix is necessary due to changes in the allensdk. Warning: Together with ‘get_sp’ this method may not properly convey the meaning of ‘get_observation’.
neuronunit.bbp module¶
NeuronUnit module for interaction with the Blue Brain Project data.
-
neuronunit.bbp.
find_or_download_data
(url)[source]¶ Find or download data from the given URL.
Return a path to a local directory containing the unzipped data found at the provided url. The zipped file will be downloaded and unzipped if the directory cannot be found. The path to the directory is returned.
-
neuronunit.bbp.
find_sweeps
(path, extension='.ibw', depth=0)[source]¶ Find sweeps available at the given path.
Starting from ‘path’, recursively searches subdirectories and returns full paths to all files ending with ‘extension’.
-
neuronunit.bbp.
get_curated_data
(data_id, sweeps=None)[source]¶ Download curated data (Igor files) from the microcircuit portal.
data_id: An ID number like the ones in ‘list_curated_data()’ that appears in http://microcircuits.epfl.ch/#/article/article_4_eph.
-
neuronunit.bbp.
get_uncurated_data
(data_id, sweeps=None)[source]¶ Download uncurated data (Igor files) from the microcircuit portal.
-
neuronunit.bbp.
list_curated_data
()[source]¶ List all curated datasets as of July 1st, 2017.
Includes those found at http://microcircuits.epfl.ch/#/article/article_4_eph
-
neuronunit.bbp.
list_sweeps
(url, extension='.ibw')[source]¶ List all sweeps available in the file at the given URL.
neuronunit.cellmodelp module¶
-
class
neuronunit.cellmodelp.
CellModel
(*args, **kwargs)[source]¶ Bases:
object
-
find_border
(lowerLevel, upperLevel, current_delay, current_duration, run_for_after_delay, test_condition, max_iterations, fig_file, skip_current_delay=False, on_unstable=None, test_early=False)[source]¶
-
get_arb_current_response
(delay, duration, get_current_ti, post_delay=0, test_condition=None, restore_state=False, dt=None, sampling_period=None)[source]¶
-
get_ramp_response
(ramp_delay, ramp_max_duration, ramp_increase_rate_per_second, stop_after_n_spikes_found, restore_state=False)[source]¶
-
save_DRUCKMANN_PROPERTIES
()[source]¶ Tests of features described in Druckmann et. al. 2013 (https://academic.oup.com/cercor/article/23/12/2994/470476)
These tests use SQUARE and LONG_SQUARE waveforms obtained from the NMLDB Web API The waveforms should be uploaded to production server (dendrite) before running these tests. :return: None
-
save_SHORT_SQUARE
()[source]¶ # Short square is a brief, threshold current pulse after steady state :return: None
-
save_SHORT_SQUARE_HOLD
()[source]¶ SHORT_SQUARE_HOLD is a short threshold stimulus, while under bias current :return:
-
save_arb_current
(protocol, delay, duration, get_current_ti, meta_protocol=None, label=None, restore_state=False)[source]¶
-
save_dt_sensitivity_set
(rheobase, protocol='DT_SENSITIVITY', steps_per_ms_set=[1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1], save_max_stable_dt=True)[source]¶ Parameters: - rheobase – Cell rheobase current
- protocol – The label of the protocol to use when saving the waveform to DB
- steps_per_ms_set – A sequence (power of 2 works well to ensure values can be compared at same time points
- save_max_stable_dt – Record the largest dt that does not blow up the simulation
Returns: Nothing
-
save_noise_response_set
(protocol, delay, duration, post_delay, rheobase, noise_pickle_file, multiples, meta_protocol=None, restore_state=False)[source]¶
-
save_square_current_set
(protocol, square_low, square_high, square_steps, delay, duration, post_delay=250)[source]¶
-
neuronunit.neuroelectro module¶
NeuronUnit interface to Neuroelectro.org.
Interface for creating tests using neuroelectro.org as reference data.
Example workflow:
x = NeuroElectroDataMap() x.set_neuron(nlex_id=’nifext_152’) # neurolex.org ID for ‘Amygdala basolateral nucleus pyramidal neuron’. x.set_ephysprop(id=23) # neuroelectro.org ID for ‘Spike width’. x.set_article(pmid=18667618) # Pubmed ID for Fajardo et al, 2008 (J. Neurosci.) x.get_values() # Gets values for spike width from this paper. width = x.val # Spike width reported in that paper.
t = neurounit.tests.SpikeWidthTest(spike_width=width) c = sciunit.Candidate() # Instantiation of your model (or other candidate) c.execute = code_that_runs_your_model result = sciunit.run(t,m) print result.score # # OR # x = NeuroElectroSummary() x.set_neuron(nlex_id=’nifext_152’) # neurolex.org ID for ‘Amygdala basolateral
# nucleus pyramidal neuron’.
x.set_ephysprop(id=2) # neuroelectro.org ID for ‘Spike width’. x.get_values() # Gets values for spike width from this paper. width = x.mean # Mean Spike width reported across all matching papers. …
-
class
neuronunit.neuroelectro.
Article
[source]¶ Bases:
object
Describes a journal article in NeuroElectro.
-
id
= None¶
-
pmid
= None¶
-
-
class
neuronunit.neuroelectro.
EphysProp
[source]¶ Bases:
object
Describes an electrophysiolical property in NeuroElectro.
-
id
= None¶
-
name
= None¶
-
nlex_id
= None¶
-
-
class
neuronunit.neuroelectro.
NeuroElectroData
(neuron=None, ephysprop=None, get_values=False, cached=True)[source]¶ Bases:
object
Abstract class based on neuroelectro.org data using that site’s API.
-
get_json
(params=None, quiet=False)[source]¶ Get JSON data from neuroelectro.org.
Data is based on the currently set neuron and ephys property. Use ‘params’ to constrain the data returned.
-
get_values
(params=None, quiet=False)[source]¶ Get values from neuroelectro.org.
We will use ‘params’ in the future to specify metadata (e.g. temperature) that neuroelectro.org will provide.
-
url
= 'http://neuroelectro.org/api/1/'¶
-
-
class
neuronunit.neuroelectro.
NeuroElectroDataMap
(neuron=None, ephysprop=None, get_values=False, cached=True)[source]¶ Bases:
neuronunit.neuroelectro.NeuroElectroData
Class for getting single reported values from neuroelectro.org.
-
article
= <neuronunit.neuroelectro.Article object>¶
-
get_values
(params=None, quiet=False)[source]¶ Get values from neuroelectro.org.
We will use ‘params’ in the future to specify metadata (e.g. temperature) that neuroelectro.org will provide.
-
require_attrs
= ['val', 'sem']¶
-
url
= 'http://neuroelectro.org/api/1/nedm/'¶
-
-
exception
neuronunit.neuroelectro.
NeuroElectroError
[source]¶ Bases:
Exception
Base class for NeuroElectro errors.
-
class
neuronunit.neuroelectro.
NeuroElectroPooledSummary
(neuron=None, ephysprop=None, get_values=False, cached=True)[source]¶ Bases:
neuronunit.neuroelectro.NeuroElectroDataMap
Class for getting summary values from neuroelectro.org.
Values are computed by pooling each report’s mean and std across reports.
-
class
neuronunit.neuroelectro.
NeuroElectroSummary
(neuron=None, ephysprop=None, get_values=False, cached=True)[source]¶ Bases:
neuronunit.neuroelectro.NeuroElectroData
Class for getting summary values (across reports) from neuroelectro.org.
-
get_values
(params=None, quiet=False)[source]¶ Get values from neuroelectro.org.
We will use ‘params’ in the future to specify metadata (e.g. temperature) that neuroelectro.org will provide.
-
require_attrs
= ['mean', 'std']¶
-
url
= 'http://neuroelectro.org/api/1/nes/'¶
-
neuronunit.neuromldb module¶
neuronunit.plottools module¶
Tools for plotting (contributed by Blue Brain Project)
-
neuronunit.plottools.
best_worst
(history)[source]¶ Query the GA’s DEAP history object to get the best and worst candidates ever evaluated.
inputs DEAP history object best output should be the same as the first index of the ParetoFront list (pf[0]). outputs best and worst candidates evaluated.
-
neuronunit.plottools.
light_palette
(color, n_colors=6, reverse=False, lumlight=0.8, light=None)[source]¶
-
neuronunit.plottools.
not_just_mean
(log, hypervolumes)[source]¶ https://github.com/BlueBrain/BluePyOpt/blob/master/examples/graupnerbrunelstdp/run_fit.py Input: DEAP Plot logbook
Outputs: This method only has side effects, not datatype outputs from the method.
The most important side effect being a plot in png format.
-
neuronunit.plottools.
pca
(best_worst, vmpop, fitnesses, td)[source]¶ Principle Component Analysis. Use PCA to find out which of the model parameters are the most resonsible for causing variations in error/fitness
-
neuronunit.plottools.
plot_log
(log)[source]¶ https://github.com/BlueBrain/BluePyOpt/blob/master/examples/graupnerbrunelstdp/run_fit.py Input: DEAP Plot logbook Outputs: This method only has side effects, not datatype outputs from the method.
The most important side effect being a plot in png format.
-
neuronunit.plottools.
plot_objectives_history
(log)[source]¶ https://github.com/BlueBrain/BluePyOpt/blob/master/examples/graupnerbrunelstdp/run_fit.py Input: DEAP Plot logbook Outputs: This method only has side effects, not datatype outputs from the method.
The most important side effect being a plot in png format.
-
neuronunit.plottools.
plot_surface
(fig_trip, ax_trip, model_param0, model_param1, history)[source]¶ Move this method back to plottools Inputs should be keys, that are parameters see new function definition below
-
neuronunit.plottools.
scatter_surface
(fig_trip, ax_trip, model_param0, model_param1, history)[source]¶ Move this method back to plottools Inputs should be keys, that are parameters see new function definition below
-
neuronunit.plottools.
shadow
(dtcpop, best_vm)[source]¶ A method to plot the best and worst candidate solution waveforms side by side
Inputs: An individual gene from the population that has compound parameters, and a tuple iterator that is a virtual model object containing an appropriate parameter set, zipped togethor with an appropriate rheobase value, that was found in a previous rheobase search.
Outputs: This method only has side effects, not datatype outputs from the method.
The most important side effect being a plot in png format.