From 1522fd4ae94ddf3e7a6c0136578424ed7071260d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Fri, 20 Nov 2026 09:53:45 +0100 Subject: [PATCH] docs: update outdated information and link to the dclab docs - update Python version, update opt-out, installers, GUI development, porosity definition, and viscosity model temperature ranges - document the preferences, viscosity model and LUT selection, Young's modulus plot warnings, encrypted DCOR access tokens, S3 basins, and Quick View, Filter, Plot, and Block Matrix options - link to the dclab documentation where applicable - fix: keep the "Select box filters..." button text in the Filter tab - fix: lme4 help button opens the DCscope quick guide - enh: help links for crosstalk correction and S3 basins - setup: require Python 3.10 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG | 14 ++++ README.rst | 2 +- dcscope/gui/analysis/ana_filter.py | 2 +- dcscope/gui/analysis/ana_slot.py | 2 +- dcscope/gui/analysis/ana_slot_ui.py | 6 ++ dcscope/gui/compute/comp_lme4.py | 2 +- dcscope/gui/export/e2data_ui.py | 6 +- dcscope/gui/preferences_ui.py | 5 ++ dcscope/pipeline/dataslot.py | 4 +- docs/README.md | 6 +- docs/conf.py | 4 +- docs/requirements.txt | 2 +- docs/sec_devs.rst | 25 +++--- docs/sec_getting_started.rst | 19 +++-- docs/sec_interface.rst | 124 +++++++++++++++++++++++++--- docs/sec_qg_batch_stats.rst | 13 ++- docs/sec_qg_dcor.rst | 35 +++++++- docs/sec_qg_export_data.rst | 9 +- docs/sec_qg_filtering.rst | 10 ++- docs/sec_qg_fl_crosstalk.rst | 4 +- docs/sec_qg_lme4.rst | 7 ++ docs/sec_qg_youngs_modulus.rst | 34 +++++++- docs/sec_rtdc_basics.rst | 8 +- pyproject.toml | 2 +- ui/analysis/ana_slot.ui | 13 +++ ui/export/e2data.ui | 6 +- ui/preferences.ui | 10 +++ 27 files changed, 299 insertions(+), 75 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 185bf44f..a33106d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,10 @@ skipped and listed (#208) - fix: copying the statistics in the Quick View to the clipboard raised an AttributeError (`QtWidgets.qApp` does not exist in PyQt6) + - fix: the button for selecting box filters in the Filter tab was + renamed to "Choose filters..." after editing box filters + - fix: the help button of the statistical significance dialog + opened the dclab documentation instead of the R-lme4 quick guide - enh: user-defined default settings for new plots ("Save as default" in the plot settings) and default Young's modulus viscosity model and look-up table for new datasets (preferences) (#129) @@ -34,6 +38,8 @@ - enh: show warnings about an inaccurate Young's modulus (events outside of the look-up table, temperature outside of the range of the viscosity model) in the plots (#144) + - enh: help links for fluorescence crosstalk correction (Dataset tab) + and S3 basins (preferences) - docs: add quick guide for fluorescence crosstalk correction (#120) - docs: screenshot scripts download missing datasets from figshare and use the icon theme of DCscope @@ -49,6 +55,14 @@ - docs: the legend of the fluorescence traces can be moved (#201) - docs: fix typos and grammar in the documentation, docstrings, and user interface texts + - setup: require Python 3.10 or newer (required by dclab and pyqtgraph) + - docs: update outdated information (Python version, update opt-out, + macOS installers, GUI development, porosity definition, viscosity + model temperature ranges) and document missing features (Preferences, + viscosity model and LUT selection, Young's modulus plot warnings, + encrypted DCOR access tokens, S3 basins, Quick View, Filter, Plot, + and Block Matrix options) + - docs: link to the dclab documentation where applicable 2.28.4 - setup: bump dclab to 0.73.0 (chopped image basins support) 2.28.3 diff --git a/README.rst b/README.rst index 08755daa..0fbf88a1 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ The documentation, including the code reference and examples, is available at Installation ------------ -Installers for Windows and macOS are available at the `release page `__. +Installers for Windows are available at the `release page `__. If you have Python 3 installed, you can install DCscope with diff --git a/dcscope/gui/analysis/ana_filter.py b/dcscope/gui/analysis/ana_filter.py index 2350526b..bd49f54e 100644 --- a/dcscope/gui/analysis/ana_filter.py +++ b/dcscope/gui/analysis/ana_filter.py @@ -347,7 +347,7 @@ def on_moreless(self): rc.ui.doubleSpinBox_min.setEnabled(True) rc.ui.doubleSpinBox_max.setEnabled(True) rc.ui.range_slider.setEnabled(True) - self.ui.toolButton_moreless.setText("Choose filters...") + self.ui.toolButton_moreless.setText("Select box filters...") self.ui.label_box_edit.setVisible(False) self._box_edit_view = False # Update box filter ranges diff --git a/dcscope/gui/analysis/ana_slot.py b/dcscope/gui/analysis/ana_slot.py index 4f3926c2..9ee2dd3b 100644 --- a/dcscope/gui/analysis/ana_slot.py +++ b/dcscope/gui/analysis/ana_slot.py @@ -134,7 +134,7 @@ def write_pipeline_state(self, state): self.ui.comboBox_medium.setEnabled(False) # prevent modification else: self.ui.comboBox_medium.setEnabled(True) # user-defined - # https://dclab.readthedocs.io/en/latest/sec_av_emodulus.html + # https://dclab.readthedocs.io/en/stable/sec_av_emodulus/ scenario = emodulus.get("emodulus scenario", "manual") if scenario: idx_scen = self.ui.comboBox_temp.findData(scenario) diff --git a/dcscope/gui/analysis/ana_slot_ui.py b/dcscope/gui/analysis/ana_slot_ui.py index 10fe21b0..49eb3c7c 100644 --- a/dcscope/gui/analysis/ana_slot_ui.py +++ b/dcscope/gui/analysis/ana_slot_ui.py @@ -187,6 +187,11 @@ def setupUi(self, Form): self.gridLayout_3.addWidget(self.label_from_fl3, 3, 0, 1, 1) spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_3.addItem(spacerItem3, 0, 4, 1, 1) + self.label_ct_help = QtWidgets.QLabel(parent=self.groupBox_fl_cross) + self.label_ct_help.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.label_ct_help.setOpenExternalLinks(True) + self.label_ct_help.setObjectName("label_ct_help") + self.gridLayout_3.addWidget(self.label_ct_help, 0, 5, 1, 1) self.doubleSpinBox_ct12 = QtWidgets.QDoubleSpinBox(parent=self.groupBox_fl_cross) self.doubleSpinBox_ct12.setDecimals(3) self.doubleSpinBox_ct12.setMaximum(1.0) @@ -334,6 +339,7 @@ def retranslateUi(self, Form): self.label_to_fl3.setText(_translate("Form", "to FL-3")) self.label_from_fl1.setText(_translate("Form", "from FL-1")) self.label_from_fl3.setText(_translate("Form", "from FL-3")) + self.label_ct_help.setText(_translate("Form", " help ")) self.pushButton_ct_apply_all.setToolTip(_translate("Form", "Set these crosstalk values for all datasets in the session (other changes in this tab are not applied)")) self.pushButton_ct_apply_all.setText(_translate("Form", "Apply crosstalk to all datasets")) self.groupBox_fl_labels.setToolTip(_translate("Form", "Choose user-defined labels that will be used for axes labels.")) diff --git a/dcscope/gui/compute/comp_lme4.py b/dcscope/gui/compute/comp_lme4.py index f31bbb0e..73a293fa 100644 --- a/dcscope/gui/compute/comp_lme4.py +++ b/dcscope/gui/compute/comp_lme4.py @@ -110,4 +110,4 @@ def on_close(self): def on_help(self): """Show DCscope docs""" webbrowser.open( - "https://dclab.readthedocs.io/en/stable/sec_av_lme4.html") + "https://dcscope.readthedocs.io/en/stable/sec_qg_lme4.html") diff --git a/dcscope/gui/export/e2data_ui.py b/dcscope/gui/export/e2data_ui.py index 27d8d5e7..7f0093a1 100644 --- a/dcscope/gui/export/e2data_ui.py +++ b/dcscope/gui/export/e2data_ui.py @@ -170,9 +170,9 @@ def retranslateUi(self, Dialog): self.radioButton_tsv.setText(_translate("Dialog", "tab-separated values (*.tsv)")) self.radioButton_avi.setText(_translate("Dialog", "Video file")) self.label_4.setText(_translate("Dialog", "Storage strategy:")) - self.comboBox_storage.setItemText(0, _translate("Dialog", "No basins: Store only the selected feature data (legacy behavior)")) - self.comboBox_storage.setItemText(1, _translate("Dialog", "With basins: Store features, refer to the original file (recommended)")) - self.comboBox_storage.setItemText(2, _translate("Dialog", "Basins only: Do not store features, refer to original file (fast)")) + self.comboBox_storage.setItemText(0, _translate("Dialog", "No basins: Store only selected features (legacy behavior)")) + self.comboBox_storage.setItemText(1, _translate("Dialog", "With basins: Store features, link to original data (recommended)")) + self.comboBox_storage.setItemText(2, _translate("Dialog", "Only basins: Do not store features, link to original data (fast)")) self.label_8.setText(_translate("Dialog", "Choose the video export settings below. Note that using (even) uncompressed codecs results in information loss (expect grayscale value differences up to 5). You should use exported videos for presentation purposes only.")) self.label_6.setText(_translate("Dialog", "Format")) self.comboBox_format.setItemText(0, _translate("Dialog", "AVI")) diff --git a/dcscope/gui/preferences_ui.py b/dcscope/gui/preferences_ui.py index b9414da1..ef4668da 100644 --- a/dcscope/gui/preferences_ui.py +++ b/dcscope/gui/preferences_ui.py @@ -152,6 +152,10 @@ def setupUi(self, Dialog): self.lineEdit_s3_secret_access_key.setObjectName("lineEdit_s3_secret_access_key") self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.lineEdit_s3_secret_access_key) self.verticalLayout_9.addLayout(self.formLayout_3) + self.label_s3_help = QtWidgets.QLabel(parent=self.tab_s3) + self.label_s3_help.setOpenExternalLinks(True) + self.label_s3_help.setObjectName("label_s3_help") + self.verticalLayout_9.addWidget(self.label_s3_help) spacerItem4 = QtWidgets.QSpacerItem(20, 281, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_9.addItem(spacerItem4) self.tabWidget.addTab(self.tab_s3, "") @@ -376,6 +380,7 @@ def retranslateUi(self, Dialog): self.label_9.setText(_translate("Dialog", "Secret Access Key")) self.lineEdit_s3_secret_access_key.setToolTip(_translate("Dialog", "This is the secret access key matching the Access Key ID")) self.lineEdit_s3_secret_access_key.setPlaceholderText(_translate("Dialog", "e.g. a3a4862a92643be730c946d267015e20")) + self.label_s3_help.setText(_translate("Dialog", "What are S3 basins?")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_s3), _translate("Dialog", "S3 basins")) self.label.setText(_translate("Dialog", "R executable")) self.pushButton_lme4_search.setText(_translate("Dialog", "Search manually...")) diff --git a/dcscope/pipeline/dataslot.py b/dcscope/pipeline/dataslot.py index d6add1b5..b92965c5 100644 --- a/dcscope/pipeline/dataslot.py +++ b/dcscope/pipeline/dataslot.py @@ -51,7 +51,7 @@ def __init__(self, path, identifier=None): "emodulus enabled": is_channel, # False for reservoir "emodulus lut": "LE-2D-FEM-19", "emodulus medium": "undefined", - # https://dclab.readthedocs.io/en/latest/sec_av_emodulus.html + # https://dclab.readthedocs.io/en/stable/sec_av_emodulus/ # possible values are: # - "feature": scenario A # - None: scenario B ("emodulus medium" is "other" or user-def) @@ -116,7 +116,7 @@ def _set_emodulus_config(self, dataset): """Set the Young's modulus data options The three cases in the dclab docs apply: - https://dclab.readthedocs.io/en/latest/sec_av_emodulus.html + https://dclab.readthedocs.io/en/stable/sec_av_emodulus/ """ # remove any information for key in self.config["emodulus"]: diff --git a/docs/README.md b/docs/README.md index 191c6f79..efe7865e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,8 +1,10 @@ DCscope documentation ======================= -Building the documentation of DCscope requires Python 3. -To install the requirements for building the documentation, run +Building the documentation of DCscope requires Python 3.10 or newer. +To install DCscope and the requirements for building the documentation, +run (in the `docs` directory) + pip install -e .. pip install -r requirements.txt To compile the documentation, run diff --git a/docs/conf.py b/docs/conf.py index 3c7d639d..1de02479 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -196,7 +196,7 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "python": ('https://docs.python.org/', None), - "numpy": ('http://docs.scipy.org/doc/numpy', None), + "numpy": ('https://numpy.org/doc/stable/', None), "scipy": ('https://docs.scipy.org/doc/scipy/reference/', None), - "dclab": ('http://dclab.readthedocs.io/en/stable', None), + "dclab": ('https://dclab.readthedocs.io/en/stable', None), } diff --git a/docs/requirements.txt b/docs/requirements.txt index 6fb227cb..86f16aa8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -dclab>=0.58.2 +dclab>=0.75.0 h5py matplotlib numpy diff --git a/docs/sec_devs.rst b/docs/sec_devs.rst index b9ed712c..4e1ebb26 100644 --- a/docs/sec_devs.rst +++ b/docs/sec_devs.rst @@ -81,7 +81,8 @@ GUI development =============== DCscope is based on the `Qt6 `_ framework. This means you can use `QtCreator/QtDesigner `_ -to graphically design the `.ui` files that are then loaded when starting DCscope. +to graphically design the user interface. The `.ui` files are located in the +`ui` directory in the root of the repository. We use `PyQt6` (not `PySide6`) to interface with Qt. Note that for some reason, new versions of QtDesigner produce .ui files @@ -90,17 +91,11 @@ Python code). As a result, we have to use QtCreator 8 in order for things to work (If you have a better solution, please let us know.): https://github.com/qt-creator/qt-creator/releases/tag/v8.0.2 -The .ui files are loaded directly into DCscope and are not (as it is -shown in many tutorials) converted to .py files and added to git versioning. -If this annoys you, because it makes your development experience (e.g. code -completion) unbearable: Feel free to scratch that itch and migrate DCscope -to the .py-style scheme. The only requirements for that to be merged are: - -- put all .ui files in a directory called `ui` in the root of the repository -- make sure the .ui files are included in the .tar.gz Python source distributable -- write a script that automatically converts all .ui files to .py files in - the correct locations -- exclude the automatically generated .py files from linting -- add a GitHub Action that makes sure that changes in the .ui files - are reflected in the .py files (to prevent a developer from forgetting - to build the .py files) +The .ui files are converted to Python files (`*_ui.py`) in the +corresponding locations in the `dcscope/gui` directory with the +`ui/run_uic.sh` script (which calls `pyuic6`). The generated `*_ui.py` +files are committed to the repository and excluded from linting. +Whenever you modify a .ui file, run `ui/run_uic.sh` and commit the +resulting changes in the `*_ui.py` files as well. Never edit the +`*_ui.py` files by hand, because your changes will be overwritten the +next time the script is run. diff --git a/docs/sec_getting_started.rst b/docs/sec_getting_started.rst index 4587f51e..28f22a8d 100644 --- a/docs/sec_getting_started.rst +++ b/docs/sec_getting_started.rst @@ -12,7 +12,7 @@ DCscope can be installed via multiple channels. (i.e. ``DCscope_X.Y.Z_win_64bit_setup.exe``) from the official `release page `__. -2. **Python 3.8 with pip:** DCscope can easily be installed with +2. **Python 3.10 or newer with pip:** DCscope can easily be installed with `pip `__: .. code:: bash @@ -35,16 +35,15 @@ DCscope can be installed via multiple channels. Update ====== -DCscope automatically searches for updates (you may opt out via the -Help menu) and notifies the user when a new version is available. +DCscope automatically searches for updates and notifies the user when a +new version is available. You may opt out by unchecking *Check for updates +on startup* in the *General* tab of the :ref:`preferences ` +(*Edit | Preferences*). 1. **Windows installer:** The older version of DCscope will be automatically uninstalled when installing a new version. -2. **macOS:** The older version of DCscope will be - automatically uninstalled when installing a new version. - -3. **Python 3.8 and pip:** +2. **Python 3.10 or newer with pip:** .. code:: bash @@ -61,8 +60,10 @@ If you have **.tdms-based datasets** (created using antique versions of Shape-In you can still use the data after you have converted them to .rtdc files using `DCKit `_, which provides a convenient GUI for several other RT-DC data -management tasks as well. The .rtdc file format is faster than the .tdms file -format, occupies less disk space, and consists of only one file per measurement. +management tasks as well, or using the command-line tool +:ref:`dclab-tdms2rtdc `. The .rtdc file format is +faster than the .tdms file format, occupies less disk space, and consists +of only one file per measurement. If you have **raw .rtdc files** that only contain the recorded images and no extracted events, you can perform segmentation and feature extraction using diff --git a/docs/sec_interface.rst b/docs/sec_interface.rst index 134a3304..078f7973 100644 --- a/docs/sec_interface.rst +++ b/docs/sec_interface.rst @@ -66,6 +66,11 @@ filters, or plots (left part) and allows you to hide/show the :ref:`sec_block_matrix` as well as the :ref:`sec_quick_view` and :ref:`sec_analysis_view` windows (right part). +To load datasets, use *File | Load dataset...* or the corresponding tool bar +button. Alternatively, you can drag and drop .rtdc files or directories +from your file manager onto the DCscope window. Directories are searched +recursively for .rtdc files. + .. _sec_block_matrix: @@ -95,6 +100,13 @@ filters that are applied to a dataset are called a **filter ray**. In the above example, the filter ray only consists of a single filter for each dataset. Filter rays may be different for each dataset. +To activate or deactivate an entire row or column at once, use the +toggle buttons in the headers of the Block Matrix: The toggle button of +a dataset enables or disables all filters and plots for this dataset, +the toggle button of a filter activates or deactivates the filter for +all datasets, and the toggle button of a plot includes or excludes all +datasets in this plot. + By holding down the *Shift* key while clicking on a matrix element, you can activate the :ref:`Quick View ` for the specific dataset (with filters applied up until the selected column). The block matrix @@ -126,7 +138,9 @@ Meta .... The **Meta** tab displays all metadata of the selected dataset that are stored in the original .rtdc file. Here you can check and compare -measurement and postprocessing parameters. +measurement and postprocessing parameters. The meaning of the +individual metadata keys is described in the +:ref:`dclab documentation `. .. figure:: scrots/ui_ana_meta.png :target: _images/ui_ana_meta.png @@ -147,7 +161,8 @@ a dataset. Find out more about basins in the Tables ...... The **Tables** tab allows you to visualize additional telemetry recorded -during the measurement. You can use it for quality control and to identify +during the measurement (see :ref:`tables in dclab `). +You can use it for quality control and to identify reasons for temporal trends within a dataset. .. figure:: scrots/ui_ana_tables.png @@ -168,9 +183,12 @@ Dataset ....... The **Dataset** tab allows you to specify additional metadata, such as unique colors used for plotting and -additional metadata for computing the Young's modulus or correcting -for fluorescence crosstalk (see :ref:`sec_qg_fl_crosstalk`). It also -allows you to specify fluorescence +:ref:`analysis metadata ` for computing the +Young's modulus (see :ref:`sec_qg_youngs_modulus`) or correcting +for fluorescence crosstalk (see :ref:`sec_qg_fl_crosstalk`). With the +*Apply crosstalk to all datasets* button, you can use the crosstalk +coefficients of the current dataset for all datasets of the session. +The Dataset tab also allows you to specify fluorescence channel labels that will then be used for labeling the axes of plots. .. figure:: scrots/ui_ana_slot.png @@ -180,9 +198,20 @@ channel labels that will then be used for labeling the axes of plots. Filter ...... -The **Filter** tab is used to modify the filters of the pipeline. -New box filters can be added by selecting *Choose box filters...*. +The **Filter** tab is used to modify the filters of the pipeline +(see also :ref:`filtering in dclab `). +Besides box and polygon filters, a filter can limit the number of +events (*Limit number of events to*; surplus events are removed +randomly, but in a reproducible manner) and remove events that +are nan- or inf-valued for any feature (*Remove invalid events*). +New box filters can be added by selecting *Select box filters...*. Polygon filters are created in the :ref:`sec_quick_view` window. +In the *Polygon filters* section of the Filter tab, you can also create +(*Create*) or modify (*Edit/View*) polygon filters (both open the +Quick View), duplicate them (*Duplicate*), or remove them (*Remove*). +For more information on polygon filters, please see the +:ref:`dclab documentation `. +Click *Apply* for any changes to take effect. .. figure:: scrots/ui_ana_filter.png @@ -196,16 +225,27 @@ The **Plot** tab allows you to specify all plotting parameters. Please take special note of the *Division* option in the *Layout* section (defines the arrangement of the subplots) and the *Marker hue* option in the *Scatter plot* section (allows you to specify whether the scatter -data points are colored according to a kernel density estimate (KDE), +data points are colored according to a +:ref:`kernel density estimate (KDE) `, another feature dimension, or the dataset color specified in the *Dataset* tab). In this example, contour plots are not used. +Further options in the *General* section include isoelasticity lines (for +which you can select the look-up table) and the KDE spacing used for the +contour plots, which you can determine automatically with *Find best +spacing*. If you check *default XY range* or *default KDE spacing*, the +plot range (minimum to maximum with a 5% margin) or the KDE spacing +(100 bins across the axis range) are reset when you click *Apply*. +To show only contour plots, uncheck the *Scatter plot* section. With +the *Zoom-in* option in the *Contour density plot* section, the plot +range is set to the region covered by the contours. + Use the *Save as default* button to use the current plot settings (except for the plot name, the plot ranges, and the KDE spacing) for all plots that you create in the future. You can reset these defaults -in the *General* tab of the *Edit | Preferences* dialog. There, you can -also set the default viscosity model and look-up table that are used -for computing the Young's modulus of new datasets. +in the *General* tab of the :ref:`preferences `. +There, you can also set the default viscosity model and look-up table +that are used for computing the Young's modulus of new datasets. .. figure:: scrots/ui_ana_plot.png @@ -219,10 +259,14 @@ Quick View The Quick View is meant for dataset exploration. It consists of a scatter plot on the left (left click for panning and right-click for zooming) and a set of tool panels that are accessible via the corresponding tool buttons on the right. +The title of the Quick View window shows the name of the current dataset and +the position in the filter ray up to which the filters are applied (see +:ref:`sec_block_matrix`). Use the **Plot** panel to define all plot parameters. It also displays -common statistics of the two features plotted. The drop down menus for the +:ref:`common statistics ` of the two features +plotted. The drop down menus for the `X` and `Y` axes list the available features for the current dataset. The background color for each of the features is an indicator for the feature availability: @@ -242,7 +286,14 @@ availability: The **Event** panel displays all parameters of an individual event. You can select single events by clicking in the scatter plot or by scrolling through the *Index* spin control. If available, the event image is shown alongside the -fluorescence trace of the event. If the legend of the fluorescence trace +fluorescence trace of the event. The options below the image allow you to +show the event contour (*Show contour*), to enhance the contrast (*Auto +contrast*), to zoom in to the event (*Zoom to event*), and, if the dataset +contains background images, to subtract the background (*Subtract +background*). The :ref:`fluorescence traces ` are +shown with the baseline offset (stored in the dataset metadata) added, +i.e. they show the signal from which e.g. the fluorescence maximum +is computed. If the legend of the fluorescence trace plot covers parts of the traces, you can move it by dragging it with the mouse. The checkboxes above the trace plot allow you to hide the raw traces or the traces of individual fluorescence channels. All features of the @@ -259,3 +310,50 @@ plot and the image of the event closest to the mouse pointer is displayed. .. figure:: scrots/ui_qv_poly.png :target: _images/ui_qv_poly.png :scale: 65% + + +.. _sec_preferences: + +Preferences +----------- +The preferences dialog (*Edit | Preferences*) is organized in several tabs. +Click *Apply* or *OK* to store your changes. *Restore Defaults* resets +all settings to their default values. + +General + Choose whether DCscope should check for updates on startup and set the + width of the dataset tiles in the :ref:`sec_block_matrix`. In the + *Defaults for new plots and datasets* section, you can see whether new + plots use the built-in plot settings or the user-defined settings that + you stored with the *Save as default* button in the *Plot* tab of the + :ref:`sec_analysis_view` (*Reset* restores the built-in plot settings). + You can also set the viscosity model and the look-up table that are + used by default for computing the Young's modulus of new datasets + (see :ref:`sec_qg_youngs_modulus`). + +DCOR + Set the DCOR server, your personal API key for accessing private data, + or load an encrypted DCOR access token (see :ref:`sec_qg_dcor`). + +S3 basins + Specify the access credentials (endpoint URL, access key ID, and secret + access key) for datasets with basins in an S3 object store + (see :ref:`sec_qg_dcor_s3`). You have to restart DCscope for these + settings to take effect. + +R/lme4 + Set the path to the R executable and install the lme4 R package + required for statistical significance testing (see :ref:`sec_qg_lme4`). + +Extensions + Load and manage extensions (see :ref:`sec_qg_extensions`). + +Advanced + The *Developer mode* activates unusual options, such as allowing + unencrypted connections to DCOR, visualizing basinmap features, or + advanced plot export options. The *Caching* section lets you configure + how many computed values (e.g. kernel density estimates) are kept + in memory and how much disk space DCscope may use for caching + computed values persistently. You can also change the location of + the disk cache or clear it. Changes in this tab require a restart of + DCscope. diff --git a/docs/sec_qg_batch_stats.rst b/docs/sec_qg_batch_stats.rst index 6cc73a65..60b322a7 100644 --- a/docs/sec_qg_batch_stats.rst +++ b/docs/sec_qg_batch_stats.rst @@ -7,7 +7,8 @@ Export statistical data The :ref:`Quick View window ` quantifies the statistics for the features shown there. If you need access to statistics for more features of a dataset or if you need to quantify the statistics for multiple datasets -on disk, you can use the *Statistics* tool available via the *Compute* menu. +on disk, you can use *Compute | Statistical data...*. The statistics are +computed with :ref:`dclab `. .. _qg_statistics_init: .. figure:: scrots/qg_statistics_init.png @@ -31,8 +32,14 @@ The second mode computes statistics for .rtdc data on disk (:numref:`qg_statistics_folder`). Select the *All datasets in a directory* option and (optionally) a filter ray from the current session that you would like to apply before computing the -statistics. +statistics. The directory is searched recursively for .rtdc files. +To compute statistics for machine-learning features (*ml_score_???*), +click *Search directory* in the *Machine-learning features* section. +This adds all machine-learning features found in the .rtdc files in the +directory to the feature list (which may take a while for large directory +trees). Note that statistics may not be available for all selected features in all datasets. In such a case, statistics are exported as *nan* values in the -resulting .tsv file. +resulting .tsv file. Datasets that cannot be read (e.g. broken files) +are skipped and listed in a warning message. diff --git a/docs/sec_qg_dcor.rst b/docs/sec_qg_dcor.rst index 8c6267e6..14e2d760 100644 --- a/docs/sec_qg_dcor.rst +++ b/docs/sec_qg_dcor.rst @@ -10,7 +10,8 @@ datasets online (internet connection required). In DCscope, you can access parts of the dataset (e.g. just two features) without downloading the entire data file (which includes image, contour, and traces information). This saves disk space and time when accessing -large datasets. +large datasets. For more information on how DCOR data are accessed, +please see the :ref:`dclab documentation `. .. _qg_dcor_dlg: .. figure:: scrots/qg_dcor_dlg.png @@ -23,14 +24,40 @@ In the *File* menu, choose *Load DCOR data*. A dialog .. note:: - If you need to access private data, you have to specify your - personal API key in the preferences dialog (via the *Edit* menu). + If you need to access :ref:`private data + `, you have to specify your + personal API key in the *DCOR* tab of the + :ref:`preferences ` (*Edit | Preferences*). There, you can also specify which server you wish to connect to. You can find your personal API Key in your user profile page after - you logged in (e.g. at https://dcor.mpl.mpg.de). + you logged in (e.g. at https://dcor.mpl.mpg.de, see also + :ref:`dclab:sec_av_dcor_token`). You can choose between a free text search (dataset and resource names, tags, etc.) and an identifier search (dataset and resource identifiers). After clicking the *Search* button, you may select the resources you wish to load into your session in the list view below. Then, click *Add to session* to load the data. + + +Encrypted access tokens +----------------------- +For some DCOR instances (e.g. self-hosted instances in your institute), +you might have received an encrypted access token (a *.dcor-access* file) +and a password. Click *Load an encrypted DCOR access token...* in the +*DCOR* tab of the preferences and enter the password. DCscope then +adds the server to the server list and stores the API key and the +server certificate contained in the access token. + + +.. _sec_qg_dcor_s3: + +Basins in an S3 object store +---------------------------- +Datasets may refer to :ref:`basins ` that are +stored in an :ref:`S3 object store `. Public basins +are accessed without credentials. If the basins are +:ref:`private `, you have to specify the +endpoint URL, the access key ID, and the secret access key in the +*S3 basins* tab of the preferences. +Please restart DCscope for these settings to take effect. diff --git a/docs/sec_qg_export_data.rst b/docs/sec_qg_export_data.rst index 13825599..8d85047d 100644 --- a/docs/sec_qg_export_data.rst +++ b/docs/sec_qg_export_data.rst @@ -12,8 +12,10 @@ and export the result to a file. For instance, DCscope can export your DC data t file format or to tab-separated values (.tsv) files for data analysis in other software. If you export to the .rtdc file format, you will stay in the DC ecosystem, allowing you to make use of dclab and DCscope or other software -that can interface with HDF5 data. Since DCscope 2.22.0, it is also possible -to export event images as a video file. +that can interface with HDF5 data (see also +:ref:`exporting data with dclab `). +Since DCscope 2.22.0, it is also possible to export event images as a +video file. .. _qg_export_data: .. figure:: scrots/qg_export_data.png @@ -41,7 +43,8 @@ Storage strategy Since DCscope 2.16 and with the introduction of :ref:`basins ` (which tell dclab/DCscope where to find features belonging to the same dataset in other locations) in dclab 0.58.0, you can select a storage strategy. The storage - strategy defines whether features and/or basins are stored in the output file. + strategy defines whether features and/or basins are stored in the output + file (see also :ref:`storing basins `). - No basins: This is the behavior in earlier versions of DCscope. Only the selected features are written to the .rtdc file. Use this option diff --git a/docs/sec_qg_filtering.rst b/docs/sec_qg_filtering.rst index b72e10b9..6ab82480 100644 --- a/docs/sec_qg_filtering.rst +++ b/docs/sec_qg_filtering.rst @@ -6,7 +6,13 @@ Excluding invalid events ======================== Filters can be used to exclude invalid events, such as cell debris, cell doublets or larger aggregates, or cells that are not intact, from -an analysis. +an analysis. In DCscope, you can use box filters (a range for a +feature) and polygon filters (a polygon in a scatter plot of two features) +for that purpose (see the *Filter* tab in the :ref:`sec_analysis_view`). +The implementation of :ref:`box filters ` and +:ref:`polygon filters ` is described in the +dclab documentation, as are the +:ref:`features ` mentioned below. - **Area:** @@ -36,7 +42,7 @@ an analysis. - **Porosity:** - The porosity is the ratio between measured contour and the convex contour. + The porosity is the ratio between the convex area and the measured area. Porosity is commonly used to remove events with non-physical contours, e.g. for cells, all events with a porosity above 1.05. diff --git a/docs/sec_qg_fl_crosstalk.rst b/docs/sec_qg_fl_crosstalk.rst index 20d2721e..4c078171 100644 --- a/docs/sec_qg_fl_crosstalk.rst +++ b/docs/sec_qg_fl_crosstalk.rst @@ -26,8 +26,8 @@ measured with the same setup and settings as the actual sample: (optionally) an unstained control sample. 2. Select the stained population with a filter (see :ref:`sec_qg_filtering`) and determine the median of - *FL-i maximum* and *FL-j maximum*, e.g. with the *Statistics* tool - in the *Compute* menu (see :ref:`sec_qg_batch_stats`). + *FL-i maximum* and *FL-j maximum*, e.g. with + *Compute | Statistical data...* (see :ref:`sec_qg_batch_stats`). 3. The crosstalk coefficient from channel *i* to channel *j* is the ratio of the medians, i.e. *FL-j maximum* divided by *FL-i maximum*. If unstained cells already yield a signal (offset) diff --git a/docs/sec_qg_lme4.rst b/docs/sec_qg_lme4.rst index 9e93d71f..bea0a7a4 100644 --- a/docs/sec_qg_lme4.rst +++ b/docs/sec_qg_lme4.rst @@ -7,6 +7,13 @@ Since version 2.5.0, DCscope allows you to quantify the statistical significance (p-value) when comparing two measurement groups. For this to work, you need to have R installed (tested with `R 4.1.2 `_ ). +DCscope looks for the R executable in the directories listed in the +``PATH`` environment variable (and in ``R_HOME``). If R is not found, +you can set the path to the R executable in the *R/lme4* tab of the +:ref:`preferences ` (*Edit | Preferences*). There, you +can also check whether the lme4 R package is installed and install it +(*Install...*). + The analysis uses linear mixed effects models (LMM) as described in :cite:`Herbig2018` and yields results identical to those obtained with Shape-Out 1. diff --git a/docs/sec_qg_youngs_modulus.rst b/docs/sec_qg_youngs_modulus.rst index 020409f1..90d13d0f 100644 --- a/docs/sec_qg_youngs_modulus.rst +++ b/docs/sec_qg_youngs_modulus.rst @@ -46,6 +46,17 @@ If the chip temperature is recorded for each event, then the user may select the *From feature* option (:numref:`qg_emodulus_feature`). In this case, the Young's modulus is computed from the individual viscosities for each event. +For MC-PBS media (e.g. CellCarrier and CellCarrier B), you can choose the +viscosity model (Herold 2017 :cite:`Herold2017` or +Buyukurganci 2022 :cite:`Buyukurganci2022`) next to the viscosity value. +The models are compared in the +:ref:`dclab documentation ` +(see also :ref:`this example `). +In addition, you can select the look-up table (LUT) that is used for +computing the Young's modulus (*Select LUT*). The default viscosity +model and LUT for new datasets can be set in the *General* tab of the +:ref:`preferences `. + .. _qg_emodulus_badtemp: .. figure:: scrots/qg_emodulus_badtemp.png @@ -56,8 +67,9 @@ the Young's modulus is computed from the individual viscosities for each event. If the temperature is not given as a feature or as metadata, then you may select the temperature manually. This case is visualized in :numref:`qg_emodulus_badtemp`. Here, the temperature is purposely set outside of -the known range defined in :cite:`Buyukurganci2022`, which is highlighted by -coloring the viscosity red. +the known range of the selected viscosity model (18 °C to 26 °C for +:cite:`Herold2017` and 22 °C to 37 °C for :cite:`Buyukurganci2022`), +which is highlighted by coloring the viscosity red. .. _qg_emodulus_other: .. figure:: scrots/qg_emodulus_other.png @@ -94,6 +106,8 @@ you will not be able to change the medium for a dataset if a medium is already given in its metadata. In this case, DCscope lists the datasets for which the medium was not changed. To verify the options set, you can always check the current setting via the *Analysis View* (see above). +The viscosity model and the look-up table in this dialog are +initialized with the defaults from the preferences. Validity @@ -106,6 +120,18 @@ have a *nan*-valued (not a number) Young's modulus. Note that as a result, these events will be excluded from all plots when *remove invalid events* is checked in the *Filter* configuration tab. +If the Young's modulus is shown in a plot (as an axis or as the +marker hue of the scatter plot), DCscope displays warnings in red in the +lower left corner of the plot when the results may be inaccurate: + +- *N% of events outside LUT*: For more than 10% of the events, the + Young's modulus could not be computed, because they are not covered + by the look-up table. +- *Temperature out of range*: The temperature is outside the valid range + of the selected viscosity model (see above). + +Hover over a warning with the mouse pointer to see a detailed description. + .. figure:: figures/qg_youngs_modulus_20um.png :target: _images/qg_youngs_modulus_20um.png @@ -149,5 +175,7 @@ Implementation As described above, the Young's modulus can be derived in multiple ways, for known media and global or event-based temperature values. The underlying implementation is described in the :ref:`dclab docs -`. +`. If you would like to compute the Young's modulus +in a Python script, please have a look at the +:ref:`usage section ` there. diff --git a/docs/sec_rtdc_basics.rst b/docs/sec_rtdc_basics.rst index c8634914..92697679 100644 --- a/docs/sec_rtdc_basics.rst +++ b/docs/sec_rtdc_basics.rst @@ -57,7 +57,7 @@ The porosity is often used for filtering, e.g. to Visualization of porosity. (A) The measured contour (blue line) defines the measured area (blue shade). The convex contour (red line) results in an area (red shade) that is usually larger than the measured area. - (B) The porosity is the ratio between measured and convex contour. The + (B) The porosity is the ratio between convex and measured area. The difference (the "pores") between the measured and convex areas is indicated in green. Porosity is often used to remove events with non-physical contours, e.g. for cells all events with a porosity above 1.05. @@ -122,7 +122,8 @@ hull to prevent an overestimation due to irregular, non-convex event shapes. It has been shown that the knowledge of deformation and area allows one to derive a value for elasticity in RT-DC :cite:`Mietke2015` :cite:`Mokbel2017`. As a convenient measure for elasticity, isoelasticity lines are often -employed to visualize stiffness. +employed to visualize stiffness (see also +:ref:`this example in the dclab documentation `). .. figure:: figures/deform.jpg @@ -141,7 +142,8 @@ Real-time fluorescence and deformability cytometry (RT-FDC) records, in addition to the event images, the fluorescence signal of each event :cite:`Rosendahl2018`. The raw fluorescence data consists of the one-dimensional fluorescence intensity trace from which features such -as peak fluorescence or peak width can be computed. For more advanced +as peak fluorescence or peak width can be computed (see also +:ref:`fluorescence traces in dclab `). For more advanced applications, RT-FDC also supports multiple fluorescence channels. diff --git a/pyproject.toml b/pyproject.toml index 036718aa..96bd9965 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ maintainers = [ ] description = "User interface for deformability cytometry (DC)" readme = "README.rst" -requires-python = ">=3.9, <4" +requires-python = ">=3.10, <4" keywords = ["RT-DC", "DC", "deformability", "cytometry"] classifiers = [ 'Operating System :: OS Independent', diff --git a/ui/analysis/ana_slot.ui b/ui/analysis/ana_slot.ui index 3d35f18a..4189171c 100644 --- a/ui/analysis/ana_slot.ui +++ b/ui/analysis/ana_slot.ui @@ -443,6 +443,19 @@ + + + + <a href="https://dcscope.readthedocs.io/en/stable/sec_qg_fl_crosstalk.html"> help </a> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + diff --git a/ui/export/e2data.ui b/ui/export/e2data.ui index a54e0e2c..a36010f3 100644 --- a/ui/export/e2data.ui +++ b/ui/export/e2data.ui @@ -188,17 +188,17 @@ - No basins: Store only the selected feature data (legacy behavior) + No basins: Store only selected features (legacy behavior) - With basins: Store features, refer to the original file (recommended) + With basins: Store features, link to original data (recommended) - Basins only: Do not store features, refer to original file (fast) + Only basins: Do not store features, link to original data (fast) diff --git a/ui/preferences.ui b/ui/preferences.ui index cdfb65ff..3f81e8e2 100644 --- a/ui/preferences.ui +++ b/ui/preferences.ui @@ -342,6 +342,16 @@ + + + + <a href="https://dcscope.readthedocs.io/en/stable/sec_qg_dcor.html#sec-qg-dcor-s3">What are S3 basins?</a> + + + true + + +