From 4abcfd91388a3febb4287a100a4a841f554dcc73 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Wed, 21 Feb 2024 22:49:46 +0100 Subject: [PATCH] AD_FillWaves: Fix calculation of failed sweeps for Rheobase PSQ_Rheobase does not have a per Sweep QC labnotebok setting. Therefore we decided in 23f0714f (Analysis functions dashboard, 2018-05-06) to use, for passing set QC, the last spiking/non-spiking sweeps as passed and everything else as failed. Unfortunately it was not anticipated that only two sweeps are present and in that case we have one sweep both failing and passing as Duplicate/RMD clips its passed indices. By using the set difference we avoid this issue. Close #2017 --- .../MIES/MIES_AnalysisFunctions_Dashboard.ipf | 2 +- .../UTF_PatchSeqRheobase.ipf | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf b/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf index 846dbceca0..4b45e67a9f 100644 --- a/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions_Dashboard.ipf @@ -349,7 +349,7 @@ static Function AD_FillWaves(win, list, info) lastValid = DimSize(spikeDetection, ROWS) - 1 ASSERT(Sum(spikeDetection, firstValid, lastValid) == 1, "Unexpected spike/non-spike duo") Duplicate/FREE/R=[firstValid, lastValid] sweeps, passingSweeps - Duplicate/FREE/R=[0, firstValid - 1] sweeps, failingSweeps + WAVE/Z failingSweeps = GetSetDifference(sweeps, passingSweeps) else Duplicate/FREE sweeps, failingSweeps WAVE/Z passingSweeps diff --git a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf index 9518cf868f..7825be833d 100644 --- a/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf +++ b/Packages/tests/HardwareAnalysisFunctions/UTF_PatchSeqRheobase.ipf @@ -422,7 +422,7 @@ static Function PS_RB4_REENTRY([str]) variable sweepNo, setPassed, i, numEntries, onsetDelay variable initialDAScale, stepsize - string key + string key, browser WAVE numericalValues = GetLBNumericalValues(str) @@ -473,6 +473,19 @@ static Function PS_RB4_REENTRY([str]) CommonAnalysisFunctionChecks(str, sweepNo, {setPassed}) CheckPSQChunkTimes(str, {20, 520, 1023, 1523}) + + // check passing/failing sweeps + browser = DB_FindDataBrowser(str) + CHECK_PROPER_STR(browser) + + DFREF dfr = BSP_GetFolder(browser, MIES_BSP_PANEL_FOLDER) + + WAVE/T listWave = GetAnaFuncDashboardListWave(dfr) + CHECK_EQUAL_VAR(GetNumberFromWaveNote(listWave, NOTE_INDEX), 1) + + WAVE/T infoWave = GetAnaFuncDashboardInfoWave(dfr) + CHECK_EQUAL_STR(infoWave[0][%$"Passing Sweeps"], "0;1;") + CHECK_EQUAL_STR(infoWave[0][%$"Failing Sweeps"], "") End static Function PS_RB5_preAcq(string device)