From a0e4a11184a29737b07d583eb7fcc1c773fb094a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CKarim?= <“karimwael48@gmail.com”> Date: Tue, 7 Nov 2023 16:42:58 +0100 Subject: [PATCH] added a minor change --- spectrum_io/search_result/sage.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spectrum_io/search_result/sage.py b/spectrum_io/search_result/sage.py index 0f1b76c..6eb3fcb 100644 --- a/spectrum_io/search_result/sage.py +++ b/spectrum_io/search_result/sage.py @@ -55,16 +55,16 @@ def read_result(path: Union[str, Path], tmt_labeled: str) -> pd.DataFrame: # Standardize column names df.columns = df.columns.str.upper() df.columns = df.columns.str.replace(" ", "_") - print(df) - df = Sage.update_columns_for_prosit(df) + + df = Sage.update_columns_for_prosit(df,tmt_labeled) return filter_valid_prosit_sequences(df) @staticmethod - def update_columns_for_prosit(df: pd.DataFrame ) -> pd.DataFrame: + def update_columns_for_prosit(df: pd.DataFrame , tmt_labeled: str ) -> pd.DataFrame: # renaming input columns - print(df.columns) + df = df.rename(columns={'FILENAME':'RAW_FILE','SCANNR':'SCAN_NUMBER','PEPTIDE':'MODIFIED_SEQUENCE','CHARGE':'PRECURSOR_CHARGE'}) - print(df.columns) + # removing .mzML df['RAW_FILE'] = df['RAW_FILE'].str.replace(".mzML","") # extracting only the scan number