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

FIX numerical stabilty for small intensities #161

Merged
merged 1 commit into from
May 22, 2024

Conversation

GeorgWa
Copy link
Collaborator

@GeorgWa GeorgWa commented May 22, 2024

Very small intensities (~1e6) lead to misscalculation of mz values.
Fixed and documented for the future.

@GeorgWa GeorgWa requested a review from mschwoer May 22, 2024 08:47
@GeorgWa GeorgWa marked this pull request as ready for review May 22, 2024 08:47
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

) / (accumulated_intensity + new_intensity + 1e-6)
+ LOW_EPSILON
) / (accumulated_intensity + new_intensity + LOW_EPSILON)

else:
new_error = (
(new_mz_value - mz_query_list[k])
Copy link
Collaborator

Choose a reason for hiding this comment

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

in l.660 there's another magic number 10**6, mb introduce a constant also for this guy?

@@ -633,14 +643,16 @@ def get_dense(
accumulated_dim1 = dense_output[1, k, j, 0, i]

new_intensity = self.intensity_values[idx]
new_intensity = new_intensity * (new_intensity > HIGH_EPSILON)
Copy link
Collaborator

Choose a reason for hiding this comment

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

intensity? mz_value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it can be ppm or absolute masses, depending on the setting

@GeorgWa GeorgWa merged commit 40afbf5 into development May 22, 2024
5 checks passed
@GeorgWa GeorgWa deleted the numerical-stability branch May 22, 2024 16:15
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