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

Update adducts regex #211

Open
Adafede opened this issue Jul 3, 2024 · 3 comments
Open

Update adducts regex #211

Adafede opened this issue Jul 3, 2024 · 3 comments

Comments

@Adafede
Copy link

Adafede commented Jul 3, 2024

Dear all,

I think the current regex does not allow to parse some complex types of adducts, being mixes of isotopomers and adducts.

Part of what I would like to address is described in the last lines of https://skyline.ms/wiki/home/software/Skyline/page.view?name=adduct_descriptions ("Charge-Only Examples with Isotope Labels Described Only by Mass")

and it would be great to account for things like [13C3]C3H12O6 at the same time.

I think many of us got some slight different flavors of regex internally, so eventually let's discuss about the perfect only one? 😄

I will start with an attempt: \\[(\\d*)M(?![a-z])(\\d*)([+-][\\w\\d].*)?.*\\](\\d*)([+-])?

@nilshoffmann

@nilshoffmann
Copy link
Member

  • Check that description about relation between adduct formula, charge and reported m/z (experimental) is clear in the specification.
  • Create test cases to check the regular expression, the final experimental mass etc.
  • Update the specification.
  • Add Adriano as a contributor for mzTab-M 2.1.0

@Adafede
Copy link
Author

Adafede commented Jul 14, 2024

@nilshoffmann If you point me to where you expect the tests to be, I am happy to help writing them (or their first version)

@nilshoffmann
Copy link
Member

@Adafede
The Regexp is part of the constants in the JAVA parser/writer implementation:
https://github.com/lifs-tools/jmzTab-m/blob/master/api/src/main/java/uk/ac/ebi/pride/jmztab2/model/MZTabConstants.java#L75C1-L75C87

The corresponding test is here:
https://github.com/lifs-tools/jmzTab-m/blob/master/io/src/test/java/org/lifstools/mztab2/ParsingPrimitivesTest.java#L41

Happy to take any pull requests.
Please note that JAVA Regexps need additional escaping to work, e.g. \ instead of , but the code for the pattern in MZTabConstants should contain the original regexp along with the JAVA version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants