AllenInstitute / AllenInstitute/bmtk
Getting wrong resting potential in cell models from Allen Brain Atlas
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 335
- Forks
- 102
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 6
Description
Hi,
I'm sorry if this is the wrong place to post this problem.
I'm trying to reproduce the Model Response of this cell:
http://celltypes.brain-map.org/experiment/electrophysiology/490387590
I have downloaded the model, and I try to run it in BMTK, using the code below.
("fit_parameters.json", and "reconstruction.swc" were put in the folders where BMTK seemed to expect to find them)
In general, the results look good, and the simulated cell-behavior seems reasonable, except that the resting potential is very different. In my attempted recreation, the resting potential is -93 mV (which seems very low), while on the web page it seems it should be about -79 mV? I noticed that this difference, -14 mV, exactly equals the given 'junction_potential' in 'fit_parameters.json', but presumably I should not have to correct for the liquid junction potential in the simulations?
Any idea about what could be causing this?
'''
from bmtk.builder.networks import NetworkBuilder
net = NetworkBuilder("mcortex")
net.add_nodes(cell_name="491623973",
potental="exc",
model_type="biophysical",
model_template="ctdb:Biophys1.hoc",
model_processing="aibs_perisomatic",
dynamics_params="fit_parameters.json",
morphology="reconstruction.swc")
net.build()
net.save_nodes(output_dir="network")
for node in net.nodes():
print(node)
from bmtk.utils.sim_setup import build_env_bionet
build_env_bionet(base_dir="neuronal_model", # Where to save the scripts and config files
network_dir="network", # Location of directory containing network files
tstop=1200.0, dt=0.1, # Run a simulation for 2000 ms at 0.1 ms intervals
report_vars=["v"], # Tells simulator we want to record membrane potential and calcium traces
current_clamp={ # Creates a step current from 500.ms to 1500.0 ms
"amp": 0.61,
"delay": 100.0,
"duration":
1000.0
},
include_examples=False, # Copies components files
compile_mechanisms=False # Will try to compile NEURON mechanisms
)
from bmtk.simulator import bionet
conf = bionet.Config.from_json("neuronal_model/simulation_config.json")
conf.build_env()
net = bionet.BioNetwork.from_config(conf)
sim = bionet.BioSimulator.from_config(conf, network=net)
sim.run()
from bmtk.analyzer.spike_trains import to_dataframe
to_dataframe(config_file="neuronal_model/simulation_config.json")
from bmtk.analyzer.cell_vars import plot_report
plot_report(config_file="neuronal_model/simulation_config.json")
'''
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the BMTK setup in the posted Python script, especially dynamics_params, model_template, and model_processing, alongside fit_parameters.json and reconstruction.swc. Run the supplied reproduction and compare its resting potential with the Allen Brain Atlas result. Done means identifying and documenting the source of the 14 mV discrepancy, with a reproducible explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100