diff --git a/alphastats/gui/utils/ui_helper.py b/alphastats/gui/utils/ui_helper.py index eda0743f..dcb4d00a 100644 --- a/alphastats/gui/utils/ui_helper.py +++ b/alphastats/gui/utils/ui_helper.py @@ -96,9 +96,8 @@ def init_session_state() -> None: class StateKeys: ## 02_Data Import # on 1st run - ORGANISM = "organism" + ORGANISM = "organism" # TODO this is essentially a constant USER_SESSION_ID = "user_session_id" - LOADER = "loader" # on sample run (function load_sample_data), removed on new session click DATASET = "dataset" # functions upload_metadatafile diff --git a/alphastats/loader/SpectronautLoader.py b/alphastats/loader/SpectronautLoader.py index b9244e36..67112fdb 100644 --- a/alphastats/loader/SpectronautLoader.py +++ b/alphastats/loader/SpectronautLoader.py @@ -88,7 +88,7 @@ def _reshape_long_to_wide(self): other proteomics softwares use a wide format (column for each sample) reshape to a wider format """ - self.rawinput["sample"] = ( + self.rawinput["tmp_sample"] = ( self.rawinput[self.sample_column] + SPECTRONAUT_COLUMN_DELIM + self.intensity_column @@ -98,9 +98,11 @@ def _reshape_long_to_wide(self): indexing_columns.append(self.gene_names_column) df = self.rawinput.pivot( - columns="sample", index=indexing_columns, values=self.intensity_column + columns="tmp_sample", index=indexing_columns, values=self.intensity_column ) df.reset_index(inplace=True) + # get rid of tmp_sample again, which can cause troubles when working with indices downstream + df.rename_axis(columns=None, inplace=True) return df