Skip to content

Commit

Permalink
Merge pull request #86 from Proteobench/fix-new-json-format
Browse files Browse the repository at this point in the history
We need to transpose the datapoints before adding a new one.
  • Loading branch information
RobbinBouwmeester authored Sep 25, 2023
2 parents 6d95122 + 1eab623 commit fa0e956
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions proteobench/modules/dda_quant/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions test/test_module_dda_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fa0e956

Please sign in to comment.