@@ -194,7 +194,8 @@ DifferentialExpressionPlugin::DifferentialExpressionPlugin(const PluginFactory*
194194 _buttonProgressBar(nullptr ),
195195 _copyToClipboardAction(&getWidget (), "Copy"),
196196 _saveToCsvAction(&getWidget (), "Save As..."),
197- _normAction(&getWidget (), "Min max normalization")
197+ _normAction(&getWidget (), "Min max norm"),
198+ _thresholdExpressedAction(&getWidget (), "Threshold %expressed", 0.0f, 4.0f, 0.0f, 1)
198199{
199200 // This line is mandatory if drag and drop behavior is required
200201 _currentDatasetNameLabel->setAcceptDrops (true );
@@ -255,6 +256,11 @@ DifferentialExpressionPlugin::DifferentialExpressionPlugin(const PluginFactory*
255256 _updateStatisticsAction.trigger ();
256257 });
257258
259+ connect (&_thresholdExpressedAction, &DecimalAction::valueChanged, this , [this ](float value)
260+ {
261+ _updateStatisticsAction.trigger ();
262+ });
263+
258264 _serializedActions.append (&_loadedDatasetsAction);
259265 _serializedActions.append (&_selectedIdAction);
260266 _serializedActions.append (&_filterOnIdAction);
@@ -284,8 +290,9 @@ void DifferentialExpressionPlugin::init()
284290 filterWidget->setContentsMargins (0 , 3 , 0 , 3 );
285291
286292 QHBoxLayout* toolBarLayout = new QHBoxLayout;
287- toolBarLayout->addWidget (filterWidget, 8 );
293+ toolBarLayout->addWidget (filterWidget, 6 );
288294 toolBarLayout->addWidget (_normAction.createWidget (&mainWidget), 2 );
295+ toolBarLayout->addWidget (_thresholdExpressedAction.createWidget (&mainWidget), 2 );
289296
290297 layout->addLayout (toolBarLayout);
291298 }
@@ -475,7 +482,7 @@ void DifferentialExpressionPlugin::init()
475482 std::vector<float > pctExpressedA (numDimensions, 0 );
476483 std::vector<float > pctExpressedB (numDimensions, 0 );
477484
478- float thr = 0 . 0f ;
485+ float thr = _thresholdExpressedAction. getValue () ;
479486
480487 // first compute the sum of values per dimension for selectionA and selectionB
481488 local::visitElements (_points, selectionA, [&meanA, &valuesA, &countExpressedA, thr](auto row, auto column, auto value)
0 commit comments