Page 1 of 1

Code for Lists of Synaptic Connections

Posted: Mon Oct 24, 2005 4:35 pm
by johnawolf
Hi all,

Does anyone (Bill?) have a chunk of code that does a nice job of displaying all the NetCons in a network sorted by either precell or postcell? We are having problems printing the contents of netconlist...



Posted: Tue Oct 25, 2005 6:47 pm
by ted
Assuming you have a List of all cells in your network, why not do something like this:

Code: Select all

// allcells is a List of all cells in the net
objref ncs_by_pre, ncs_by_post, tmplist
ncs_by_pre = new List()
ncs_by_post = new List()
// element ii of ncs_by_pre will be a List of netcons whose source is allcells.object(ii)
for ii = 0, allcells.count()-1 {
  tmplist = cvode.netconlist(allcells.object(ii), "", ""))
  tmplist = cvode.netconlist("", allcells.object(ii), ""))
for ii = 0, allcells.count()-1 {
  print allcells.object(ii), " is a source for"
  for jj = 0, ncs_by_pre.object(jj).count()-1 print ncs_by_pre.object(jj)
  print "and receives afferent streams via"
  for jj = 0, ncs_by_post.object(jj).count()-1 print ncs_by_post.object(jj)
  print ""
I haven't tested this, but barring a typo it should work--although its output will be ugly.

network organziation

Posted: Fri Oct 28, 2005 11:08 am
by wwlytton
I go in the other direction -- I put the network together in a database and then use this to view and manipulate connectivity -- then I load the db into neuron

alternatively I do have some code that reads out of cvode.netconlist to produce the database

however you mentioned that you are having some trouble with netconlist() -- maybe this is the place to start -- what kind of trouble?