From 604a287eca333dd537054b9450a8a67e25dd9aac Mon Sep 17 00:00:00 2001 From: CCranney <11773171+CCranney@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:24:28 -0700 Subject: [PATCH 1/3] updated version in pyproject.toml file --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fe63ecc..db4334f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "zoDIAq" -version = "2.0.0" +version = "2.1.2" authors = [ { name="Caleb Cranney", email="caleb.cranney.github@proton.me" }, ] From 5cc037c8086cd94c044b63e87b1d0be38d76bb50 Mon Sep 17 00:00:00 2001 From: CCranney <11773171+CCranney@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:32:06 -0700 Subject: [PATCH 2/3] ran python black --- .../gui/windows/tabs/ScoringTabWindow.py | 27 ++++++++++++------- src/zodiaq/identification/identifier.py | 9 ++++--- src/zodiaq/scoring/idpickerFunctions.py | 6 ++--- .../MaccScoresBreakdown.py | 6 ++--- .../test_outputFormattingFunctions.py | 2 +- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/zodiaq/gui/windows/tabs/ScoringTabWindow.py b/src/zodiaq/gui/windows/tabs/ScoringTabWindow.py index 4f46a72..7844f0b 100644 --- a/src/zodiaq/gui/windows/tabs/ScoringTabWindow.py +++ b/src/zodiaq/gui/windows/tabs/ScoringTabWindow.py @@ -18,9 +18,9 @@ def set_setting_layout(self, settingLayout): def set_args(self) -> list: args = ["score"] args.extend(self.get_arg_from_text_field_if_present(self.idOutputDir, "-i")) - args.extend(['-p', self.proteinQuantificationMethodComboBox.currentText()]) - if self.proteinQuantificationMethodComboBox.currentText() == 'maxlfq': - args.extend(['-min', self.maxlfqMinNumMatchesComboBox.currentText()]) + args.extend(["-p", self.proteinQuantificationMethodComboBox.currentText()]) + if self.proteinQuantificationMethodComboBox.currentText() == "maxlfq": + args.extend(["-min", self.maxlfqMinNumMatchesComboBox.currentText()]) return args def check_args_for_invalid_input(self, args): @@ -49,16 +49,25 @@ def add_identification_output_directory_field(self, fileLayout): fileLayout.addRow(self.idOutputDir) def add_protein_quantification_method_combobox(self, settingLayout): - self.proteinQuantificationMethodText = QLabel("protein quantification method (if applicable):") + self.proteinQuantificationMethodText = QLabel( + "protein quantification method (if applicable):" + ) self.proteinQuantificationMethodComboBox = QComboBox() - self.proteinQuantificationMethodComboBox.addItems(['maxlfq', 'sum']) + self.proteinQuantificationMethodComboBox.addItems(["maxlfq", "sum"]) - self.maxlfqMinNumMatchesText = QLabel("minimum number of matching peptides between samples (only for 'maxlfq' method):") + self.maxlfqMinNumMatchesText = QLabel( + "minimum number of matching peptides between samples (only for 'maxlfq' method):" + ) self.maxlfqMinNumMatchesComboBox = QComboBox() - self.maxlfqMinNumMatchesComboBox.addItems(['2', '1']) + self.maxlfqMinNumMatchesComboBox.addItems(["2", "1"]) - settingLayout.addRow(self.proteinQuantificationMethodText, self.proteinQuantificationMethodComboBox) - settingLayout.addRow(self.maxlfqMinNumMatchesText, self.maxlfqMinNumMatchesComboBox) + settingLayout.addRow( + self.proteinQuantificationMethodText, + self.proteinQuantificationMethodComboBox, + ) + settingLayout.addRow( + self.maxlfqMinNumMatchesText, self.maxlfqMinNumMatchesComboBox + ) def add_no_setting_disclaimer_field(self, settingLayout): disclaimerText = QLabel("No settings currently implemented for the score step.") diff --git a/src/zodiaq/identification/identifier.py b/src/zodiaq/identification/identifier.py index 76e4617..2327717 100644 --- a/src/zodiaq/identification/identifier.py +++ b/src/zodiaq/identification/identifier.py @@ -166,10 +166,11 @@ def _apply_correction_to_match_dataframe(self, matchDf): matchDf["ppmDifference"], self._commandLineArgs["correctionDegree"] ) toleranceMinimumCutoff = 5 - if not self._commandLineArgs["correctionDegree"] and tolerance < toleranceMinimumCutoff: - _, tolerance = calculate_ppm_offset_tolerance( - matchDf["ppmDifference"], 0.5 - ) + if ( + not self._commandLineArgs["correctionDegree"] + and tolerance < toleranceMinimumCutoff + ): + _, tolerance = calculate_ppm_offset_tolerance(matchDf["ppmDifference"], 0.5) queryFile = self._queryContext.filePath.split("/")[-1] outFile = os.path.splitext(queryFile)[0] + "_correctionHistogram.png" if self._commandLineArgs["histogram"]: diff --git a/src/zodiaq/scoring/idpickerFunctions.py b/src/zodiaq/scoring/idpickerFunctions.py index c839f3e..23ddc34 100644 --- a/src/zodiaq/scoring/idpickerFunctions.py +++ b/src/zodiaq/scoring/idpickerFunctions.py @@ -219,9 +219,9 @@ def reduce__identify_minimum_number_of_most_connected_proteins( """ leadingProteins = set() for _, clusterDf in peptideProteinConnectionsDf.groupby("cluster"): - clusterDf[ - "originalProteinCount" - ] = label_proteins_by_original_protein_count_for_breaking_ties(clusterDf) + clusterDf["originalProteinCount"] = ( + label_proteins_by_original_protein_count_for_breaking_ties(clusterDf) + ) ( sortedClusterDf, initialAcceptedProteins, diff --git a/tests/system/system_tests/scoring/testFileContentCreators/MaccScoresBreakdown.py b/tests/system/system_tests/scoring/testFileContentCreators/MaccScoresBreakdown.py index 4cb8f95..7060dd3 100644 --- a/tests/system/system_tests/scoring/testFileContentCreators/MaccScoresBreakdown.py +++ b/tests/system/system_tests/scoring/testFileContentCreators/MaccScoresBreakdown.py @@ -97,9 +97,9 @@ def _make_expected_protein_output(self, peptideDf): proteinDf = peptideDf.copy() proteinDf = proteinDf.reindex(list(proteinDf.index) + [1]).sort_index() leadingProteins = list(proteinDf["protein"]) - leadingProteins[ - : len(self.idPickerLeadingProteins) - ] = self.idPickerLeadingProteins + leadingProteins[: len(self.idPickerLeadingProteins)] = ( + self.idPickerLeadingProteins + ) proteinDf["leadingProtein"] = leadingProteins proteinDf["proteinCosine"] = proteinDf["cosine"] numUniqueLeadingProteins = len(set(self.idPickerLeadingProteins)) diff --git a/tests/unit/identification/test_outputFormattingFunctions.py b/tests/unit/identification/test_outputFormattingFunctions.py index ccd4253..aed57ea 100644 --- a/tests/unit/identification/test_outputFormattingFunctions.py +++ b/tests/unit/identification/test_outputFormattingFunctions.py @@ -48,7 +48,7 @@ def test__output_formatting_functions__format_output_line(identifierOutputData): "peaksCount": 5, "CV": 6, "windowWidth": 7, - "retentionTime":12, + "retentionTime": 12, } matchDict = { "cosineSimilarityScore": 8, From c05118e5d66ad77090a7a9e9d04a840321c9c44c Mon Sep 17 00:00:00 2001 From: CCranney <11773171+CCranney@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:00:50 -0700 Subject: [PATCH 3/3] pyopenms breaks with numpy > 2.0. Temporarily requiring numpy be less than 2.0. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index db4334f..919284e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ 'pyteomics>=4.4.1', 'matplotlib>=3.3.4', 'numba>=0.53.1', - 'numpy>=1.20.1', + 'numpy<2.0', 'pandas>=1.2.2', 'Bio>=0.4.1', 'PyQt5>=5.15.4',