scripts.Prediction#

This script is used within the CellScanner application to predict species in coculture samples, apply gating for live/dead or debris classification, and perform heterogeneity analysis.

Key Features: - Predicts species in flow cytometry data using a trained neural network model. - Applies gating to distinguish live, inactive, and debris states based on specified thresholds. - Saves prediction and gating results, including visualizations in 3D scatter plots. - Performs heterogeneity analysis using simple and MiniBatchKMeans clustering approaches. - Generates and saves heterogeneity plots as HTML files.

Authors:
  • Ermis Ioannis Michail Delopoulos

  • Haris Zafeiropoulos

Date: 2024 - 2025

Classes#

PredictionPanel

The prediction panel of the CellScanner GUI enabling the user to provide files and parameters for predicting

WorkerPredict

Worker class for running predict() for each co-culture file loaded, and if more than one, merge the findings

Module Contents#

class scripts.Prediction.PredictionPanel(file_panel, train_panel, parent=None)#

Bases: PyQt5.QtWidgets.QWidget, scripts.GUIhelpers.GatingMixin, scripts.GUIhelpers.GatingCheckBox, scripts.GUIhelpers.LiveDeadDebrisSelectors

The prediction panel of the CellScanner GUI enabling the user to provide files and parameters for predicting co-culture data.

build_stain_inputs()#

Function to support user-labeled stains A stain needs to have: - a channel - a sign - a threshold - a label CellScanner will set the label as True when the threshold holds.

channels_on_stain_buttons()#
choose_coculture_file()#
fire_predict()#
on_error(message)#
prediction_completed()#
start_loading_cursor()#
stop_loading_cursor()#
toggle_uncertainty_filterint_options()#
update_uncertainty_threshold()#
axis_selection_label#
axis_selectors#
choose_coculture_file_button#
file_panel#
layout#
new_stain_button#
predict_panel#
predict_panel_layout#
run_prediction_button#
train_panel#
uncertainty_filtering_checkbox#
uncertainty_threshold#
uncertainty_threshold_label#
uncertainty_threshold_layout#
x_axis_selector#
y_axis_selector#
z_axis_selector#
class scripts.Prediction.WorkerPredict(PredictPanel=None)#

Bases: PyQt5.QtCore.QObject

Worker class for running predict() for each co-culture file loaded, and if more than one, merge the findings

run_predict()#

Main function to call the predict() function of CellScanner for each and every co-culture file provided

PredictPanel = None#
error_signal#
finished_signal#