Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need to transpose the datapoints before adding a new one. #86

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading