From 81f78bf16d437d241852797cb6042f4cd8c8e5db Mon Sep 17 00:00:00 2001 From: Joshua Charkow Date: Wed, 27 Nov 2024 10:47:30 -0500 Subject: [PATCH] fix: ValueError: Buffer dtype mismatch, expected 'DATA_TYPE' but got 'double' need to cast to np.float_32 --- .gitignore | 1 + pyprophet/data_handling.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f374cdc..d9a6697 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ nosetests.xml # vim *.sw[opqrs] +*~ diff --git a/pyprophet/data_handling.py b/pyprophet/data_handling.py index 29c52b7..23ddd65 100644 --- a/pyprophet/data_handling.py +++ b/pyprophet/data_handling.py @@ -360,7 +360,7 @@ def filter_(self, idx): def add_peak_group_rank(self): ids = self.df.tg_num_id.values scores = self.df.d_score.values - peak_group_ranks = rank(ids, scores) + peak_group_ranks = rank(ids, scores.astype(np.float32, copy=False)) self.df["peak_group_rank"] = peak_group_ranks @profile