Skip to content

Commit 0b0702e

Browse files
committed
Added prepDilution field to scale responses to active fraction of prep volume
1 parent 552f39f commit 0b0702e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

FindSim-Schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@
188188
"minimum": 0.0,
189189
"maximum": 5000
190190
},
191+
"prepDilution": {"type": "number",
192+
"description": "Active portion of prep may be much smaller than the total volume taken, for example, synaptic spine signals in background of whole slice prep. Typical dilution in that case would be 10, so any ratiometric readout should be scaled by 10x. Best used for normalized readouts.",
193+
"minimum": 1e-6,
194+
"default": 1.0
195+
},
191196
"normalization": {"type": "object",
192197
"properties": {
193198
"sampling": {"type": "string",

findSim.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ def __init__( self, findsim, exptFile = "", isPlotOnly = False ):
289289
self.findsim = findsim
290290
self.exptFile = exptFile
291291
ro = findsim["Readouts"]
292+
self.prepDilution = ro.get( "prepDilution", 1.0 )
292293
self.directParamData = ro.get( "paramdata" )
293294
self.isPlotOnly = isPlotOnly
294295
self.simData = []
@@ -307,11 +308,25 @@ def __init__( self, findsim, exptFile = "", isPlotOnly = False ):
307308
self.data = ro.get("data") # For most kinds of data
308309
if self.data:
309310
for i in self.data: # force it to have [t, v, sem] in each row
311+
# Scale it by the estimated dilution of active sample
312+
# over total sample, eg spine vol over entire tissue.
313+
if "normalization" in ro:
314+
i[1] = 1+ (i[1]-1) * self.prepDilution
315+
else:
316+
i[1] *= self.prepDilution
310317
if len( i ) == 2:
311318
i.append( 0 )
312319
assert( len( i ) == 3 )
313320

314321
self.bardata = ro.get( "bardata" ) # only for barcharts
322+
if self.bardata:
323+
if "normalization" in ro:
324+
for bb in self.bardata:
325+
bb['value'] = 1 + (bb['value']-1)*self.prepDilution
326+
else:
327+
for bb in self.bardata:
328+
bb['value'] *= self.prepDilution
329+
315330
self.tabulateOutput = False
316331
self.generate = None
317332
self.generateFile = None
@@ -465,7 +480,7 @@ def digestSteadyStateRun( self, ref, ret ):
465480

466481

467482
# Finally assign the simData.
468-
self.simData = [ x/y for x, y in zip( ret, ref ) ]
483+
self.simData = [ x/y for x, y in zip(ret, ref) ]
469484

470485
def displayPlots( self, fname, modelLookup, stims, hideSubplots, exptType, bigFont = False, labelPos = None, deferPlot = False ):
471486
if self.isPlotOnly:

0 commit comments

Comments
 (0)