Proteobench / ProteoBench

ProteoBench is an open and collaborative platform for community-curated benchmarks for proteomics data analysis pipelines. Our goal is to allow a continuous, easy, and controlled comparison of proteomics data analysis workflows.
https://proteobench.readthedocs.io
Apache License 2.0
27 stars 7 forks source link

Refactor webinterface #275

Closed RobbinBouwmeester closed 2 months ago

mlocardpaulet commented 2 months ago

Hi!

I wanted to try out the PR version (maybe it is too early, but I was curious), so I tried it out locally. When the page load (without me doing anything), the figure of the module is different. I mean... One point moves. It is the last point updated (Proline_2.1_20240318_162947). Any idea why this would happen? Here are the two figures (1- local version corresponding to the PR, and 2- sever version). I kept the number of measured values = 3.

local_version_20240405 server_version_20240405

mlocardpaulet commented 2 months ago

I uploaded a MQ evidence file, it worked without error, but the point is not printed (or not bigger). I have to change the minimum number of samples to see it appear big. Then I changed the slider value again and I got an error message:

TypeError: 'NoneType' object is not subscriptable
Traceback:
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 530, in _run_script
    self._session_state.on_script_will_rerun(rerun_data.widget_states)
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/streamlit/runtime/state/safe_session_state.py", line 61, in on_script_will_rerun
    self._state.on_script_will_rerun(latest_widget_states)
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/streamlit/runtime/state/session_state.py", line 500, in on_script_will_rerun
    self._call_callbacks()
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/streamlit/runtime/state/session_state.py", line 513, in _call_callbacks
    self._new_widget_state.call_callback(wid)
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/streamlit/runtime/state/session_state.py", line 260, in call_callback
    callback(*args, **kwargs)
File "/Users/locard/Documents/GitHub/ProteoBench/webinterface/pages/DDA_Quant_ion.py", line 292, in slider_callback
    st.session_state[self.variables_dda_quant.all_datapoints] = self.ionmodule.filter_data_point(
                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/proteobench/modules/dda_quant_base/module.py", line 83, in filter_data_point
    filter_df_numquant_median_abs_epsilon(v, min_quant=default_val_slider) for v in all_datapoints["results"]
                                                                                    ~~~~~~~~~~~~~~^^^^^^^^^^^

This may of may not be related: there seems to be an issue with the modification parsing (see line 26 in the table of the screenshot below):

image

Added later: this modification parsing issue may be from previous versions, see issue #282

mlocardpaulet commented 2 months ago

I also have an error when I try to upload a Proline file:

TypeError: 'dict' object is not callable
Traceback:
File "/Users/locard/Documents/GitHub/ProteoBench/webinterface/pages/DDA_Quant_ion.py", line 234, in _run_proteobench
    result_performance, all_datapoints, input_df = self.ionmodule.benchmarking(
                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/locard/miniconda3/envs/ProteoBench/lib/python3.11/site-packages/proteobench/modules/dda_quant_ion/module.py", line 42, in benchmarking
    self.precursor_name, parse_settings.species_expected_ratio(), parse_settings.species_dict()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
vedran-kasalica commented 2 months ago

I got the same error ('NoneType' object is not subscriptable) as @mlocardpaulet while testing. The error occurs on the main branch as well. I would say that it is not PR-related, so I created an issue for it https://github.com/Proteobench/ProteoBench/issues/286.

The changes look good to me! For future development, we might reconsider placing an __init__.py file in every folder, as this practice implicitly designates each directory as a distinct Python package. This is particularly unnecessary in folders that do not contain any Python files.

*I didn't test the web interface by uploading new data.

RobbinBouwmeester commented 2 months ago

Yes, I am currently trying to make a submission. However, somehow it seems to reset the whole session state which is a problem... As there is essentially nothing we submit if that is reset...