Open t-b opened 7 months ago
All operations will accept an array of select statements. Operations which accept a range will drop that argument. tp will warn when range is set in the select statement.
select
will then return multiple datasets, one or multiple ranges (Nx2) and the sweepNo-channelType-channelNo tripplet (Nx3).
$so1 = selectVis(displayed)
$so2 = selectCM(ic, vc)
$so3 = selectStimset(name1, name2)
$so4 = channels(AD6)
$so5 = sweeps()
$so6 = selectRange() # accepts what formerly data accepted in the first argument
$so7 = selectIVSCCSweepQC(passed | failed)
$so8 = selectIVSCCSetQC(passed | failed)
// select will show all displayed sweeps from channel 6 with ic/vc clampMode from stimsets name1/name2 select($so1, $so2, $so3, $so4, $so5, ...)
<details>
<summary>Approaches not choosen</summary>
2. Combined array
$so1 = selectOptVis() $so2 = selectOptCM(ic) select(channels(AD), sweeps(), [$so1, $so2])
3. Key-Value pairs
$so1 = selectOpt("vis=all", "clampMode=vc", "stimset=setA") $so2 = selectOpt("vis=all", "clampMode=ic", "stimset=setB")
select(channels(AD), sweeps(), selectJoin($so1, $so2)) # or with []
4. Ordered arguments
$so = selectOpt(vis, all, clampMode,[vc,ic],stimset,setA*) select(channels(AD), sweeps(), $so)
Option 1 it is.
@t-b I'd also like to add an option to select all baseline or all pulse epochs, for example. We could also give the user a chance to apply some QC. e.g., check for spikes in baseline data?
And it would be nice if we could recursively do selections:
sel = select(sweeps())
sel1 = select($sel, selectRange(E1))
This helps in disecting a bunch of sweeps (an RAC?) into two selections, one for each SCI for example.
Thought regarding selectRange(E1)
:
select itself can not determine if ranges are good as this is depending on sweep / channelNumber / channelType. Thus, it makes no sense to think of any AND way to combine ranges when multiple are specified.
e.g.
select(selectRange("E*", "U*"), selectRange("*1", "*2"))
Currently the implementation just gathers all ranges specified.
Another option would be to allow only a single selectRange
per select
.
As select
does not evaluate the ranges itself this information must be carried over to e.g. data
. The idea is to make a composite return with two datasets, where the first dataset is the classic Nx3 select wave and the second dataset the range specification (as returned from SFH_EvaluateRange).
The whole composite would have the SELECT data type.
Regarding other entries appearing multiple times in select
:
For selectStimset
, sweeps
, channels
the SetIntersection is calculated. String inputs such as selectStimset
and channels
are evaluated as is for the intersection. Any wildcard patterns are not evaluated.
This also applies to channels
in a sense, as {NaN, NaN} is a channels wildcard.
behavior for select:
The select operation 1 has the following signature:
now we would like to add more control over sweep selection. Not only should it be able to select via displayed and clampmode but also via stimulus set and if it passed or not.
Sweep passing state is a LBN entry, see
PSQ_FMT_LBN_SWEEP_PASS
2 as input forCreateAnaFuncLBNKey
.Not all analysis functions have that entry, only DA, SP, RA, CR, PB, SE, VM, AR so from the complete list
and that means PSQ_Rheobase needs to be covered differently (see AD_FillWaves line 344, but note #2017). Idea:
where all
selectXXX
operations would beand
-ed.As users would also like to select multiple options OR'ed (e.g. passing sweeps from stimset A and failing sweeps from stimset B) we propose to allow an array of
select()
for all operations which accept a select statement (tp
,data
,psxKernel
,psxStats
,epochs
,labnotebook
).