Skip to content

Commit

Permalink
Added mods to msfragger and neutral loss dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
WassimG committed Sep 20, 2024
1 parent 847ddce commit 6e8ca39
Showing 1 changed file with 50 additions and 57 deletions.
107 changes: 50 additions & 57 deletions spectrum_fundamentals/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
"K[230]": "K[UNIMOD:737]",
"K[305]": "K[UNIMOD:2016]",
"K[214]": "K[UNIMOD:214]",
"R[157]": "R[UNIMOD:7]",
"Q[129]": "Q[UNIMOD:7]",
"N[115]": "N[UNIMOD:7]",
"n[230]": "[UNIMOD:737]-",
"n[305]": "[UNIMOD:2016]-",
"n[214]": "[UNIMOD:214]-",
Expand All @@ -139,14 +142,7 @@
PARTICLE_MASSES = {"PROTON": 1.007276467, "ELECTRON": 0.00054858}

# masses of different atoms
ATOM_MASSES = {
"H": 1.007825035,
"C": 12.0,
"O": 15.9949146,
"N": 14.003074,
'S': 31.9720712,
'P': 30.9737619
}
ATOM_MASSES = {"H": 1.007825035, "C": 12.0, "O": 15.9949146, "N": 14.003074, "S": 31.9720712, "P": 30.9737619}

MASSES = {**PARTICLE_MASSES, **ATOM_MASSES}
MASSES["N_TERMINUS"] = MASSES["H"]
Expand Down Expand Up @@ -287,59 +283,56 @@


AA_Neutral_losses = {
'R': ['NH3', 'CH2N2', 'C3H9N3'],
'N': ['NH3', 'CH3NO', 'C2H5NO', 'C3H5NO'],
'D': ['H2O', 'CO2', 'C2H4O2'],
'C': ['CH2S'],
'E': ['H2O', 'C2H4O2'],
'Q': ['NH3', 'CH3NO', 'C2H5NO', 'C3H5NO'],
'I': ['C2H4'],
'L': ['C3H6', 'C4H8'],
'K': ['C2H5N', 'C4H9N', 'C4H11N', 'C3H9N'],
'M': ['C2H4S', 'C3H6S'],
'M[UNIMOD:35]': ['CH4SO', 'C3H8SO', 'C3H6SO'],
'S': ['H2O', 'CH4O'],
'T': ['H2O', 'C2H4O'],
'W': ['C8H7N', 'C9H9N'],
'V': ['C3H6'],
'[]-': ['NH3'],
'-[]': ['H2O'],
"R": ["NH3", "CH2N2", "C3H9N3"],
"N": ["NH3", "CH3NO", "C2H5NO", "C3H5NO"],
"D": ["H2O", "CO2", "C2H4O2"],
"C": ["CH2S"],
"E": ["H2O", "C2H4O2"],
"Q": ["NH3", "CH3NO", "C2H5NO", "C3H5NO"],
"I": ["C2H4"],
"L": ["C3H6", "C4H8"],
"K": ["C2H5N", "C4H9N", "C4H11N", "C3H9N"],
"M": ["C2H4S", "C3H6S"],
"M[UNIMOD:35]": ["CH4SO", "C3H8SO", "C3H6SO"],
"S": ["H2O", "CH4O"],
"T": ["H2O", "C2H4O"],
"W": ["C8H7N", "C9H9N"],
"V": ["C3H6"],
"[]-": ["NH3"],
"-[]": ["H2O"],
}

Mod_Neutral_losses = {
'R[UNIMOD:7]': ['CHNO'],
'S[UNIMOD:21]': ['H3O4P']
}
Mod_Neutral_losses = {"R[UNIMOD:7]": ["CHNO"], "S[UNIMOD:21]": ["H3O4P"]}

Neutral_losses_Mass = {
'C2H4': (ATOM_MASSES['C']*2) + (ATOM_MASSES['H']*4),
'C2H4O': (ATOM_MASSES['C']*2) + (ATOM_MASSES['H']*4) + ATOM_MASSES['O'],
'C2H4O2': (ATOM_MASSES['C']*2) + (ATOM_MASSES['H']*4) + (ATOM_MASSES['O']*2),
'C2H4S': (ATOM_MASSES['C']*2) + (ATOM_MASSES['H']*4) + ATOM_MASSES['S'],
'C2H5N': (ATOM_MASSES['C']*2) + (ATOM_MASSES['H']*5) + ATOM_MASSES['N'],
'CHNO': (ATOM_MASSES['C']) + (ATOM_MASSES['H']) + ATOM_MASSES['N'] + ATOM_MASSES['O'],
'C2H5NO': (ATOM_MASSES['C']*2) + (ATOM_MASSES['H']*5) + ATOM_MASSES['N'] + ATOM_MASSES['O'],
'C3H5NO': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*5) + ATOM_MASSES['N'] + ATOM_MASSES['O'],
'C3H6': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*6),
'C3H6S': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*6) + ATOM_MASSES['S'],
'C3H6SO': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*6) + ATOM_MASSES['S'] + ATOM_MASSES['O'],
'C3H8SO': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*8) + ATOM_MASSES['S'] + ATOM_MASSES['O'],
'C3H9N': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*9) + ATOM_MASSES['N'],
'C3H9N3': (ATOM_MASSES['C']*3) + (ATOM_MASSES['H']*9) + (ATOM_MASSES['N']*3),
'C4H11N': (ATOM_MASSES['C']*4) + (ATOM_MASSES['H']*11) + ATOM_MASSES['N'],
'C4H8': (ATOM_MASSES['C']*4) + (ATOM_MASSES['H']*8),
'C4H9N': (ATOM_MASSES['C']*4) + (ATOM_MASSES['H']*9) + ATOM_MASSES['N'],
'C8H7N': (ATOM_MASSES['C']*8) + (ATOM_MASSES['H']*7) + ATOM_MASSES['N'],
'C9H9N': (ATOM_MASSES['C']*9) + (ATOM_MASSES['H']*9) + ATOM_MASSES['N'],
'CH2N2': ATOM_MASSES['C'] + (ATOM_MASSES['H']*2) + (ATOM_MASSES['N']*2),
'CH2S': ATOM_MASSES['C'] + (ATOM_MASSES['H']*2) + ATOM_MASSES['S'],
'CH3NO': ATOM_MASSES['C'] + (ATOM_MASSES['H']*3) + ATOM_MASSES['N'] + ATOM_MASSES['O'],
'CH4O': ATOM_MASSES['C'] + (ATOM_MASSES['H']*4) + ATOM_MASSES['O'],
'CH4SO': ATOM_MASSES['C'] + (ATOM_MASSES['H']*4) + ATOM_MASSES['S'] + ATOM_MASSES['O'],
'CO2': ATOM_MASSES['C'] + (ATOM_MASSES['O']*2),
'H2O': (ATOM_MASSES['H']*2) + ATOM_MASSES['O'],
'NH3': ATOM_MASSES['N'] + (ATOM_MASSES['H']*3),
'H3O4P': (ATOM_MASSES['H']*3) + (ATOM_MASSES['O']*4) + ATOM_MASSES['P']
"C2H4": (ATOM_MASSES["C"] * 2) + (ATOM_MASSES["H"] * 4),
"C2H4O": (ATOM_MASSES["C"] * 2) + (ATOM_MASSES["H"] * 4) + ATOM_MASSES["O"],
"C2H4O2": (ATOM_MASSES["C"] * 2) + (ATOM_MASSES["H"] * 4) + (ATOM_MASSES["O"] * 2),
"C2H4S": (ATOM_MASSES["C"] * 2) + (ATOM_MASSES["H"] * 4) + ATOM_MASSES["S"],
"C2H5N": (ATOM_MASSES["C"] * 2) + (ATOM_MASSES["H"] * 5) + ATOM_MASSES["N"],
"CHNO": (ATOM_MASSES["C"]) + (ATOM_MASSES["H"]) + ATOM_MASSES["N"] + ATOM_MASSES["O"],
"C2H5NO": (ATOM_MASSES["C"] * 2) + (ATOM_MASSES["H"] * 5) + ATOM_MASSES["N"] + ATOM_MASSES["O"],
"C3H5NO": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 5) + ATOM_MASSES["N"] + ATOM_MASSES["O"],
"C3H6": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 6),
"C3H6S": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 6) + ATOM_MASSES["S"],
"C3H6SO": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 6) + ATOM_MASSES["S"] + ATOM_MASSES["O"],
"C3H8SO": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 8) + ATOM_MASSES["S"] + ATOM_MASSES["O"],
"C3H9N": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 9) + ATOM_MASSES["N"],
"C3H9N3": (ATOM_MASSES["C"] * 3) + (ATOM_MASSES["H"] * 9) + (ATOM_MASSES["N"] * 3),
"C4H11N": (ATOM_MASSES["C"] * 4) + (ATOM_MASSES["H"] * 11) + ATOM_MASSES["N"],
"C4H8": (ATOM_MASSES["C"] * 4) + (ATOM_MASSES["H"] * 8),
"C4H9N": (ATOM_MASSES["C"] * 4) + (ATOM_MASSES["H"] * 9) + ATOM_MASSES["N"],
"C8H7N": (ATOM_MASSES["C"] * 8) + (ATOM_MASSES["H"] * 7) + ATOM_MASSES["N"],
"C9H9N": (ATOM_MASSES["C"] * 9) + (ATOM_MASSES["H"] * 9) + ATOM_MASSES["N"],
"CH2N2": ATOM_MASSES["C"] + (ATOM_MASSES["H"] * 2) + (ATOM_MASSES["N"] * 2),
"CH2S": ATOM_MASSES["C"] + (ATOM_MASSES["H"] * 2) + ATOM_MASSES["S"],
"CH3NO": ATOM_MASSES["C"] + (ATOM_MASSES["H"] * 3) + ATOM_MASSES["N"] + ATOM_MASSES["O"],
"CH4O": ATOM_MASSES["C"] + (ATOM_MASSES["H"] * 4) + ATOM_MASSES["O"],
"CH4SO": ATOM_MASSES["C"] + (ATOM_MASSES["H"] * 4) + ATOM_MASSES["S"] + ATOM_MASSES["O"],
"CO2": ATOM_MASSES["C"] + (ATOM_MASSES["O"] * 2),
"H2O": (ATOM_MASSES["H"] * 2) + ATOM_MASSES["O"],
"NH3": ATOM_MASSES["N"] + (ATOM_MASSES["H"] * 3),
"H3O4P": (ATOM_MASSES["H"] * 3) + (ATOM_MASSES["O"] * 4) + ATOM_MASSES["P"],
}

#######################################
Expand Down

0 comments on commit 6e8ca39

Please sign in to comment.