-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BBPBGLIB-1059] Integrate Oren's gap junction compensation procedure into neurodamus #195
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tests/scientific/test_simulation.py
Outdated
"load_g_pas_file": "/gpfs/bbp.cscs.ch/project/proj55/amsalem/gap_junctions/circ19_11_2019_gjs_19_20_20/rm_correction/Circ_mc2_Rt_Remove_ch_all_Det_stoch_True_Dis_holding_False_Correc_type_impedance_tool_Cm0p01_Num_iter_10/num_0/g_pas_passive.hdf5", # noqa | ||
"manual_MEComboInfo_file": "/gpfs/bbp.cscs.ch/project/proj55/amsalem/gap_junctions/circ19_11_2019_gjs_19_20_20_new_holding/find_holding_current/vc_ampFile/Circ_mc2_Rt_Remove_ch_none_Det_stoch_True_Dis_holding_False_gjc0p2_Change_mecomb_False_manual_MEComboInfoFile_False_Load_g_pas_True_Correc_iter_loadlast/num_0/holding_per_gid.hdf5" # noqa | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WeinaJi : Just a comment: at a minimum, we should move this to proj12?
In general, as we want to move the CI out of gitlab / BB5 very soon, it would be good to have tests that are not dependent on BB5/GitLab. Because very soon, we need to work on removing gitlab dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was my comment also, would be nice to avoid depending on bb5 for the tests...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure, for this test I will create small, local and dummy calibration files to read as I am not test the final results.
General comment: |
Hi @WeinaJi I think it looks good, but is there a way to test it? |
Very cool, a bit off-topic, but there is also the code that generates the GJs and use them. I'll try to get it on github and we can refer to it. |
Thinking about the time left, I am inclined to merge them in |
Hello @orena1 , can you access our
The config file
An example from my test config file Also cc @PolinaL |
That will be great. Please let me know if you would like to push something in this repo. I can give you the write permission. In fact, I have another version of your script which includes these commented code:
Is it still needed? I can't find the script |
a395192
to
94aad9e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks, but it might be worth to a wider round of checks for naming and other small inconsistencies. vars starting in upcase remember class variables or constants
neurodamus/gap_junction.py
Outdated
@@ -66,6 +69,8 @@ def __init__(self, gj_conf, target_manager, cell_manager, src_cell_manager=None, | |||
super().__init__(gj_conf, target_manager, cell_manager, src_cell_manager, **kw) | |||
self._src_target_filter = target_manager.get_target(cell_manager.circuit_target, | |||
src_cell_manager.population_name) | |||
self.holding_ic_per_gid = None | |||
self.SEClamp_current_per_gid = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally nitpick, sorry, but would it be too bad to adhere to normal lowercase?
self.SEClamp_current_per_gid = None | |
self.seclamp_current_per_gid = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
neurodamus/gap_junction.py
Outdated
if self.cell_manager.population_name == \ | ||
SimConfig.beta_features.get("gapjunction_target_population"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just another style nitpick 🙈
if self.cell_manager.population_name == \ | |
SimConfig.beta_features.get("gapjunction_target_population"): | |
gj_target_pop = SimConfig.beta_features.get("gapjunction_target_population") | |
if self.cell_manager.population_name == gj_target_pop: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done!
neurodamus/gj_user_corrections.py
Outdated
Mechanisims = [] | ||
if remove_channels == 'all': | ||
Mechanisims = non_stochastic_mechs + stochastic_mechs | ||
if remove_channels == 'only_stoch': | ||
Mechanisims = stochastic_mechs | ||
if remove_channels == 'only_non_stoch': | ||
Mechanisims = non_stochastic_mechs | ||
if remove_channels: | ||
logging.info("Removing channels type = " + remove_channels) | ||
_perform_remove_channels(node_manager, Mechanisims) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary checks, var naming typos, missing warning
Mechanisims = [] | |
if remove_channels == 'all': | |
Mechanisims = non_stochastic_mechs + stochastic_mechs | |
if remove_channels == 'only_stoch': | |
Mechanisims = stochastic_mechs | |
if remove_channels == 'only_non_stoch': | |
Mechanisims = non_stochastic_mechs | |
if remove_channels: | |
logging.info("Removing channels type = " + remove_channels) | |
_perform_remove_channels(node_manager, Mechanisims) | |
if remove_channels: | |
if remove_channels == 'all': | |
rm_mechanisms = non_stochastic_mechs + stochastic_mechs | |
elif remove_channels == 'only_stoch': | |
rm_mechanisms = stochastic_mechs | |
elif remove_channels == 'only_non_stoch': | |
rm_mechanisms = non_stochastic_mechs | |
else: | |
logging.warning("Unknown GJ remove_channels setting: %s", remove_channels) | |
rm_mechanisms = [] | |
logging.info("Removing channels type = " + remove_channels) | |
_perform_remove_channels(node_manager, rm_mechanisms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This comment has been minimized.
This comment has been minimized.
Logfiles from GitLab pipeline #236165 (:white_check_mark:) have been uploaded here! Status and direct links: |
Hello @orena1, have you managed to test this branch on bb5? Or would you like to add your code in it? |
Context
Integrate Oren's compensation script for gap junction synapses into the neurodamus main flow. Uses are expected to use predefined parameters in the SONATA simulation config files to configure the correction steps and values. In this PR, those parameters are stored in the experimental "beta_features" section of the SONATA config files. The corresponding formal SONATA parameters are to be determined in the SONATA specifications, the libsonata parser, and the future PR in neurodamus.
Scope
At the
finalize
step forGapJunctionManager
, if users set the rightgapjunction_target_population
, the user corrections defined in the new filegj_user_functions.py
will be triggered. This file is implemented based on Oren's script which was used for Elisabetta's publication (/gpfs/bbp.cscs.ch/project/proj55/software/gap_junctions/pylibs/manager_python.py
). It provides these corrections to be enabled by users via the SONATA simulation config file:"determanisitc_stoch"
"gjc"
"remove_channels"
g_pas
to fit thegjc
with values set by the calibration file given in the simulation config file"load_g_pas_file"
"manual_MEComboInfo_file"
"vc_amp"
and meanwhile save the SEClamp DataThose SONATA parameters are chosen based on the setting in Elisabetta's publication
/gpfs/bbp.cscs.ch/project/proj55/iavarone/releases/simulations/spontaneous_evoked/CorrectCTFiberAll_Backgroundwith_afferents_MLNoise25_CTNoise4/MLStim4/MLNoise0/CTNoise0/settings.p
for which corrections 1,2,4,5 were used.Testing
New test
test_v5_gap_junction_corrections
intest/scientific/test_simulation.py
Review