We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
2M-H+2NH4
I suspect there is a problem in the parsing of the ion part of the adduct leading to an error in the computation of the mass for 2M-H+2NH4.
Steps to reproduce, if you run
import pandas as pd from msac.calculate_adduct_mz import * adducts = pd.read_csv('msac/example_data/adduct_list_full.csv') bug = adducts[adducts.adduct == '2M-H+2NH4'] atom_dict, mass_dict, all_atoms = get_atom_masses(bug) ions2mass = get_adduct_masses(None, mass_dict, all_atoms)
then ions2mass contains {'-H+2NH4': 29.01397304109} that is incorrect. Looking at intermediate results, mass_dict contains
ions2mass
{'-H+2NH4': 29.01397304109}
mass_dict
{'e': 0.00054857990924, 'H': 1.00782503223, 'NH': 15.01089903666}
even if NH mass is correct, in the ion the formula is actually NH4. So the mass in ions2mass corresponds to
NH
NH4
- mass_dict['H'] + 2 * mass_dict['NH']
that is a wrong computation. It should be
- Formula('H').monoisotopic_mass + 2 * Formula('NH4').monoisotopic_mass
which leads to 35.060923234469996 instead of 29.01397304109.
35.060923234469996
29.01397304109
The same error happens also in just another case (from adduct_list_full.csv), namely M-H+2H2O where mass_dict again reports just O instead of O2.
adduct_list_full.csv
M-H+2H2O
O
O2
I'm working on a complete overhaul of the parsing code that should fix this. As soon as I'll be ready I'll submit a pull request.
The text was updated successfully, but these errors were encountered:
christinehc
No branches or pull requests
I suspect there is a problem in the parsing of the ion part of the adduct leading to an error in the computation of the mass for
2M-H+2NH4
.Steps to reproduce, if you run
then
ions2mass
contains{'-H+2NH4': 29.01397304109}
that is incorrect. Looking at intermediate results,mass_dict
containseven if
NH
mass is correct, in the ion the formula is actuallyNH4
. So the mass inions2mass
corresponds tothat is a wrong computation. It should be
which leads to
35.060923234469996
instead of29.01397304109
.The same error happens also in just another case (from
adduct_list_full.csv
), namelyM-H+2H2O
wheremass_dict
again reports justO
instead ofO2
.I'm working on a complete overhaul of the parsing code that should fix this. As soon as I'll be ready I'll submit a pull request.
The text was updated successfully, but these errors were encountered: