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

More graceful handling of libraries containing nonsensical entries (e.g. water loss on molecule containing no oxygen atoms) #3107

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

bspratt
Copy link
Member

@bspratt bspratt commented Aug 7, 2024

In https://skyline.ms/announcements/home/issues/exceptions/thread.view?entityId=14a60bd2-3604-103d-a666-22f53556a042&_anchor=65275 a call to ViewLibraryDlg.AddAllPeptides with an water loss adduct on a molecule with no O in it throws an exception. Instead, let's just skip it and put a warning in the immediate window. (Ideally it wouldn't be in the library in the first place, but we don't have any data on how the library was created)

Note that a water loss is tolerated for molecules described as mass only (we just deduct the mass of H2O), but when there's a chemical formula available the adduct really needs to make sense.

…xceptions/thread.view?entityId=14a60bd2-3604-103d-a666-22f53556a042&_anchor=65275 a call to ViewLibraryDlg.AddAllPeptides with an water loss adduct on a molecule with no O in it throws an exception. Instead, let's just skip it and put a warning in the immediate window. (Ideally it wouldn't be in the library in the first place, but we don't have any data on how the library was created)
@nickshulman
Copy link
Contributor

"PeptideTipProvider" is where we have been trying to put the code that informs the user that there is something wrong with the library entry.
The user will see that the entry in the Library Explorer does not have an icon next to it, and when they hover over it they will see a tooltip which could explain the problem.

@bspratt
Copy link
Member Author

bspratt commented Aug 10, 2024

"PeptideTipProvider" is where we have been trying to put the code that informs the user that there is something wrong with the library entry. The user will see that the entry in the Library Explorer does not have an icon next to it, and when they hover over it they will see a tooltip which could explain the problem.

Excellent, I'll add a check for adduct applicability there.

public class InvalidChemicalModificationException : IOException
which is thrown when a loss would remove more atoms than are found in a molecular formula e.g. water loss from C2S5H12 (no oxygen), or label would change more atoms than are in the formula e.g. 3C' on C2S5H12

We now catch this exception in LibraryExplorer and adjust display accordingly
@bspratt
Copy link
Member Author

bspratt commented Aug 14, 2024

image

@bspratt
Copy link
Member Author

bspratt commented Aug 14, 2024

Hmm, just noticed that the bad precursor gets neither the protein nor the molecule icon. Should it get the molecule anyway, or maybe some kind of alarm icon?

@nickshulman
Copy link
Contributor

Hmm, just noticed that the bad precursor gets neither the protein nor the molecule icon. Should it get the molecule anyway, or maybe some kind of alarm icon?

Anything that has an error is supposed to get no icon.
In the Library Explorer tutorial it says:

Some of the listed peptides show a peptide icon to the left of the sequence, while others do not. The
icon indicates that the current document modification settings match the modified state of the peptide
in the library.

@bspratt
Copy link
Member Author

bspratt commented Sep 24, 2024

@nickshulman can you give this the blessing? Thanks

@bspratt
Copy link
Member Author

bspratt commented Oct 8, 2024

Brendan had a couple of changes - show the spectra anyway, and make the explanation prominent:

image

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