Skip to content

Commit

Permalink
Update search_results.py
Browse files Browse the repository at this point in the history
# for reading MSFragger pepxml files removed r"\[[0-9]+\]" from unsupported mods
  • Loading branch information
NormanRog authored Mar 27, 2024
1 parent bcddfc2 commit 6410443
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spectrum_io/search_result/search_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def filter_valid_prosit_sequences(df: pd.DataFrame) -> pd.DataFrame:
# retain only peptides that fall within [7, 30] length supported by Prosit
df = df[(df["PEPTIDE_LENGTH"] <= 30) & (df["PEPTIDE_LENGTH"] >= 7)]
# remove unsupported mods to exclude
unsupported_mods = [r"Acetyl \(Protein N\-term\)", "ac", r"\[[0-9]+\]"]
# for reading MSFragger pepxml files removed r"\[[0-9]+\]" from unsupported mods
unsupported_mods = [r"Acetyl \(Protein N\-term\)", "ac"]
exclude_mods_pattern = re.compile("|".join(unsupported_mods))
df = df[~df["MODIFIED_SEQUENCE"].str.contains(exclude_mods_pattern)]
# remove non-canonical aas
Expand Down

0 comments on commit 6410443

Please sign in to comment.