Skip to content

Commit

Permalink
Merge pull request #149 from Proteobench/plot-before-submit
Browse files Browse the repository at this point in the history
Add plot before submitting data
  • Loading branch information
mlocardpaulet authored Dec 1, 2023
2 parents 98be0e7 + 17d9aa6 commit 75ffbcb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions proteobench/modules/dda_quant/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ def add_current_data_point(self, all_datapoints, current_datapoint):
all_datapoints = all_datapoints.T.reset_index(drop=True)
return all_datapoints

def obtain_all_data_point(self, all_datapoints):
"""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)
all_datapoints = read_results_json_repo(DDA_QUANT_RESULTS_REPO)

all_datapoints["old_new"] = "old"

return all_datapoints

def benchmarking(
self, input_file: str, input_format: str, user_input: dict, all_datapoints
) -> pd.DataFrame:
Expand Down
9 changes: 8 additions & 1 deletion webinterface/pages/DDA_Quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _main_page(self):
with st.form(key="main_form"):
st.subheader("Input files")
st.markdown(
"""
"""
Remember: contaminant sequences are already present in the fasta file associated to this module. **Do not add other contaminants** to your search. This is important when using MaxQuant and MSFragger, among other tools.
"""
)
Expand Down Expand Up @@ -174,6 +174,13 @@ def _main_page(self):
if FIG1 in st.session_state:
self._populate_results()

if ALL_DATAPOINTS not in st.session_state:
st.session_state[ALL_DATAPOINTS] = None
all_datapoints = st.session_state[ALL_DATAPOINTS]
all_datapoints = Module().obtain_all_data_point(all_datapoints)
fig2 = PlotDataPoint().plot_metric(all_datapoints)
st.plotly_chart(fig2, use_container_width=True)

if submit_button:
if self.user_input["input_csv"]:
self._run_proteobench()
Expand Down

0 comments on commit 75ffbcb

Please sign in to comment.