diff --git a/alphastats/dataset_harmonizer.py b/alphastats/dataset_harmonizer.py index f9e54ebb..332cd4ac 100644 --- a/alphastats/dataset_harmonizer.py +++ b/alphastats/dataset_harmonizer.py @@ -13,12 +13,12 @@ class DataHarmonizer: def __init__(self, loader: BaseLoader, sample_column: Optional[str] = None): # map column names to a tuple (new_name, is_mandatory) - rawinput_rename_dict = { + self._rawinput_rename_dict = { loader.index_column: (Cols.INDEX, True), loader.gene_names_column: (Cols.GENE_NAMES, False), } - shared_rename_dict = ( + self._metadata_rename_dict = ( { sample_column: (Cols.SAMPLE, True), } @@ -26,9 +26,6 @@ def __init__(self, loader: BaseLoader, sample_column: Optional[str] = None): else {} ) - self._rawinput_rename_dict = {**rawinput_rename_dict, **shared_rename_dict} - self._metadata_rename_dict = shared_rename_dict - def get_harmonized_rawinput(self, rawinput: pd.DataFrame) -> pd.DataFrame: """Harmonize the rawinput data to a common format.""" return self._get_harmonized_data( @@ -51,10 +48,10 @@ def _get_harmonized_data( for source_name, (target_name, is_mandatory) in rename_dict.items(): if target_name in input_df.columns: raise ValueError( - f"Column name {target_name} already exists. Please rename the column in your input data." + f"Column name '{target_name}' already exists. Please rename the column in your input data." ) if is_mandatory and source_name not in input_df.columns: - raise ValueError(f"Column name {source_name} not found!") + raise ValueError(f"Column name '{source_name}' not found!") return input_df.rename( columns=rename_dict, diff --git a/alphastats/statistics/MultiCovaAnalysis.py b/alphastats/statistics/MultiCovaAnalysis.py index 03243f15..c47e5c24 100644 --- a/alphastats/statistics/MultiCovaAnalysis.py +++ b/alphastats/statistics/MultiCovaAnalysis.py @@ -130,7 +130,6 @@ def calculate(self): quant_data=self.transposed, annotation=self.metadata, covariates=self.covariates, - sample_column=self.dataset.sample, n_permutations=self.n_permutations, fdr=self.fdr, s0=self.s0,