From 346070072403e068ea372a64263fac4b6e63131e Mon Sep 17 00:00:00 2001 From: doncheva Date: Mon, 25 Sep 2023 12:02:11 +0200 Subject: [PATCH 1/2] We need to transpose the datapoints before adding a new one. --- proteobench/modules/dda_quant/module.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proteobench/modules/dda_quant/module.py b/proteobench/modules/dda_quant/module.py index 2cdd3388..fecb4c3c 100644 --- a/proteobench/modules/dda_quant/module.py +++ b/proteobench/modules/dda_quant/module.py @@ -168,8 +168,7 @@ def add_current_data_point(self, all_datapoints, current_datapoint): """Add current data point to all data points and load them from file if empty. TODO: Not clear why is the df transposed here.""" if not isinstance(all_datapoints, pd.DataFrame): all_datapoints = pd.read_json(DDA_QUANT_RESULTS_PATH) - else: - all_datapoints = all_datapoints.T + all_datapoints = all_datapoints.T all_datapoints = pd.concat([all_datapoints, current_datapoint], axis=1) all_datapoints = all_datapoints.T.reset_index(drop=True) return all_datapoints From 1eab623e3ccb904396e877f73eb87d10cf4a6c0c Mon Sep 17 00:00:00 2001 From: doncheva Date: Mon, 25 Sep 2023 12:11:54 +0200 Subject: [PATCH 2/2] Fixed unit test, I think... --- test/test_module_dda_quant.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/test_module_dda_quant.py b/test/test_module_dda_quant.py index 258db72d..1835a1a8 100644 --- a/test/test_module_dda_quant.py +++ b/test/test_module_dda_quant.py @@ -6,10 +6,7 @@ from proteobench.modules.dda_quant.module import Module from proteobench.modules.dda_quant.parse import ParseInputs from proteobench.modules.dda_quant.parse_settings import ( - DDA_QUANT_RESULTS_PATH, - INPUT_FORMATS, - ParseSettings, -) + DDA_QUANT_RESULTS_PATH, INPUT_FORMATS, ParseSettings) from proteobench.modules.dda_quant.plot import PlotDataPoint # genereate_input_field @@ -129,7 +126,7 @@ class TestPlot(unittest.TestCase): def test_plot_metric(self): - all_datapoints = pd.read_json(DDA_QUANT_RESULTS_PATH).T + all_datapoints = pd.read_json(DDA_QUANT_RESULTS_PATH) fig = PlotDataPoint().plot_metric(all_datapoints) self.assertIsNotNone(fig)