Skip to content

Commit

Permalink
fixed mypy / typeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
picciama committed Aug 5, 2024
1 parent ca09c0b commit 347979c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spectrum_fundamentals/mod_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ def internal_without_mods(sequences: List[str]) -> List[str]:
return [re.sub(regex, "", seq) for seq in sequences]


def internal_to_mod_mass(sequences: List[str], custom_mods: Optional[Dict[str, float]] = None) -> List[str]:
def internal_to_mod_mass(
sequences: List[str], custom_mods: Optional[Dict[str, Dict[str, Tuple[str, float]]]] = None
) -> List[str]:
"""
Function to exchange the internal mod identifiers with the masses of the specific modifiction.
Expand Down Expand Up @@ -243,10 +245,10 @@ def internal_to_msp(
mod_string = "; ".join([f"{mod[2:]}@{mod[0]}{pos}" for pos, mod in mod_list])
n_mods = len(mod_list)
if n_mods > 0:
mods = f"{n_mods}/{'/'.join([f'{pos},{mod}' for pos, mod in mod_list])}"
mods_field = f"{n_mods}/{'/'.join([f'{pos},{mod}' for pos, mod in mod_list])}"
else:
mods = "0"
ret_vals.append((mods, mod_string))
mods_field = "0"
ret_vals.append((mods_field, mod_string))
return ret_vals


Expand Down

0 comments on commit 347979c

Please sign in to comment.