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

Add activity filtering #171

Merged
merged 9 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
14 changes: 13 additions & 1 deletion dashboard/pages/correlation/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def on_visualization_stage_entry(
current_stage: int,
concentration_value: int,
volume_value: int,
activity_threshold_bottom: float,
activity_threshold_top: float,
zuzg marked this conversation as resolved.
Show resolved Hide resolved
stored_uuid: str,
file_storage: FileStorage,
) -> tuple[go.Figure, go.Figure]:
Expand All @@ -152,6 +154,7 @@ def on_visualization_stage_entry(
:param current_stage: current stage number
:param concentration_value: concentration
:param volume_value: summary assay volume
:param activity_threshold: threshold for the second plot
zuzg marked this conversation as resolved.
Show resolved Hide resolved
:param stored_uuid: session uuid
:param file_storage: file storage
:return: figures
Expand All @@ -170,7 +173,14 @@ def on_visualization_stage_entry(
df = calculate_concentration(df_merged, concentration_value, volume_value)

feature = "% ACTIVATION" if "% ACTIVATION_x" in df.columns else "% INHIBITION"
concentration_fig = concentration_plot(df, feature[2:])
concentration_fig = concentration_plot(
df[
df[f"{feature}_x"].between(
activity_threshold_bottom, activity_threshold_top
)
],
zuzg marked this conversation as resolved.
Show resolved Hide resolved
feature[2:],
)

feature_fig = concentration_confirmatory_plot(
df[f"{feature}_x"],
Expand Down Expand Up @@ -305,6 +315,8 @@ def register_callbacks(elements, file_storage: FileStorage):
Input(elements["STAGES_STORE"], "data"),
Input("concentration-slider", "value"),
Input("volume-slider", "value"),
Input("activity-threshold-bottom-input", "value"),
Input("activity-threshold-top-input", "value"),
State("user-uuid", "data"),
)(functools.partial(on_visualization_stage_entry, file_storage=file_storage))

Expand Down
65 changes: 62 additions & 3 deletions dashboard/pages/correlation/stages/s2_correlation_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
children=[
dcc.Loading(
id="loading-inhibition-graph",
children=[dcc.Graph(id="inhibition-graph")],
children=[
dcc.Graph(
id="inhibition-graph",
zuzg marked this conversation as resolved.
Show resolved Hide resolved
className="six columns",
style={"width": "100%"},
)
],
type="circle",
)
],
Expand All @@ -31,9 +37,62 @@
children=[
dcc.Loading(
id="loading-concentration-graph",
children=[dcc.Graph(id="concentration-graph")],
children=[
dcc.Graph(
id="concentration-graph",
className="six columns",
style={"width": "100%"},
)
],
type="circle",
)
),
html.Div(
className="row",
children=[
html.Div(
className="col",
children=[
html.Span(
children=[
html.Label(
children="Set act/inh bottom threshold",
className="form-label",
),
dcc.Input(
id="activity-threshold-bottom-input",
type="number",
value=-10,
min=-50,
className="form-control",
),
],
className="flex-grow-1",
),
],
),
html.Div(
className="col",
children=[
html.Span(
children=[
html.Label(
children="Set act/inh upper threshold",
className="form-label",
),
dcc.Input(
id="activity-threshold-top-input",
type="number",
value=100,
min=0,
className="form-control",
),
],
className="flex-grow-1",
),
],
),
],
),
],
),
],
Expand Down