From 6d66789592cad4d8a0d92c3a54481d8007568396 Mon Sep 17 00:00:00 2001 From: Mario Picciani Date: Sun, 4 Aug 2024 13:03:06 +0200 Subject: [PATCH] fixed missing protein columns #253 --- oktoberfest/preprocessing/preprocessing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oktoberfest/preprocessing/preprocessing.py b/oktoberfest/preprocessing/preprocessing.py index c5d4a905..d63d0409 100644 --- a/oktoberfest/preprocessing/preprocessing.py +++ b/oktoberfest/preprocessing/preprocessing.py @@ -38,8 +38,11 @@ def gen_lib(input_file: Union[str, Path]) -> Spectra: """ library_df = csv.read_file(input_file) library_df.columns = library_df.columns.str.upper() + if "PROTEINS" not in library_df.obs.columns: + library_df.obs["PROTEINS"] = "unknown" var_df = Spectra._gen_vars_df() spec = Spectra(obs=library_df, var=var_df) + spec.var_names = var_df.index return spec