Skip to content

Conversation

@robinschmid
Copy link
Member

@robinschmid robinschmid commented Apr 6, 2023

Added many tests and handle now many more cases for ion parsing

will parse in this order

  • find known adducts/neutral losses
  • try by formula to get mass
  • add as a string if nothing else matches

charge is always retained by just adding or removing electrons to make up for adduct modifications where we do not know the charge.

M+Fe]+2 -- we do not know the charge of Fe here but we just calc the mass and then remove 2 electrons from it

@robinschmid robinschmid requested a review from SteffenHeu April 6, 2023 11:18
Copy link
Member

@SteffenHeu SteffenHeu left a comment

Choose a reason for hiding this comment

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

Looks good, i guess it works as expected?

Some minor comments


import org.jetbrains.annotations.NotNull;

public class StringUtils {
Copy link
Member

Choose a reason for hiding this comment

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

Looks more like an IonParsingUtils class. rename and move to that package?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its more a general StringUtils. Its mostly to grab a number that is within string or is suffix / prefix.

then some stuffed to also look for +- to also get negative / positive numbers

@robinschmid
Copy link
Member Author

The tests run smoothly

@SteffenHeu SteffenHeu merged commit 89fb4c7 into mzmine:master Apr 12, 2023
@robinschmid robinschmid deleted the ion_parsing_improved branch January 8, 2024 16:52
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