Skip to content

Commit

Permalink
new plotting functions
Browse files Browse the repository at this point in the history
Change-Id: I7c59e356db623239c461a8e4edca184fed0b68e7
  • Loading branch information
Jaquier Aurélien Tristan committed Aug 7, 2024
1 parent 25257ad commit 6e8c396
Show file tree
Hide file tree
Showing 17 changed files with 761 additions and 222 deletions.
2 changes: 1 addition & 1 deletion bluepyemodel/efeatures_extraction/efeatures_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_extraction_output_directory(emodel):
Args:
emodel (str): emodel name as in emodel_metadata.emodel
"""
return f"./figures/{emodel}/efeatures_extraction/"
return pathlib.Path(f"./figures/{emodel}/efeatures_extraction/")


def read_extraction_output(filepath):
Expand Down
2 changes: 2 additions & 0 deletions bluepyemodel/emodel_pipeline/emodel_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,11 @@ def plot(self, only_validated=False, load_from_local=False):
plot_FI_curve_comparison=self.access_point.pipeline_settings.plot_FI_curve_comparison,
plot_phase_plot=self.access_point.pipeline_settings.plot_phase_plot,
plot_traces_comparison=self.access_point.pipeline_settings.plot_traces_comparison,
run_plot_custom_sinspec=self.access_point.pipeline_settings.run_plot_custom_sinspec,
IV_curve_prot_name=self.access_point.pipeline_settings.IV_curve_prot_name,
FI_curve_prot_name=self.access_point.pipeline_settings.FI_curve_prot_name,
phase_plot_settings=self.access_point.pipeline_settings.phase_plot_settings,
sinespec_settings=self.access_point.pipeline_settings.sinespec_settings,
only_validated=only_validated,
save_recordings=self.access_point.pipeline_settings.save_recordings,
load_from_local=load_from_local,
Expand Down
22 changes: 18 additions & 4 deletions bluepyemodel/emodel_pipeline/emodel_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ def __init__(
plot_IV_curves=False,
plot_FI_curve_comparison=False,
plot_traces_comparison=False,
run_plot_custom_sinspec=False,
IV_curve_prot_name="iv",
FI_curve_prot_name="idrest",
plot_phase_plot=False,
phase_plot_settings=None,
sinespec_settings=None,
currentscape_config=None,
save_recordings=False,
neuron_dt=None,
Expand Down Expand Up @@ -273,6 +275,8 @@ def __init__(
plot_traces_comparison (bool): True to plot a new figure with simulated traces
on top of experimental traces.
Needs pickle_cells_extraction to be set to True.
run_plot_custom_sinspec (bool): True to run a SineSpec protocol, and plot
its voltage and current trace, along with its impedance.
IV_curve_prot_name (str): which protocol to use to plot_IV_curves.
FI_curve_prot_name (str): which protocol to use during plotting of FI curve comparison.
The protocol should be supra-threshold
Expand All @@ -287,6 +291,10 @@ def __init__(
recording selection.Is not used for model trace selection
"relative_amp" (bool): Are amplitde and amp_window in relative amplitude (True)
or in absolute amplitude (False).
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.
currentscape_config (dict): currentscape configuration according to the currentscape
documentation (https://github.com/BlueBrain/Currentscape).
Note that current.names, output.savefig, output.fname and output.dir
Expand Down Expand Up @@ -402,10 +410,13 @@ def __init__(
self.plot_traces_comparison = plot_traces_comparison
if pickle_cells_extraction is False:
if any((plot_IV_curves, plot_FI_curve_comparison, plot_traces_comparison)):
logger.warning("You have set pickle_cells_extraction to False in the settings, "
"but plot_IV_curves, plot_FI_curve_comparison and "
"plot_traces_comparison need it to be True. "
"These plots will most likely fail.")
logger.warning(
"You have set pickle_cells_extraction to False in the settings, "
"but plot_IV_curves, plot_FI_curve_comparison and "
"plot_traces_comparison need it to be True. "
"These plots will most likely fail."
)
self.run_plot_custom_sinspec = run_plot_custom_sinspec
self.IV_curve_prot_name = IV_curve_prot_name
self.FI_curve_prot_name = FI_curve_prot_name
self.plot_phase_plot = plot_phase_plot
Expand All @@ -417,6 +428,9 @@ def __init__(
"amp_window": 1.5,
"relative_amp": True,
}
self.sinespec_settings = sinespec_settings
if self.sinespec_settings is None:
self.sinespec_settings = {"amp": 0.05, "threshold_based": False}

# Settings specific to the recordings
self.save_recordings = save_recordings
Expand Down
Loading

0 comments on commit 6e8c396

Please sign in to comment.