diff --git a/chebai/preprocessing/datasets/base.py b/chebai/preprocessing/datasets/base.py index 24655b0d..d5cd5653 100644 --- a/chebai/preprocessing/datasets/base.py +++ b/chebai/preprocessing/datasets/base.py @@ -1111,6 +1111,7 @@ def _retrieve_splits_from_csv(self) -> None: filename = self.processed_file_names_dict["data"] data = self.load_processed_data_from_file(filename) df_data = pd.DataFrame(data) + df_data["ident"] = df_data["ident"].astype(str) if self.apply_id_filter: print(f"Applying ID filter from {self.apply_id_filter}...") diff --git a/chebai/preprocessing/datasets/chebi.py b/chebai/preprocessing/datasets/chebi.py index a0af3ac8..d152f4f1 100644 --- a/chebai/preprocessing/datasets/chebi.py +++ b/chebai/preprocessing/datasets/chebi.py @@ -219,7 +219,14 @@ def _graph_to_raw_dataset(self, g: "nx.DiGraph") -> pd.DataFrame: sdf_path = os.path.join(self.raw_dir, self.raw_file_names_dict["sdf"]) mol_df = extract_molecules(sdf_path) - mol_df = mol_df[mol_df["STAR"] == self.subset[0]] if self.subset else mol_df + mol_df["star"] = ( + mol_df["STAR"] + if "STAR" in mol_df.columns + else mol_df["Star"] + if "Star" in mol_df.columns + else None + ) + mol_df = mol_df[mol_df["star"] == self.subset[0]] if self.subset else mol_df data, labels = build_labeled_dataset(g, mol_df, self.THRESHOLD) with open(os.path.join(self.classes_txt_file_path), "wt") as fout: @@ -818,7 +825,7 @@ class ChEBIOver100Fingerprints(ChEBIOverXFingerprints, ChEBIOver100): if __name__ == "__main__": dataset = ChEBIOver50( - chebi_version=251, + chebi_version=237, ) dataset.prepare_data() dataset.setup()