TMD
TMD copied to clipboard
How to resolve SomaError
I tried extracting input distributions from the files I have and received a SomaError: A soma is already defined. I was wondering how this error could be resolved. I have other files (.swc) in the same folder but only the .asc files give me this issue.
The source code:
import json
from pathlib import Path
import neurots
from neurots import extract_input
def run(distr_dir, params_dir, neuron_dir, data_dir):
for i in range(0,50,1):
"""Run the example for extracting inputs for synthesis."""
# Generate distribution from directory of neurons
distr_name = "test_distr_{}.json".format(i)
params_name = "test_params_{}.json".format(i)
neuron_name = "test_neuron_{}.swc".format(i)
distr = extract_input.distributions(
data_dir / "neurons",
feature="path_distances",
diameter_model="default",
)
if __name__ == "__main__":
data_dir = Path("C:\\Users\\user\\Documents\\Experiment_01\\Data\\Human\\Neocortex_interneurons")
params_dir = Path("C:\\Users\\user\\Documents\\Experiment_01\\Parameters\\Neocortex_interneuron")
distr_dir = Path("C:\\Users\\user\\Documents\\Experiment_01\\Distributions\\Neocortex_interneuron")
neuron_dir = Path("C:\\Users\\user\\Documents\\Experiment_01\\Synthesized\\Neurons\\Neocortex_interneuron")
#result_dir.mkdir(parents=True, exist_ok=True)
run(distr_dir, params_dir, neuron_dir, data_dir)
print("DONE!!!")
Data: Morphologies.zip
Edit: The error occurs in line 166 of io.py