Skip to content

Commit

Permalink
Merge pull request #82 from xomicsdatascience/dev
Browse files Browse the repository at this point in the history
updated pyproject.toml version
  • Loading branch information
CCranney authored Jun 21, 2024
2 parents 4313beb + c05118e commit 1ccd2e8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
]
Expand All @@ -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',
Expand Down
27 changes: 18 additions & 9 deletions src/zodiaq/gui/windows/tabs/ScoringTabWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.")
Expand Down
9 changes: 5 additions & 4 deletions src/zodiaq/identification/identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
6 changes: 3 additions & 3 deletions src/zodiaq/scoring/idpickerFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1ccd2e8

Please sign in to comment.