AllenInstitute / AllenInstitute/bmtk
Problem with adding cells that do not have a morphology file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 335
- Forks
- 102
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 6
Description
Currently, the only way to create a cell without a morphology file that I can find is to use morphology=None in add_nodes. This does not create a visible issue when running most simulations, but a bug is uncovered when reporting ecp.
The bug is in make_morphologies: https://github.com/AllenInstitute/bmtk/blob/85e8aa22b630c24e52d7452ef73f99331fb6330a/bmtk/simulator/bionet/bionetwork.py#L188-L217
The issue is that there is a morphology cache that uses morphology_file as a key. Therefore, if multiple types of cells were created without a morphology file (meaning they all used morphology=None), they will all be assigned the same morphology (from whichever cell type was added first).
This bug is uncovered on line 206 of ecp.py:
https://github.com/AllenInstitute/bmtk/blob/85e8aa22b630c24e52d7452ef73f99331fb6330a/bmtk/simulator/bionet/modules/ecp.py#L206
It is caused by the fact that tr gets its second dimension from the number of segments in the morphology object assigned to the cell, where as im gets its length from the actual counted number of segments in the cell's hobj.
I am not sure of the implications this bug has on the overall simulation results, but it atleast stops ecp reporting from working if a cell is added without a morphology file.
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 in bmtk/simulator/bionet/bionetwork.py at make_morphologies and inspect the morphology cache behavior for cells created with morphology=None. Then read bmtk/simulator/bionet/modules/ecp.py around line 206 and reproduce ECP reporting with multiple cell types lacking morphology files. Done means ECP reporting no longer fails because the morphology and counted segment dimensions disagree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100