Skip to content

Commit

Permalink
Packages/doc/dot/patch-seq-dascale.dot: Add Adaptive Supra threshold …
Browse files Browse the repository at this point in the history
…mode
  • Loading branch information
t-b committed Dec 6, 2023
1 parent 83f920d commit 337a10c
Showing 1 changed file with 93 additions and 11 deletions.
104 changes: 93 additions & 11 deletions Packages/doc/dot/patch-seq-dascale.dot
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ digraph G {
label="Standard AsyncQCChannels handling",
target=_graphviz];
"Post Sweep Event" -> n91;
"Last Sweep passed?" [label="BL QC passed? [2]"];
"Post Sweep Event" -> "Last Sweep passed?";
"Post Sweep Event" -> "Get OperationMode [3]";
n92 [URL="../_static/images/async-qc-channels.svg",
label="Standard AsyncQCChannels handling",
target=_graphviz];
Expand All @@ -48,6 +47,9 @@ digraph G {
"BL QC passed?" -> "Grab next completely acquired chunk\n(500ms) of stimset baseline" [label=No];
"Get OperationMode [2]" -> "Mark set as passed if $NUM_DA_SCALES\nsweeps passed, as failure otherwise" [label=Sub];
"Get OperationMode [2]" -> "Labnotebook has fI-Slope reached entry?" [label=Supra];
n79 [label="Do we have measured all\n required DAScales?"];
"Get OperationMode [2]" -> n79 [label="Adaptive Supra"];
"Last Sweep passed?" [label="BL QC passed? [2]"];
n72 [label="Mark sweep as failed"];
"Last Sweep passed?" -> n72 [label=No];
n75 [label="Read \"SamplingFrequency\" analysis parameter\n (defaulting to 50kHz) if not present"];
Expand Down Expand Up @@ -77,15 +79,17 @@ digraph G {
"Stimset is large enough" -> "Check if mode is IC";
"Baseline chunk type" -> "Check RMS short" [label="pre pulse"];
"Baseline chunk type" -> "Check target voltage [2]" [label="post pulse"];
n73 [label="Mark sweep as passed"];
n73 -> "Get OperationMode [3]";
n77 -> n72 [label=No];
n86 [label="Mark sweep as passed"];
n77 -> n86;
"Disable \"dDAQ\"/\"oodDAQ\"" -> "Enable \"Repeated Acquisition\"";
"Check if mode is IC" -> "Check if only one headstage is active";
"Check RMS short" -> "Check RMS long" [label=Passed];
"Check RMS short" -> "Add BL QC failed labnotebook entry" [label=Failed];
"Check target voltage [2]" -> "Mark chunk as passed/failed [2]";
"Get OperationMode [3]" -> "Calculate TP-like properties\nand store them in the\nlabnotebook" [label=Sub];
"Get OperationMode [3]" -> "Search for spikes\n(x range: pulse onset to end of pulse\ny condition: max above 0.01mV)" [label=Supra];
"Get OperationMode [3]" -> "Last Sweep passed?";
n87 [label="Use SweepFormula to gather the action\n potential frequency and DAScale value\n of the sweep"];
"Get OperationMode [3]" -> n87 [label="Adaptive Supra"];
"Enable \"Repeated Acquisition\"" -> "Enable \"Insert TP\"";
"Check if only one headstage is active" -> "All checks passed";
"Check RMS long" -> "Add BL QC failed labnotebook entry" [label=Failed];
Expand All @@ -95,37 +99,115 @@ digraph G {
"Mark chunk as passed/failed [2]" -> "Add BL QC passed labnotebook entry" [label=Passed];
"Calculate TP-like properties\nand store them in the\nlabnotebook" -> "Check if $NUM_DA_SCALES\nsweeps passed from RA cycle";
"Calculate TP-like properties\nand store them in the\nlabnotebook" -> "Optional parameter ShowPlot\nis true or missing";
"Search for spikes\n(x range: pulse onset to end of sweep\ny condition: max above 0.01mV)" -> "Write number of spikes\ninto labnotebook";
"Search for spikes\n(x range: pulse onset to end of pulse\ny condition: max above 0.01mV)" -> "Write number of spikes\ninto labnotebook";
n68 [label="Use \"SamplingMultiplier\" analysis parameter\n (defaulting to 4 if not present) and set it."];
"Enable \"Insert TP\"" -> n68;
"All checks passed" -> Abort [label=No];
"All checks passed" -> "Use first DAScale value" [label=Yes];
"All checks passed" -> "Get OperationMode" [label=Yes];
"Check target voltage [1]" -> "Mark chunk as passed/failed [1]";
"Add BL QC passed labnotebook entry" -> "Early Sweep stop";
"Check if $NUM_DA_SCALES\nsweeps passed from RA cycle" -> "Skip to end of active set" [label=Yes];
"Check if $NUM_DA_SCALES\nsweeps passed from RA cycle" -> "Use next DAScale value" [label=No];
"Optional parameter ShowPlot\nis true or missing" -> "Plot the resistance (Sub)\nor fI (Supra)" [label=Yes];
"Write number of spikes\ninto labnotebook" -> "Analysis parameters MinimumSpikeCount,\n MaximumSpikeCount,\n DAScaleModifier\n present?";
"Write number of spikes\ninto labnotebook" -> "Determine pulse duration\nand write it into the labnotebook";
"Use first DAScale value" -> "Get OperationMode";
"Mark chunk as passed/failed [1]" -> "Grab next completely acquired chunk\n(500ms) of stimset baseline" [label=Passed];
"Mark chunk as passed/failed [1]" -> "Early sweep stop, repurpose ITI and add 10s to ITI" [label=Failed];
"Analysis parameters MinimumSpikeCount,\n MaximumSpikeCount,\n DAScaleModifier\n present?" -> "Use next DAScale value" [label=No];
"Analysis parameters MinimumSpikeCount,\n MaximumSpikeCount,\n DAScaleModifier\n present?" -> "Spike count relative to\nMin and Max?" [label=Yes];
"Determine pulse duration\nand write it into the labnotebook" -> "Create spike frequency vs DAScale (fI) data\nand peform linear regression";
"Get OperationMode" -> "Look for a rheobase sweep with passing set QC,\n pulse duration longer than 500ms\n and having spiked" [label=Supra];
"Get OperationMode" -> "Use the DAScale values\nfrom the analysis parameters" [label=Sub];
n110 [label="Look for a supra SCI with passing set QC"];
"Get OperationMode" -> n110 [label="Adaptive Supra"];
"Spike count relative to\nMin and Max?" -> "Use next DAScale value" [label="In-between"];
"Spike count relative to\nMin and Max?" -> "Adapt DAScale\n by a factor of 1 - Modifier" [label=Above];
"Spike count relative to\nMin and Max?" -> "Adapt DAScale\n by a factor of 1 + Modifier" [label=Below];
"Create spike frequency vs DAScale (fI) data\nand peform linear regression" -> "Optional parameter ShowPlot\nis true or missing";
"Create spike frequency vs DAScale (fI) data\nand peform linear regression" -> "Write fI-Slope into labnotebook";
"Look for a rheobase sweep with passing set QC,\n pulse duration longer than 500ms\n and having spiked" -> Abort [label="Not found"];
"Look for a rheobase sweep with passing set QC,\n pulse duration longer than 500ms\n and having spiked" -> "Use the DAScale value of that sweep\n as offset to the DAScale values from the analysis parameters" [label=Found];
"Use the DAScale values\nfrom the analysis parameters" -> "Use first DAScale value";
"Adapt DAScale\n by a factor of 1 - Modifier" -> "Use next DAScale value";
"Adapt DAScale\n by a factor of 1 + Modifier" -> "Use next DAScale value";
"Write fI-Slope into labnotebook" -> "Optional FinalSlopePercent\nparameter present?";
"Use the DAScale value of that sweep\n as offset to the DAScale values from the analysis parameters" -> "Use first DAScale value";
"Optional FinalSlopePercent\nparameter present?" -> "Add labnotebook entry if the\ndesired fI-Slope was reached or not" [label=Yes];
n77 -> n72 [label=No];
n77 -> n73 [label=Yes];
n79 -> "Mark set as failed" [label=No];
n80 [label="Was the fit slope from supra sweep\n evaluation valid?"];
n79 -> n80 [label=Yes];
n81 [label="Mark set as passed"];
n80 -> n81 [label=No];
n83 [label="Do we have a passing sweep\n which has fI-Slope reached entry?"];
n80 -> n83 [label=Yes];
n83 -> "Mark set as failed" [label=No];
n83 -> n81 [label=Yes];
n86 -> "Calculate TP-like properties\nand store them in the\nlabnotebook" [label=Supra];
n86 -> "Search for spikes\n(x range: pulse onset to end of pulse\ny condition: max above 0.01mV)" [label=Sub];
n88 [label="Write the AP frequency to the labnotebook"];
n87 -> n88 [label=Sucess];
n90 [label="Fetch the AP frequency and DAScale data\n from supra sweeps"];
n87 -> n90 [label=Failure];
n88 -> n90;
n93 [labe="Fetch sweeps with passing BL QC from SCI\ and append their AP frequency\n DAScale data to the supra data",
label="Fetch AP frequency and DAScale data\n from passing sweeps of this SCI"];
n90 -> n93;
n94 [label="Do overshoot correction:\n This means we want to ensure that all acquired AP frequency DAScale data\n has a stepwidth of smaller \
than MaxFrequencyChangePercent.\n If this is not the case we add DAScale values to the future DAScale list"];
n93 -> n94 [label="Do we have passing sweeps in this SCI?"];
n104 [label="Determine if we have more than NumPointsforLineFit\n points to fit and write the\ result into the labnotebook"];
n93 -> n104;
n94 -> n104;
n95 [label="Fit the last NumPointsForLineFit AP frequency\n and DAScale data from supra plus this SCI"];
n97 [label="Write fit slope and offset to the labnotebook"];
n95 -> n97 [label="Sucess?"];
n98 [label="Mark the fit slope as invalid in the labnotebook"];
n95 -> n98 [label="Failure?"];
n101 [label="Determine if the fit slope is valid\n and store the result in the labnotebook"];
n97 -> n101;
n99 [label="Calculate the maximum slope in this SCI\n and store it in the labnotebook"];
n98 -> n99;
n102 [label="Determine if the current slope is SlopePercentage\n smaller than the maximum slope\n and write the result to the labnotebook"];
n99 -> n102;
n101 -> n99;
n105 [label="Mark sweep as passed if all of the following checks passed\n - baseline QC\n - sampling interval QC\n - async QC \n - fit slope \
QC\n - enough points for fit"];
n102 -> n105;
n104 -> n95;
n107 [label="Determine if we measured all future DAScale values\n and store that value in the labnotebook"];
n105 -> n107;
n112 [label="Check if the set is finished"];
n107 -> n112;
n109 [label="Check if the set can still pass"];
n111 [label="Skip to end"];
n109 -> n111 [label=No];
n100 [label="Has the sweep passed?"];
n109 -> n100 [label=Yes];
n112 -> n109 [label=No];
n113 [label="Skip to end of active set"];
n112 -> n113 [label=Yes];
n103 [label="Measured all future DAScale values?"];
n100 -> n103 [label=Yes];
n106 [label="Calculate new DAScale value by\n extrapolating fit slope and offset\n and using MaximumChangePercent - 2 as frequency distance"];
n103 -> n106 [label=Yes];
n108 [label="Use the next DAScale value"];
n103 -> n108 [label=No];
n106 -> n108;
n110 -> Abort [label="Not found"];
n114 [label="Gather AP frequency and DAScale data\n from all passing supra sweeps\n but using the E1 epoch for evaluations"];
n110 -> n114 [label=Found];
n116 [label="Store frequency and DAScale data\n in the labnotebook"];
n114 -> n116;
n117 [label="Fit the AP frequency and DAScale data"];
n116 -> n117;
n117 -> Abort [label=Failure];
n118 [label="Store the fit slope and offset\n in the labnotebook"];
n117 -> n118 [label=Success];
n119 [label="Calculate the maximum fit slope\n and store it in the labnotebook"];
n118 -> n119;
n120 [label="Do overshoot correction"];
n119 -> n120;
n121 [label="Determine if the fit slopes are valid\n and store that in the labnotebook"];
n120 -> n121;
n121 -> n106 [label=Success];
}

0 comments on commit 337a10c

Please sign in to comment.