Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

How to resolve SomaError #80

@riddick-the-furyan

Description

@riddick-the-furyan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions