Skip to content

Commit

Permalink
fixed reading scannr, if already an int
Browse files Browse the repository at this point in the history
  • Loading branch information
picciama committed Jul 18, 2024
1 parent a34a547 commit 46455c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spectrum_io/search_result/sage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def update_columns_for_prosit(df: pd.DataFrame, tmt_labeled: str) -> pd.DataFram
# removing .mzML
df["RAW_FILE"] = df["RAW_FILE"].str.replace(r"\.mz[M|m][l|L]", "", regex=True)
# extracting only the scan number
df["SCAN_NUMBER"] = [int(x.rsplit("=", 1)[-1]) for x in df["SCAN_NUMBER"]]
if not df["SCAN_NUMBER"].dtype == int:
df["SCAN_NUMBER"] = [int(x.rsplit("=", 1)[-1]) for x in df["SCAN_NUMBER"]]
# creating a column of decoys and targets
df["REVERSE"] = df["REVERSE"] < 0
# removing modification to create the unmodified sequences
Expand Down

0 comments on commit 46455c2

Please sign in to comment.