Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for the outputaccumulator post processing. #422

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

mo-sameh
Copy link
Collaborator

Added some unit test for the ms2 quality post processing step in the output accumulator.
Mainly:

@mo-sameh mo-sameh changed the base branch from main to development January 5, 2025 14:09
@mo-sameh mo-sameh marked this pull request as ready for review January 5, 2025 14:10
@mo-sameh mo-sameh requested review from mschwoer and GeorgWa January 5, 2025 14:10
Copy link
Collaborator

@mschwoer mschwoer left a comment

Choose a reason for hiding this comment

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

LGTM!

"""
# create random correlation values between 0 and 1
fragments_shape = fragments_df.shape
fragment_correlation = np.random.rand(*fragments_shape)
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we use a fixed seed here to make the tests reproducible?
if not, it would be good to print out the generated date, otherwise debugging tests will be a nightmare

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

currently mocking the precursor_df, fragment_df and fragment correlation are completely random.
@GeorgWa do you think we can fix the seed for all of them ?

tests/unit_tests/test_outputaccumulator.py Outdated Show resolved Hide resolved
fragment_flat_df = fragment_flat_df.sort_values(by="precursor_idx")
psm_flat_df["flat_frag_start_idx"] = np.arange(0, len(psm_flat_df) * 10, 10)
psm_flat_df["flat_frag_stop_idx"] = np.arange(0, len(psm_flat_df) * 10, 10) + 9
psm_flat_df['nAA'] =psm_flat_df.sequence.str.len().astype(np.int32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

please install the pre-commit hook :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is strange, I already have them installed and ran it locally and all checks were passed.

tests/unit_tests/test_outputaccumulator.py Show resolved Hide resolved
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