Skip to content
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

Cannot make a model a "target" into a NEURON network #10

Open
SteMasoli opened this issue Jun 23, 2019 · 5 comments
Open

Cannot make a model a "target" into a NEURON network #10

SteMasoli opened this issue Jun 23, 2019 · 5 comments

Comments

@SteMasoli
Copy link

Hi.

I have used your code, for the past year, without issues.

Now I'm trying to make a small scale network using PyNeuron-Toolbox to load the morphology of a model. I can correctly simulate, stimulate and record the cell in the network, but when i define it as a target for other cells, NEURONS replayed with a "NoneType".

I have tried the same code with another model, with a "built in" morphology, and everything is fine.

cell = self, which is critical, is present. Maybe defining self.soma[0] causes the issue but i cannot change it back to a classic self.soma.

@ahwillia
Copy link
Owner

ahwillia commented Jun 23, 2019 via email

@ramcdougal
Copy link
Contributor

ramcdougal commented Jun 24, 2019

Can you clarify what you mean by "NEURONS replayed with a 'NoneType'"?

Note that NEURON 7.5 and later (current version is 7.7) directly support instantiating a morphology in a Python cell class; an example method follows:

def load_morphology(self):
    h.load_file('stdlib.hoc') 
    h.load_file('import3d.hoc')
    cell = h.Import3d_SWC_read()
    cell.input('c91662.swc')  # or put whatever morphology file you want here
    i3d = h.Import3d_GUI(cell, 0)
    i3d.instantiate(self)

(The above is for SWC files. Other morphology file formats work with the appropriate reader class: Import3d_SWC_read for swc, Import3d_Neurolucida3 for Neurolucida V3, Import3d_MorphML for MorphML (level 1 of NeuroML), or Import3d_Eutectic_read for Eutectic.)

@SteMasoli
Copy link
Author

Hi.
The following code check the existence of the cell GID and target.

if self.pc.gid_exists(tgt_gid):
    print self.pc.gid_exists(tgt_gid)
    target = self.pc.gid2cell(tgt_gid)
    print target

If i load the model using PyNeuron-Toolbox:
gid_exists is correctly 3 but "target" replays with "None".
Then "AttributeError: 'NoneType' object has no attribute 'L_PF'" - L_PF is the name of the list with the synapses.

Trying with your code @ramcdougal, without changing anything else, self.soma[0] included:
gid_exists is correctly 3 and reports <model_net.Model_net instance at 0x7fcb27046248>
The connection is made and works.

Thank you.
Best

@ramcdougal
Copy link
Contributor

I'm glad that solution worked for you.

I believe the problem you ran into is that this code wasn't associating sections with cell objects. Can you see if the change at

36ada2d

fixes your original problem?

Thank you.

@SteMasoli
Copy link
Author

if the change at

36ada2d

fixes your original problem?

Yes, it solved the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants