bluepyemodel.emodel_pipeline.plotting_utils¶
Plotting utils functions.
Functions
|
Put x and y into bins. |
|
Create a new protocol with adjusted stimulus amplitude based on a threshold. |
Get experimental data to be plotted for IV curve from bluepyefe cells. |
|
|
Returns a copy of the evaluator, with missing features added for IV_curve computation. |
|
|
Get experimental FI curve data used in plotting. |
|
|
Get impedance for plotting. |
Get responses keys (also filename strings) ordered by protocols and locations. |
|
|
Retrieve the protocol name as defined by the user, preserving the original case |
|
Get recording names which traces are to be plotted. |
Get FI curve data from model used in plotting. |
|
|
Returns evaluator with pre-protocols (if threshold based) and sinespec protocol and impedance feature. |
|
Returns 'emodel ; iteration={iteration} ; seed={seed}' |
Extract the names of the traces to be plotted, as well as the float responses values. |
|
|
Get ylabel for traces subplot. |
|
Get time, voltage, currents and ionic concentrations from output files |
|
Plot and save the FI curves. |
|
Converts relative amplitude to absolute amplitude. |
|
Save a matplotlib figure |
|
update evaluator with new simulation protocols. |
- binning(x, y, n_bin=5)¶
Put x and y into bins. Returns the binned x, binned y and std of binned y.
- create_protocol(amp_rel, amp, feature, protocol, protocol_name)¶
Create a new protocol with adjusted stimulus amplitude based on a threshold.
- Parameters:
amp_rel (float) – Relative amplitude as a percentage of the threshold current.
amp (float) – Absolute amplitude to use for recalculating the stimulus amplitude.
feature (eFELFeatureBPEM, optional) – Feature object used to retrieve the threshold
scaling. (current for)
protocol (BPEMProtocol) – The original protocol to modify.
protocol_name (str) – Name for the new protocol.
- Returns:
A new protocol object with the adjusted threshold-based stimulus amplitude.
- Return type:
- extract_experimental_data_for_IV_curve(cells, efel_settings, prot_name='iv', n_bin=5)¶
Get experimental data to be plotted for IV curve from bluepyefe cells. Use efel to extract missing features.
- fill_in_IV_curve_evaluator(evaluator, efel_settings, prot_name='iv', new_amps=None)¶
Returns a copy of the evaluator, with missing features added for IV_curve computation.
- get_experimental_FI_curve_for_plotting(cells, prot_name, n_bin=5)¶
Get experimental FI curve data used in plotting.
- get_impedance(time, voltage, current, stim_start, stim_end, efel_settings)¶
Get impedance for plotting.
- get_ordered_currentscape_keys(keys)¶
Get responses keys (also filename strings) ordered by protocols and locations.
- Parameters:
keys (list of str) – list of responses keys (or filename stems). Each item should have the shape protocol.location.current
- Returns:
- containing voltage key, ion current and ionic concentration keys,
and ion current and ionic concentration names. Should have the shape:
{ "protocol_name": { "loc_name": { "voltage_key": str, "current_keys": [], "current_names": [], "ion_conc_keys": [], "ion_conc_names": [], } } }
- Return type:
- get_original_protocol_name(prot_name, evaluator)¶
Retrieve the protocol name as defined by the user, preserving the original case
- get_recording_names(protocol_config, stimuli)¶
Get recording names which traces are to be plotted.
Does not return extra ion / current recordings.
- get_simulated_FI_curve_for_plotting(evaluator, responses, prot_name)¶
Get FI curve data from model used in plotting.
- get_sinespec_evaluator(evaluator, sinespec_settings, efel_settings)¶
Returns evaluator with pre-protocols (if threshold based) and sinespec protocol and impedance feature.
- Parameters:
evaluator (CellEvaluator) – cell evaluator
sinespec_settings (dict) – contains amplitude settings for the SineSpec protocol, with keys ‘amp’ and ‘threshold_based’. ‘amp’ should be in percentage of threshold if ‘threshold_based’ is True, e.g. 150, or in nA if ‘threshold_based’ if false, e.g. 0.1.
efel_settings (dict) – eFEL settings in the form {setting_name: setting_value}
- get_title(emodel, iteration, seed)¶
Returns ‘emodel ; iteration={iteration} ; seed={seed}’
- get_traces_names_and_float_responses(responses, recording_names)¶
Extract the names of the traces to be plotted, as well as the float responses values.
- get_traces_ylabel(var)¶
Get ylabel for traces subplot.
- get_voltage_currents_from_files(key_dict, output_dir)¶
Get time, voltage, currents and ionic concentrations from output files
- plot_fi_curves(expt_data, sim_data, figures_dir, emodel, write_fig)¶
Plot and save the FI curves.
- rel_to_abs_amplitude(rel_amp, responses)¶
Converts relative amplitude to absolute amplitude.
- save_fig(figures_dir, figure_name, dpi=100)¶
Save a matplotlib figure
- update_evaluator(expt_amp_rel, prot_name, evaluator)¶
update evaluator with new simulation protocols.