objref xo, cellsPerturbFile,synsPerturbFile, cellsPerturb, synsPerturb, vidx, vwgain,vplasttau,vplastinc,vplastmaxw // Initialize things for mist stimuli
/////////////////////////////////////
/// CELL PERTURBATIONS
// Read in perturbations from file
strdef cellsPerturbName, synsPerturbName
cellsPerturbFile = new File()
cellsPerturb = new Vector()
sprint(cellsPerturbName,"stimdata/%s-cellsPerturbed.txt",filestem)
cellsPerturbFile.ropen(cellsPerturbName) // Open file for reading; generated by runpbsbatch_mist_20params.py
if (cellsPerturbFile.isopen()) {
print "Creating cell perturbations..."
while (!cellsPerturbFile.eof()) { // Read from the data file
cellsPerturb.append(cellsPerturbFile.scanvar()) // Read cell
}
cellsPerturbFile.close() // Close the input file
for i=0, cellsPerturb.size()-1 { // Loop through perturbed cells and kill
print "killing cell: ",cellsPerturb.x[i]
col.ce.o(cellsPerturb.x[i]).flag("dead",1)
}
}
/////////////////////////////////////
/// SYNAPSE PERTURBATIONS
synsPerturbFile = new File()
synsPerturb = new Vector()
sprint(synsPerturbName,"stimdata/%s-synsPerturbed.txt",filestem)
synsPerturbFile.ropen(synsPerturbName) // Open file for reading; generated by runpbsbatch_mist_20params.py
if (synsPerturbFile.isopen()) {
print "Creating synapse perturbations..."
// allocate vectors
aloc=allocvecs(vidx,vwgain,vplasttau,vplastinc,vplastmaxw)
while (!synsPerturbFile.eof()) { // Read from the data file
synsPerturb.append(synsPerturbFile.scanvar()) // Read cell
}
synsPerturbFile.close() // Close the input file
print "File name:", synsPerturbName
print "Size:",synsPerturb.size()-1
for i=0, synsPerturb.size()-1 { // Loop through perturbed synapses and kill
// find pre and postsynaptic cells using connsnq
pre = col.connsnq.getrow(synsPerturb.x[i]).x(0)
post = col.connsnq.getrow(synsPerturb.x[i]).x(1)
xo = col[0].ce.o(pre)
print "synapse:",synsPerturb.x[i], "pre:", pre, " post:", post
// set vector length based on number of postsynaptic connections
vrsz(xo.getdvi(vidx),vwgain,vplasttau,vplastinc,vplastmaxw)
// read wgains
xo.getplast(vwgain,vplasttau,vplastinc,vplastmaxw)
// scale synaptic weight gain
vwgain.x(vidx.indwhere("==",post)) = 0.0
// update scaled wgains
xo.setplast(vwgain,vplasttau,vplastinc,vplastmaxw)
}
dealloc(aloc)
}