Code for Lists of Synaptic Connections

Moderator: wwlytton

Post Reply
johnawolf
Posts: 7
Joined: Wed Jun 08, 2005 4:48 pm
Location: University of Pennsylvania
Contact:

Code for Lists of Synaptic Connections

Post 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...

TIA,

John
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post 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), "", ""))
  ncs_by_pre.append(tmplist)
  tmplist = cvode.netconlist("", allcells.object(ii), ""))
  ncs_by_post.append(tmplist)
}
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.
wwlytton
Posts: 66
Joined: Wed May 18, 2005 10:37 pm
Contact:

network organziation

Post 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?

Bill
Post Reply