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

Mz of fragments with neutral losses #573

Closed
nbisliuk opened this issue Apr 21, 2022 · 2 comments
Closed

Mz of fragments with neutral losses #573

nbisliuk opened this issue Apr 21, 2022 · 2 comments
Assignees
Labels

Comments

@nbisliuk
Copy link

Hi!
It seems fragment charge is not taken into account when removing neutral loss in .removeNeutralLoss() which is a part of .neutralLoss(). E.g. compare to pyteomics.mass.calculate_mass():

Python:

from pyteomics import mass
mass.calculate_mass(sequence = "PEPTIDE", ion_type='b', charge = 3) #  261.4570762477734
mass.calculate_mass(sequence = "PEPTIDE", ion_type='b-H2O', charge = 3) #  255.45355468654

R:

MSnbase::calculateFragments("PEPTIDEE", z=3, type="b") %>% filter(pos == 7)
        mz ion type pos z     seq
1 261.4571  b7    b   7 3 PEPTIDE
2 243.4465 b7_   b_   7 3 PEPTIDE

Should be like this, no?

loss$mz <- loss$mz - mass / loss$z
@lgatto
Copy link
Owner

lgatto commented Apr 21, 2022

ping @sgibb

@sgibb sgibb self-assigned this Apr 21, 2022
@sgibb sgibb added the bug label Apr 21, 2022
@sgibb
Copy link
Collaborator

sgibb commented Apr 21, 2022

@nbisliuk Indeed you are right! Thanks for reporting this bug (and its fix). I implemented it in the same way in cac8874

@lgatto because of this trivial fix I already pushed it into master instead of opening a PR. Unfortunately I lost track where this function is used in other packages. The patch has to be applied at least in PSMatch as well.

@sgibb sgibb closed this as completed Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants