-
Notifications
You must be signed in to change notification settings - Fork 11
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
changing dot size in plot depending if new submission #75 #93
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
695870f
changing dot size in plot depending if new submission #75
wolski 9913423
changing dot size in plot depending if new submission #75
wolski 98bfda1
launch json for debugging streamlit apps in VS code
wolski f42114f
Merge branch 'main' into improveplots
14eab94
adding gridlines to the figures #45
wolski 4bad86d
fix plotting test
wolski ff0a867
Merge branch 'improveplots' of https://github.com/Proteobench/ProteoB…
wolski a38e7c7
Merge branch 'main' into improveplots
scaramonche 867c10a
FIxed a merging error
scaramonche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: BStreamlit", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "streamlit", | ||
"args": [ | ||
"run", | ||
"Home.py", | ||
"--server.port", | ||
"8080" | ||
], | ||
"cwd": "${workspaceFolder}/webinterface/", | ||
"justMyCode":false | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,7 +27,7 @@ def plot_bench(self, result_df: pd.DataFrame) -> go.Figure: | |||||
fig.update_layout( | ||||||
width=700, | ||||||
height=700, | ||||||
title="Distplot", | ||||||
# title="Distplot", | ||||||
xaxis=dict( | ||||||
title="1|2_ratio", | ||||||
color="white", | ||||||
|
@@ -40,6 +40,8 @@ def plot_bench(self, result_df: pd.DataFrame) -> go.Figure: | |||||
), | ||||||
) | ||||||
fig.update_xaxes(range=[0, 4]) | ||||||
fig.update_xaxes(showgrid=True, gridcolor="lightgray", gridwidth=1) | ||||||
# fig.update_yaxes(showgrid=True, gridcolor="lightgray", gridwidth=1) | ||||||
|
||||||
return fig | ||||||
|
||||||
|
@@ -75,26 +77,41 @@ def plot_metric(self, benchmark_metrics_df: pd.DataFrame) -> go.Figure: | |||||
|
||||||
# Add hover text | ||||||
hover_texts = [ | ||||||
f"Search Engine: {benchmark_metrics_df.search_engine[idx]} {benchmark_metrics_df.software_version[idx]}<br>FDR psm: {benchmark_metrics_df.fdr_psm[idx]}<br>FDR Peptide: {benchmark_metrics_df.fdr_peptide[idx]}<br>FRD Protein: {benchmark_metrics_df.fdr_protein[idx]}<br>MBR: {benchmark_metrics_df.MBR[idx]}<br>Precursor Tolerance: {benchmark_metrics_df.precursor_tol[idx]} {benchmark_metrics_df.precursor_tol_unit[idx]}<br>Fragment Tolerance: {benchmark_metrics_df.fragment_tol_unit[idx]}<br>Enzyme: {benchmark_metrics_df.enzyme_name[idx]} <br>Missed Cleavages: {benchmark_metrics_df.missed_cleavages[idx]}<br>Min peptide length: {benchmark_metrics_df.min_pep_length[idx]}<br>Max peptide length: {benchmark_metrics_df.max_pep_length[idx]}" | ||||||
f"Search Engine: {benchmark_metrics_df.search_engine[idx]} {benchmark_metrics_df.software_version[idx]}<br>" | ||||||
+ f"FDR psm: {benchmark_metrics_df.fdr_psm[idx]}<br>" | ||||||
+ f"FDR Peptide: {benchmark_metrics_df.fdr_peptide[idx]}<br>" | ||||||
+ f"FRD Protein: {benchmark_metrics_df.fdr_protein[idx]}<br>" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
+ f"MBR: {benchmark_metrics_df.MBR[idx]}<br>" | ||||||
+ f"Precursor Tolerance: {benchmark_metrics_df.precursor_tol[idx]} {benchmark_metrics_df.precursor_tol_unit[idx]}<br>" | ||||||
+ f"Fragment Tolerance: {benchmark_metrics_df.fragment_tol_unit[idx]}<br>" | ||||||
+ f"Enzyme: {benchmark_metrics_df.enzyme_name[idx]} <br>" | ||||||
+ f"Missed Cleavages: {benchmark_metrics_df.missed_cleavages[idx]}<br>" | ||||||
+ f"Min peptide length: {benchmark_metrics_df.min_pep_length[idx]}<br>" | ||||||
+ f"Max peptide length: {benchmark_metrics_df.max_pep_length[idx]}" | ||||||
for idx, row in benchmark_metrics_df.iterrows() | ||||||
] | ||||||
|
||||||
# spellerror {meta_data.fragmnent_tol[idx]} | ||||||
|
||||||
mapping = {"old": 10, "new": 20} | ||||||
|
||||||
fig = go.Figure( | ||||||
data=[ | ||||||
go.Scatter( | ||||||
x=benchmark_metrics_df["weighted_sum"], | ||||||
y=benchmark_metrics_df["nr_prec"], | ||||||
mode="markers", | ||||||
text=hover_texts, | ||||||
marker=dict(color=colors, showscale=True, size=20), | ||||||
marker=dict(color=colors, showscale=False, size=20), | ||||||
marker_size=[ | ||||||
mapping[item] for item in benchmark_metrics_df["old_new"] | ||||||
], | ||||||
) | ||||||
] | ||||||
) | ||||||
|
||||||
fig.update_layout( | ||||||
title="Metric", | ||||||
# title="Metric", | ||||||
width=700, | ||||||
height=700, | ||||||
xaxis=dict( | ||||||
|
@@ -107,8 +124,11 @@ def plot_metric(self, benchmark_metrics_df: pd.DataFrame) -> go.Figure: | |||||
gridcolor="white", | ||||||
gridwidth=2, | ||||||
), | ||||||
# paper_bgcolor='rgb(243, 243, 243)', | ||||||
# plot_bgcolor="rgb(243, 243, 243)", | ||||||
) | ||||||
|
||||||
fig.update_xaxes(showgrid=True, gridcolor="lightgray", gridwidth=1) | ||||||
fig.update_yaxes(showgrid=True, gridcolor="lightgray", gridwidth=1) | ||||||
# selected_points = plotly_events( | ||||||
# fig, | ||||||
# select_event=True, | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively you could remember the index and use
df.loc[idx_new]