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

remove_unused_fragments bug fix #270

Closed
wants to merge 2 commits into from

Conversation

CRYoushiwo
Copy link

fix #269

from alphabase.peptide.fragment import remove_unused_fragments


def example_remove_unused_fragments():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use pytest, see other py files in the tests folder

Copy link
Author

Choose a reason for hiding this comment

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

got it

frag_idx = precursor_df[[frag_start_col, frag_stop_col]].values

new_frag_idx, fragment_pointer = compress_fragment_indices(frag_idx)

precursor_df[[frag_start_col, frag_stop_col]] = new_frag_idx
precursor_df = precursor_df.sort_index()
Copy link
Collaborator

Choose a reason for hiding this comment

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

sort_index() is to keep the original order of returned precursr_df as the input precursor_df. May be it is fine to keep this here.

Copy link
Author

Choose a reason for hiding this comment

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

You're right; the original order should be preserved.

@CRYoushiwo CRYoushiwo closed this Jan 9, 2025
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