Skip to content

Commit

Permalink
Packages/doc/dot: Adapt flowcharts for out of range DAScale values
Browse files Browse the repository at this point in the history
  • Loading branch information
t-b committed Nov 5, 2024
1 parent afbc99f commit d63f42e
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 99 deletions.
20 changes: 17 additions & 3 deletions Packages/doc/dot/multi-patch-seq-dascale.dot
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,23 @@ digraph G {
"Prepare DAQ" -> "Enable \"Multidevice DAQ\"";
"Pre Set Event" -> "Enable \"Autobias\"";
"Pre Set Event" -> "Set next DAScale value,\nuse the analysis parameter values as offset\nonto the earlier FastRheoEstimate guess";
"Post Sweep Event" -> "Set next DAScale value,\nuse the analysis parameter values as offset\nonto the earlier FastRheoEstimate guess";
"Post Sweep Event" -> "Mark all active headstages as passed";
n32 [label="Check if setting the DAScale value\n for the next sweep\n would be out of range"];
"Post Sweep Event" -> n32;
"Post Set Event" -> "Read active headstages from labnotebook\nand turn them all on again";
"Enable \"Multidevice DAQ\"" -> "Enable \"Repeated Acquisition\"";
"Enable \"Autobias\"" -> "Enable \"Insert TP\"";
"Mark all active headstages as passed" -> "Mark Sweep as passed";
"Mark set as passed" [label="Are all sweeps passing?"];
"Read active headstages from labnotebook\nand turn them all on again" -> "Mark set as passed";
"Read active headstages from labnotebook\nand turn them all on again" -> "Update Dashboard";
n29 [label="\"Unlocked Indexing\" is active"];
"Enable \"Repeated Acquisition\"" -> n29;
"Enable \"Insert TP\"" -> "Enable \"TP during ITI\"";
"Enable \"Insert TP\"" -> "Force Sampling Multiplier to 1";
"Mark set as passed" -> "Update Dashboard";
n39 [label="Mark set as passed"];
"Mark set as passed" -> n39 [label=Yes];
n40 [label="Mark set as failed"];
"Mark set as passed" -> n40 [label=No];
n29 -> Abort [label=Yes];
"Enable \"TP during ITI\"" -> "Valid Autobias voltage (finite and non-zero)";
"Force Sampling Multiplier to 1" -> "Check if no TTL channels are active";
Expand All @@ -58,4 +63,13 @@ digraph G {
"Turn off active non-IC headstages\nor headstages which have not passed FastRheoEstimate" -> "Check if there is at least\none active IC headstage";
"Check if there is at least\none active IC headstage" -> "All checks passed";
"All checks passed" -> Abort [label=No];
n33 [label="Set DAScale"];
n32 -> n33 [label=No];
n35 [label="Mark headstage as failed, others as passing"];
n32 -> n35 [label=Yes];
n33 -> "Mark all active headstages as passed";
n36 [label="Add \"DAScale out of range\" labnotebook entry"];
n35 -> n36;
n37 [label="Mark Sweep as failed"];
n36 -> n37;
}
31 changes: 22 additions & 9 deletions Packages/doc/dot/multi-patch-seq-fast-rheo-estimate.dot
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ digraph G {
"Write initial stepsize of 100pA into\nlabnotebook for all active IC headstages" -> "Set \"DAScale exceeded\" labnotebook entry\nto false for all active IC headstages";
"Set \"DAScale exceeded\" labnotebook entry\nto false for all active IC headstages" -> "Store active headstages in labnotebook";
"Store active headstages in labnotebook" -> "Turn off active non-IC headstages";
"Turn off active non-IC headstages" -> "Set \"User onset delay\" to 0ms";
"Set \"User onset delay\" to 0ms" -> "Set \"Termination delay\" to 0 ms";
"Set \"Termination delay\" to 0 ms" -> "Disable \"dDAQ\"/\"oodDAQ\"";
"Start DAQ/RA (only call for last active headstage)" -> "Prepare DAQ/Pre Set Event";
"Start DAQ/RA (only call for last active headstage)" -> "Post Sweep Event";
"Start DAQ/RA (only call for last active headstage)" -> "Post DAQ Event";
Expand All @@ -44,22 +47,27 @@ digraph G {
"Post Sweep Event" -> "Iterate over all active headstages";
"Post Sweep Event" -> "Store pulse duration in labnotebook";
"Post DAQ Event" -> "Update Dashboard";
"Post Set Event" -> "Mark set as passed if 1 sweep passed,\nas failure otherwise";
"Post Set Event" -> "Set \"TP during ITI\" to enabled";
n59 [label="Do we have a \"DAScale out of range\" labnotebook entry\n in the SCI"];
"Post Set Event" -> n59;
n60 -> "Enable \"Multidevice DAQ\"";
"Iterate over all active headstages" -> "Active headstages left?";
"Mark set as passed if 1 sweep passed,\nas failure otherwise" -> "Analysis parameter \"PostDAQSetDAScale\" is true";
"Set \"TP during ITI\" to enabled" -> "Set \"TP inserting\" to enabled";
n59 -> "Mark set as passed if 1 sweep passed,\nas failure otherwise" [label=No];
n62 [label="Mark set as failed"];
n59 -> n62 [label=Yes];
"Enable \"Multidevice DAQ\"" -> "Enable \"Repeated Acquisition\"";
"Active headstages left?" -> "Have all headstages passed in one sweep\nof their stimset cycle?" [label=No];
"Active headstages left?" -> "Headstage passed?" [label=Yes];
"Analysis parameter \"PostDAQSetDAScale\" is true" -> "Set DAScale to the stored LBN value taking into account\nthe analysis parameter \"PostDAQDAScaleFactor\"\nand \"PostDAQDAScaleMinOffset\"\
.\nSet it to \"PostDAQDAScaleForFailedHS\" for failed headstages.";
"Mark set as passed if 1 sweep passed,\nas failure otherwise" -> "Analysis parameter \"PostDAQSetDAScale\" is true";
n62 -> "Analysis parameter \"PostDAQSetDAScale\" is true";
n61 [label="Is \"Unlocked indexing\" active"];
"Enable \"Repeated Acquisition\"" -> n61;
"Have all headstages passed in one sweep\nof their stimset cycle?" -> "Mark sweep as failed" [label=No];
"Have all headstages passed in one sweep\nof their stimset cycle?" -> "Mark sweep as passed" [label=Yes];
"Headstage passed?" -> "Headstage exceeded DAScale\n according to labnotebook entry?" [label=No];
"Analysis parameter \"PostDAQSetDAScale\" is true" -> "Set DAScale to the stored LBN value taking into account\nthe analysis parameter \"PostDAQDAScaleFactor\"\nand \"PostDAQDAScaleMinOffset\"\
.\nSet it to \"PostDAQDAScaleForFailedHS\" for failed headstages.";
"Set DAScale to the stored LBN value taking into account\nthe analysis parameter \"PostDAQDAScaleFactor\"\nand \"PostDAQDAScaleMinOffset\"\
.\nSet it to \"PostDAQDAScaleForFailedHS\" for failed headstages." -> "Read active headstages from labnotebook\nand turn them all on again";
n61 -> Abort [label=Yes];
Expand All @@ -76,20 +84,25 @@ digraph G {
"Step size from labnotebook? (2)" -> "Offset DAScale by +10pA" [label="+10pA"];
"Step size from labnotebook? (2)" -> "Offset DAScale by +100pA" [label="+100pA"];
"Store DAScale in labnotebook" -> "Mark headstage as passed";
"Mark headstage as failed" [label="Would the new DAScale value\n for the next sweep be out of range?"];
"Offset DAScale by -50pA" -> "Mark headstage as failed";
"Write step size of -50pA to labnotebook" -> "Offset DAScale by -50pA";
"Write step size of +10pA to labnotebook" -> "Offset DAScale by +10pA";
"Offset DAScale by +10pA" -> "Mark headstage as failed";
"Offset DAScale by +100pA" -> "Mark headstage as failed";
"Mark headstage as passed" -> "Set DAScale to zero";
"Mark headstage as failed" -> "\"MaximumDAScale\" analysis parameter is not NaN?";
n64 [label="Add \"DAScale out of range\" labnotebook entry"];
"Mark headstage as failed" -> n64 [label=Yes];
n68 [label="Set DAScale"];
"Mark headstage as failed" -> n68;
n66 [label="Mark headstage as failed"];
n64 -> n66;
n68 -> n66;
n66 -> "\"MaximumDAScale\" analysis parameter is not NaN?";
"\"MaximumDAScale\" analysis parameter is not NaN?" -> "DAScale is larger than \"MaximumDAScale\"?" [label=Yes];
"Turn off active non-IC headstages" -> "Set \"User onset delay\" to 0ms";
"DAScale is larger than \"MaximumDAScale\"?" -> "Mark headstage as \"DAScale exceeded\"\nin labnotebook" [label=Yes];
"Mark headstage as \"DAScale exceeded\"\nin labnotebook" -> "Set DAScale to zero";
"Disable \"dDAQ\"/\"oodDAQ\"" -> "Set \"TP during ITI\" to disabled";
"Set \"TP during ITI\" to disabled" -> "Set \"ITI\" to 100ms";
"Set \"ITI\" to 100ms" -> "Set \"TP inserting\" to disabled";
"Set \"User onset delay\" to 0ms" -> "Set \"Termination delay\" to 0 ms";
"Set \"Termination delay\" to 0 ms" -> "Disable \"dDAQ\"/\"oodDAQ\"";
"Mark headstage as \"DAScale exceeded\"\nin labnotebook" -> "Set DAScale to zero";
}
45 changes: 27 additions & 18 deletions Packages/doc/dot/multi-patch-seq-spike-control.dot
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,38 @@ on some pulses\n and \"Too Many\" on others."];
n51 -> n52 [label=True];
n53 [label="Mark sweep as failed"];
n51 -> n53 [label=False];
n74 [label="Was spontaneous spiking detected?"];
n88 -> n74 [label=Failed];
n79 [label="Spike Count state?"];
n88 -> n79 [label=Failed];
n94 [label="Spike position passed?"];
n88 -> n94 [label=Passed];
n63 [label="Mark set as passed if all IC headstages\n passed with all set sweep counts."];
n52 -> n63;
n54 [label="Analysis parameter \"Max Trials\" present?"];
n53 -> n54;
n75 [label="Add \"Auto bias baseline modifier\" analysis parameter\n value to autobias target voltage"];
n74 -> n75 [label=Yes];
n81 [label="Decrease DA Scale according to analysis parameters\n \"DaScaleTooManySpikesModifier\" and \"DaScaleTooManySpikesOperator\""];
n79 -> n81 [label="Too Many"];
n82 [label="Warn user in history once\nduring this RA cycle"];
n79 -> n82 [label=Mixed];
n83 [label="Increase DA scale according to analysis parameters\n \"DAScaleModifier\"\n and \"DAScaleOperator\""];
n79 -> n83 [label="Too Few"];
n77 [label="Increase DA scale according to analysis parameters\n \"DAScaleSpikePositionModifier\"\n and \"DAScaleSpikePositionOperator\""];
n94 -> n77 [label=Failed];
n70 [label="Set passed?"];
n63 -> n70;
n55 [label="Check if the current trial count\nof the current set sweep count\n exceeds \"Max Trials\""];
n54 -> n55 [label=Yes];
n56 [label="Skip back one sweep"];
n54 -> n56 [label=No];
n76 [label="Would the new DA scale for the next sweep be out of range?"];
n81 -> n76;
n62 [label="Increase DA scale according to analysis parameters\n \"DAScaleModifier\" and \"DAScaleOperator\""];
n82 -> n62;
n83 -> n76;
n77 -> n76;
n65 [label="Analysis parameter \"Max Trials\" present? [2]"];
n70 -> n65 [label=No];
n68 [label="Skip to end of active set"];
Expand All @@ -142,27 +164,14 @@ on some pulses\n and \"Too Many\" on others."];
n57 [label="Add \"Rerun Trials Exceeded\"\n into numerical labnotebook"];
n55 -> n57 [label=Yes];
n56 -> n63;
n90 [label="Add \"DAScale out of range\" labnotebook entry"];
n76 -> n90 [label=Yes];
n62 -> n76;
n66 [label="Was it reached on all IC headstages?"];
n65 -> n66 [label=Yes];
n67 [label="Mark set as failed"];
n66 -> n67;
n67 -> n68;
n74 [label="Was spontaneous spiking detected?"];
n88 -> n74 [label=Failed];
n79 [label="Spike Count state?"];
n88 -> n79 [label=Failed];
n94 [label="Spike position passed?"];
n88 -> n94 [label=Passed];
n75 [label="Add \"Auto bias baseline modifier\" analysis parameter\n value to autobias target voltage"];
n74 -> n75 [label=Yes];
n81 [label="Decrease DA Scale according to analysis parameters\n \"DaScaleTooManySpikesModifier\" and \"DaScaleTooManySpikesOperator\""];
n79 -> n81 [label="Too Many"];
n82 [label="Warn user in history once\nduring this RA cycle"];
n79 -> n82 [label=Mixed];
n83 [label="Increase DA scale according to analysis parameters\n \"DAScaleModifier\"\n and \"DAScaleOperator\""];
n79 -> n83 [label="Too Few"];
n77 [label="Increase DA scale according to analysis parameters\n \"DAScaleSpikePositionModifier\"\n and \"DAScaleSpikePositionOperator\""];
n94 -> n77 [label=Failed];
n62 [label="Increase DA scale according to analysis parameters\n \"DAScaleModifier\" and \"DAScaleOperator\""];
n82 -> n62;
n96 [label="Mark sweep as failed"];
n90 -> n96;
}
33 changes: 21 additions & 12 deletions Packages/doc/dot/patch-seq-chirp.dot
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ digraph G {
"Pre Sweep Config Event" -> n91;
"Post DAQ Event" -> "Update Dashboard";
"Post Set Event" -> "Update Dashboard";
"Post Set Event" -> "Has three passing sweeps in set\n with the same DAScale value? [1]";
n84 [label="Set \"Delay onset user\" back from labnotebook entry"];
"Post Set Event" -> n84;
n97 [label="Read analysis parameter\n \"AmpBesselFilterRestore\",\n defaulting to true."];
Expand Down Expand Up @@ -87,7 +86,7 @@ digraph G {
"Chunk already evaluated?" -> "Grab next completely acquired chunk\n(500ms) of stimset baseline" [label=Yes];
"Chunk already evaluated?" -> "Baseline chunk type" [label=No];
"Last chunk?" -> "Mark Sweep as failed" [label=Yes];
"Acquired requested number of cycles?\n(Given by optional analysis parameter\n\"NumberOfChirpCycles\" defaulting to 1.)" -> "Calculate min/max of AD data during these cycles" [label=Yes];
n100 -> "Acquired requested number of cycles?\n(Given by optional analysis parameter\n"NumberOfChirpCycles\" defaulting to 1.)";
n68 [label="Has spike in AD data of acquired chirp region?\nUses \"FailedLevel\" analysis parameter for spike search."];
n66 -> n68 [label=Yes];
n80 [label="Is the analysis parameter \"AutobiasTargetVAtSetEnd\" present?\n If yes, set the autobias target voltage to it."];
Expand All @@ -99,13 +98,11 @@ digraph G {
"Has BL QC and \"Inside Bounds\"\n entries being true in labnotebook?" -> n76 [label=Yes];
n74 -> "Has BL QC and \"Inside Bounds\"\n entries being true in labnotebook?" [label=Yes];
n74 -> "Mark sweep as failed\n in labnotebook" [label=No];
"Mark sweep as failed\n in labnotebook" -> "Has three passing sweeps in set\n with the same DAScale value? [2]";
n85 [label="Check if the acquired data\n has that sampling interval"];
n76 -> n85;
"Enable \"Multidevice DAQ\"" -> "Disable \"dDAQ\"/\"oodDAQ\"";
"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"];
"Acquired requested number of cycles?\n(Given by optional analysis parameter\n"NumberOfChirpCycles\" defaulting to 1.)" -> "Calculate min/max of AD data during these cycles" [label=Yes];
"Calculate min/max of AD data during these cycles" -> "Determine bounds state and action\n from min/max values and table\n store in labnotebook";
n69 [label="Add Spike QC failed labnotebook entry"];
n68 -> n69 [label=Yes];
Expand All @@ -114,12 +111,15 @@ digraph G {
n88 -> n80 [label=None];
n90 [label="Read full average voltage from labnotebook\n from that sweep and set it as autobias target voltage."];
n88 -> n90 [label=Found];
"Mark sweep as failed\n in labnotebook" -> "Has three passing sweeps in set\n with the same DAScale value? [2]";
n85 [label="Check if the acquired data\n has that sampling interval"];
n76 -> n85;
"Has three passing sweeps in set\n with the same DAScale value? [2]" -> "Skip to end of set" [label=Yes];
"Has three passing sweeps in set\n with the same DAScale value? [2]" -> "Read analysis parameter \"NumberOfFailedSweeps\",\n if not present use 3.\n Have that many sweeps failed?" [label=No];
n85 -> "Mark sweep as failed\n in labnotebook" [label=No];
n85 -> "Skip to end of DAQ" [label=No];
n93 [label="Has Async Channels QC\n labnotebook entry passed?"];
n85 -> n93 [label=Yes];
n106 [label="Do we have a \"DAScale out of range\" labnotebook entry\n in the SCI"];
n85 -> n106 [label=Yes];
"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];
Expand All @@ -138,6 +138,7 @@ digraph G {
n71 -> n72 [label=Yes];
"Read analysis parameter \"NumberOfFailedSweeps\",\n if not present use 3.\n Have that many sweeps failed?" -> "Skip to end of DAQ" [label=Yes];
"Read analysis parameter \"NumberOfFailedSweeps\",\n if not present use 3.\n Have that many sweeps failed?" -> "Set can still pass?" [label=No];
n93 [label="Has Async Channels QC\n labnotebook entry passed?"];
n93 -> "Mark sweep as failed\n in labnotebook" [label=No];
n93 -> "Mark sweep as passed\n in labnotebook" [label=Yes];
"Enable \"Repeated Acquisition\"" -> "Enable \"Insert TP\"";
Expand All @@ -147,9 +148,9 @@ digraph G {
"Add BL QC failed labnotebook entry" -> "Early Sweep stop";
"Mark chunk as passed/failed [2]" -> "Grab next completely acquired chunk\n(500ms) of stimset baseline" [label=Failed];
"Mark chunk as passed/failed [2]" -> "Add BL QC passed labnotebook entry" [label=Passed];
"Calculate scaling factor\n to be inside the bounds" -> "Adjust DAScale (rounded to full pA)\n according to scaling factor";
n75 [label="Abort sweep"];
n67 -> n75;
"Calculate scaling factor\n to be inside the bounds" -> "Calculate DAScale (rounded to full pA)\n according to scaling factor";
n101 [label="Would the next DAScale value be out of range?"];
n67 -> n101;
"Set can still pass?" -> "Skip to end of DAQ" [label=No];
"Mark sweep as passed\n in labnotebook" -> "Has three passing sweeps in set\n with the same DAScale value? [2]";
n89 [label="Use \"SamplingMultiplier\" analysis parameter\n (defaulting to 4 if not present) and set it."];
Expand All @@ -158,7 +159,7 @@ digraph G {
"All checks passed" -> "Look for an existing and passing PSQ_DAScale sweep\n in subthreshold mode" [label=Yes];
"Check target voltage [1]" -> "Mark chunk as passed/failed [1]";
"Add BL QC passed labnotebook entry" -> "Early Sweep stop";
"Adjust DAScale (rounded to full pA)\n according to scaling factor" -> "Abort Sweep";
"Calculate DAScale (rounded to full pA)\n according to scaling factor" -> n101;
n78 [label="Is the analysis parameter \"AutobiasTargetV\" present?\n If yes, set the autobias target voltage to it."];
n89 -> n78;
"Look for an existing and passing PSQ_DAScale sweep\n in subthreshold mode" -> Abort [label="Not found"];
Expand All @@ -173,5 +174,13 @@ digraph G {
"Calculate Resistance from it\n store in labnotebook" -> "Calculate initial DAScale\n store in labnotebook";
n83 -> "All checks passed";
"Calculate initial DAScale\n store in labnotebook" -> "Set DAScale";
n100 -> "Acquired requested number of cycles?\n(Given by optional analysis parameter\n\"NumberOfChirpCycles\" defaulting to 1.)";
n102 [label="Add \"DAScale out of range\" labnotebook entry"];
n101 -> n102 [label=Yes];
n103 [label="SetDAScale value"];
n101 -> n103 [label=No];
n105 [label="Jump to end of active set"];
n102 -> n105;
n106 -> "Mark sweep as failed\n in labnotebook" [label=Yes];
n106 -> "Skip to end of DAQ" [label=Yes];
n106 -> n93 [label=No];
}
Loading

0 comments on commit d63f42e

Please sign in to comment.