Skip to content

Comments

Feature: add exporting "score_peptide" and "score_protein" from .osw#159

Merged
singjc merged 4 commits intoPyProphet:masterfrom
Roestlab:export_scored_oswpq
Aug 22, 2025
Merged

Feature: add exporting "score_peptide" and "score_protein" from .osw#159
singjc merged 4 commits intoPyProphet:masterfrom
Roestlab:export_scored_oswpq

Conversation

@jcharkow
Copy link
Contributor

Currently exporting .osw to .oswpq does not include protein and peptide scores/pep/qvalues. This functionality is important when have a pre-analyzed .osw files that we want to convert to .oswpq for easier data access (e.g. in massdash)

This was tested with the test.osw file in massdash (file path /test/test_data/example_dia/openswath/osw) and seems to yield expected results.

Copy link
Contributor

@singjc singjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding! I just made a minor suggestion which you can commit, for snakecase syntax. Just double check in case I missed one, we can the merge afterwards.


# Non-global contexts pivot query
if pivot_cols_str: # Only if there are non-global contexts
nonGlobal_query = f"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nonGlobal_query = f"""
non_global_query = f"""

Convert to snakecase for consistency.

"""
else:
# If no non-global contexts, create empty result with same structure
nonGlobal_query = f"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nonGlobal_query = f"""
non_global_query = f"""

g.{score_table}_GLOBAL_PVALUE,
g.{score_table}_GLOBAL_QVALUE,
g.{score_table}_GLOBAL_PEP
FROM ({nonGlobal_query}) ng
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FROM ({nonGlobal_query}) ng
FROM ({non_global_query}) ng

"""
elif pivot_cols_str and not global_exists:
# Only non-global contexts exist
merged_query = nonGlobal_query
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
merged_query = nonGlobal_query
merged_query = non_global_query

change to snakecase syntax
@jcharkow
Copy link
Contributor Author

Thanks for the quick review, addressed the comments (you did not miss any cases) so I think it is ready to merge.

@singjc singjc merged commit 6be5a57 into PyProphet:master Aug 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants