diff --git a/CHANGELOG b/CHANGELOG index a33106d..3d54daa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,8 @@ 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 + - fix: the "What are encrypted tokens?" link in the DCOR preferences + could not be clicked - 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) @@ -40,6 +42,13 @@ the viscosity model) in the plots (#144) - enh: help links for fluorescence crosstalk correction (Dataset tab) and S3 basins (preferences) + - enh: list the Young's modulus media with the names used by dclab + (no aliases) and the product name as a hint (e.g. "0.49% MC-PBS + (CellCarrier)") + - enh: use the same viscosity model names ("Buyukurganci (2022)", + "Herold (2017)") in the Dataset tab, bulk action, and preferences + - enh: tooltips for the polygon filter button in the Quick View and + the isoelasticity line look-up table selection - docs: add quick guide for fluorescence crosstalk correction (#120) - docs: screenshot scripts download missing datasets from figshare and use the icon theme of DCscope @@ -63,6 +72,7 @@ encrypted DCOR access tokens, S3 basins, Quick View, Filter, Plot, and Block Matrix options) - docs: link to the dclab documentation where applicable + - docs: remove outdated QtCreator version requirement 2.28.4 - setup: bump dclab to 0.73.0 (chopped image basins support) 2.28.3 diff --git a/dcscope/gui/analysis/ana_plot_ui.py b/dcscope/gui/analysis/ana_plot_ui.py index c181889..418a10f 100644 --- a/dcscope/gui/analysis/ana_plot_ui.py +++ b/dcscope/gui/analysis/ana_plot_ui.py @@ -467,6 +467,7 @@ def retranslateUi(self, Form): self.label_17.setText(_translate("Form", "Y")) self.toolButton_spacing_find_best.setText(_translate("Form", "Find best spacing")) self.checkBox_isoelastics.setText(_translate("Form", "Isoelasticity lines")) + self.comboBox_lut.setToolTip(_translate("Form", "Look-up table for the isoelasticity lines")) self.label_18.setText(_translate("Form", "After clicking apply, set:")) self.toolButton_auto_xy_range.setToolTip(_translate("Form", "from minimum to maximum with 5% margin")) self.toolButton_auto_xy_range.setText(_translate("Form", "default XY range")) diff --git a/dcscope/gui/analysis/ana_slot.py b/dcscope/gui/analysis/ana_slot.py index 9ee2dd3..6c0aeee 100644 --- a/dcscope/gui/analysis/ana_slot.py +++ b/dcscope/gui/analysis/ana_slot.py @@ -2,12 +2,13 @@ import dclab from dclab.features.emodulus.viscosity import ( - ALIAS_MEDIA, KNOWN_MEDIA, TemperatureOutOfRangeWarning + ALIAS_MEDIA, KNOWN_MEDIA, SAME_MEDIA, TemperatureOutOfRangeWarning ) import numpy as np from PyQt6 import QtCore, QtWidgets from ... import meta_tool +from .. import defaults from .ana_slot_ui import Ui_Form from .dlg_slot_reorder import DlgSlotReorder @@ -125,7 +126,11 @@ def write_pipeline_state(self, state): self._update_emodulus_temp_choices() emodulus = state["emodulus"] self.ui.groupBox_emod.setVisible(emodulus["emodulus enabled"]) - idx_med = self.ui.comboBox_medium.findData(emodulus["emodulus medium"]) + medium = emodulus["emodulus medium"] + idx_med = self.ui.comboBox_medium.findData(medium) + if idx_med == -1 and medium in ALIAS_MEDIA: + # alias of a medium (e.g. "CellCarrier" from older sessions) + idx_med = self.ui.comboBox_medium.findData(ALIAS_MEDIA[medium]) if idx_med == -1: # empty medium string idx_med = self.ui.comboBox_medium.findData("other") self.ui.comboBox_medium.setCurrentIndex(idx_med) @@ -208,16 +213,14 @@ def get_dataset_choices_medium(ds): else: medium = "undefined" if medium in KNOWN_MEDIA: + # The medium is defined in the metadata and cannot be changed. valid_media = [medium] else: - valid_media = KNOWN_MEDIA + [medium, "other", "undefined"] + # Only offer the media names preferred by dclab (no aliases). + valid_media = list(SAME_MEDIA) + [medium, "other", "undefined"] choices = [] - for vm in valid_media: - if vm == "CellCarrierB": - name = "CellCarrier B" # [sic] - else: - name = vm - choices.append([name, vm]) + for vm in dict.fromkeys(valid_media): # remove duplicates + choices.append([defaults.get_emodulus_medium_name(vm), vm]) return choices @staticmethod @@ -295,9 +298,7 @@ def _update_emodulus_visc_model_choices(self): self.ui.comboBox_visc_model.blockSignals(True) self.ui.comboBox_visc_model.clear() - choices = {"Herold (2017)": "herold-2017", - "Buyukurganci (2022)": "buyukurganci-2022"} - for name, data in choices.items(): + for name, data in defaults.EMODULUS_VISC_MODELS.items(): self.ui.comboBox_visc_model.addItem(name, data) self.ui.comboBox_visc_model.blockSignals(False) diff --git a/dcscope/gui/bulk/bulk_emodulus.py b/dcscope/gui/bulk/bulk_emodulus.py index 99105a0..a2e3f61 100644 --- a/dcscope/gui/bulk/bulk_emodulus.py +++ b/dcscope/gui/bulk/bulk_emodulus.py @@ -34,13 +34,8 @@ def __init__(self, parent, pipeline, *args, **kwargs): self.ui.comboBox_medium.clear() self.ui.comboBox_medium.addItem("Other", "other") for name in SAME_MEDIA: - for sk in SAME_MEDIA[name]: - if sk.count("Cell"): # just add CellCarrier information - info = f" ({sk})" - break - else: - info = "" - self.ui.comboBox_medium.addItem(name + info, name) + self.ui.comboBox_medium.addItem( + defaults.get_emodulus_medium_name(name), name) self.ui.comboBox_medium.addItem("Not defined", "undefined") self.ui.comboBox_medium.addItem("Unchanged", "unchanged") @@ -60,9 +55,8 @@ def __init__(self, parent, pipeline, *args, **kwargs): emod_defaults = defaults.get_emodulus_defaults(QtCore.QSettings()) self.ui.comboBox_visc_model.clear() - self.ui.comboBox_visc_model.addItem("buyukurganci-2022", - "buyukurganci-2022") - self.ui.comboBox_visc_model.addItem("herold-2017", "herold-2017") + for name, data in defaults.EMODULUS_VISC_MODELS.items(): + self.ui.comboBox_visc_model.addItem(name, data) self.ui.comboBox_visc_model.setCurrentIndex( self.ui.comboBox_visc_model.findData( emod_defaults["emodulus viscosity model"])) @@ -96,7 +90,7 @@ def on_ok(self): # Tell the user that the medium of some datasets was not # changed (#124). names = "\n".join( - f"- {name} ({medium})" for name, medium in skipped) + f"- {name}: {medium}" for name, medium in skipped) QtWidgets.QMessageBox.warning( self, "Medium not changed for some datasets", diff --git a/dcscope/gui/defaults.py b/dcscope/gui/defaults.py index 9baa806..acae1cd 100644 --- a/dcscope/gui/defaults.py +++ b/dcscope/gui/defaults.py @@ -4,6 +4,7 @@ import logging import dclab +from dclab.features.emodulus.viscosity import ALIAS_MEDIA from PyQt6 import QtCore from ..pipeline.plot import DEFAULT_STATE as PLOT_DEFAULT_STATE @@ -25,6 +26,24 @@ EMODULUS_VISC_MODELS = {"Buyukurganci (2022)": "buyukurganci-2022", "Herold (2017)": "herold-2017"} +#: product names of MC-PBS media shown as a hint next to the medium name +EMODULUS_MEDIUM_HINTS = {"0.49% MC-PBS": "CellCarrier", + "0.59% MC-PBS": "CellCarrierB"} + + +def get_emodulus_medium_name(medium): + """Return the medium name preferred by dclab for display + + Aliases (e.g. "CellCarrier") are replaced by the name preferred + by dclab (e.g. "0.49% MC-PBS") and the product name is appended + as a hint (e.g. "0.49% MC-PBS (CellCarrier)"). Unknown media + are returned unchanged. + """ + name = ALIAS_MEDIA.get(medium, medium) + hint = EMODULUS_MEDIUM_HINTS.get(name) + return f"{name} ({hint})" if hint else name + + #: plot state keys that depend on a specific plot or on the data #: and are thus not stored as defaults PLOT_STATE_EXCLUDED = { diff --git a/dcscope/gui/preferences_ui.py b/dcscope/gui/preferences_ui.py index ef4668d..69f697c 100644 --- a/dcscope/gui/preferences_ui.py +++ b/dcscope/gui/preferences_ui.py @@ -115,6 +115,7 @@ def setupUi(self, Dialog): self.pushButton_enc_token.setObjectName("pushButton_enc_token") self.horizontalLayout_2.addWidget(self.pushButton_enc_token) self.label_6 = QtWidgets.QLabel(parent=self.tab_dcor) + self.label_6.setOpenExternalLinks(True) self.label_6.setObjectName("label_6") self.horizontalLayout_2.addWidget(self.label_6) self.verticalLayout_4.addLayout(self.horizontalLayout_2) diff --git a/dcscope/gui/quick_view/qv_main_ui.py b/dcscope/gui/quick_view/qv_main_ui.py index bff8279..3b8f3e0 100644 --- a/dcscope/gui/quick_view/qv_main_ui.py +++ b/dcscope/gui/quick_view/qv_main_ui.py @@ -581,6 +581,7 @@ def retranslateUi(self, Form): self.toolButton_settings.setText(_translate("Form", "S")) self.toolButton_event.setToolTip(_translate("Form", "Event")) self.toolButton_event.setText(_translate("Form", "E")) + self.toolButton_poly.setToolTip(_translate("Form", "Polygon filters")) self.toolButton_poly.setText(_translate("Form", "P")) self.label_7.setText(_translate("Form", "
Plot
")) self.label.setText(_translate("Form", "X")) @@ -594,6 +595,7 @@ def retranslateUi(self, Form): self.checkBox_downsample.setText(_translate("Form", "Downsampling")) self.spinBox_downsample.setSuffix(_translate("Form", " events")) self.checkBox_isoelastics.setText(_translate("Form", "Show isoelasticity lines")) + self.comboBox_lut.setToolTip(_translate("Form", "Look-up table for the isoelasticity lines")) self.checkBox_hue.setText(_translate("Form", "Colorize markers")) self.comboBox_hue.setItemText(0, _translate("Form", "KDE")) self.comboBox_hue.setItemText(1, _translate("Form", "Feature")) diff --git a/docs/scrots/make_scrots_qg_emodulus.py b/docs/scrots/make_scrots_qg_emodulus.py index 44515cf..ce1a9bf 100644 --- a/docs/scrots/make_scrots_qg_emodulus.py +++ b/docs/scrots/make_scrots_qg_emodulus.py @@ -45,19 +45,19 @@ wsl.ui.groupBox_emod.setFixedSize(420, 140) wsl.ui.comboBox_medium.setCurrentIndex( - wsl.ui.comboBox_medium.findData("CellCarrier")) + wsl.ui.comboBox_medium.findData("0.49% MC-PBS")) wsl.ui.comboBox_temp.setCurrentIndex(wsl.ui.comboBox_temp.findData("config")) app.processEvents(QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 300) wsl.ui.groupBox_emod.grab().save("_qg_emodulus_config.png") wsl.ui.comboBox_medium.setCurrentIndex( - wsl.ui.comboBox_medium.findData("CellCarrier")) + wsl.ui.comboBox_medium.findData("0.49% MC-PBS")) wsl.ui.comboBox_temp.setCurrentIndex(wsl.ui.comboBox_temp.findData("feature")) app.processEvents(QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 300) wsl.ui.groupBox_emod.grab().save("_qg_emodulus_feature.png") wsl.ui.comboBox_medium.setCurrentIndex( - wsl.ui.comboBox_medium.findData("CellCarrier")) + wsl.ui.comboBox_medium.findData("0.49% MC-PBS")) wsl.ui.comboBox_temp.setCurrentIndex(wsl.ui.comboBox_temp.findData("manual")) wsl.ui.doubleSpinBox_temp.setValue(38) app.processEvents(QtCore.QEventLoop.ProcessEventsFlag.AllEvents, 300) diff --git a/docs/sec_devs.rst b/docs/sec_devs.rst index 4e1ebb2..2496264 100644 --- a/docs/sec_devs.rst +++ b/docs/sec_devs.rst @@ -85,12 +85,6 @@ 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 -that are incompatible with `pyuic6` (which converts the .ui files into -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 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` diff --git a/docs/sec_qg_youngs_modulus.rst b/docs/sec_qg_youngs_modulus.rst index 90d13d0..92ee115 100644 --- a/docs/sec_qg_youngs_modulus.rst +++ b/docs/sec_qg_youngs_modulus.rst @@ -36,8 +36,11 @@ The parameters for computing the Young's modulus can be set in the *Dataset* tab of the :ref:`Analysis View