Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A fix for #406
This might be a good place to explain what was going on:
From my experiences, in peptdeep when using the prediction functionality directly from the model class (instead of using predict_all in the model manager), it expects the precursors to be sorted by nAA. If they aren’t sorted, you end up with an all-zero fragments dataframe. That’s why I added the df_refinement step in this PR to handle this issue.
When the precursors are sorted by nAA, PeptDeep drops the old fragment indices and reinitializes them (in-place) based on the refined precursors. This caused problems when trying to compare predictions with a ground truth. This part of the issue was already handled but I wanted to explain why we are doing multiple preprocessing steps before prediction, and this commit specifically fixes the nAA sorting-related problem.
This should address both issues and ensure things work as expected.