Skip to content

Commit 5d2c65e

Browse files
committed
filtered features visualizer
1 parent aba502e commit 5d2c65e

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

q2_qsip2/plugin_setup.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919
from q2_qsip2.visualizers._visualizers import (
2020
plot_weighted_average_densities, plot_sample_curves, plot_density_outliers,
21-
show_comparison_groups
21+
show_comparison_groups, plot_filtered_features
2222
)
2323

2424

@@ -231,4 +231,22 @@
231231
citations=[],
232232
)
233233

234+
plugin.visualizers.register_function(
235+
function=plot_filtered_features,
236+
inputs={
237+
'filtered_qsip_data': QSIP2Data[Filtered]
238+
},
239+
parameters={},
240+
input_descriptions={
241+
'filtered_qsip_data': 'Your filtered qsip data artifact.'
242+
},
243+
parameter_descriptions={},
244+
name='Visualize feature retention.',
245+
description=(
246+
'Displays per-source stacked bar charts of feature retention by '
247+
'relative abundance and feature count.'
248+
),
249+
citations=[],
250+
)
251+
234252
importlib.import_module('q2_qsip2.types._deferred_setup')

q2_qsip2/visualizers/_visualizers.py

+18
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,21 @@ def show_comparison_groups(
106106
df = qsip2.show_comparison_groups(qsip_data, groups_vector)
107107

108108
df.to_html(Path(output_dir) / 'index.html')
109+
110+
111+
def plot_filtered_features(output_dir: str, filtered_qsip_data: RS4) -> None:
112+
'''
113+
Displays per-source stacked bar charts showing the retention of features.
114+
115+
Parameters
116+
----------
117+
output_dir : str
118+
The root directory of the visualization loaded into the browser.
119+
qsip_data : RS4
120+
The "qsip_data" object.
121+
'''
122+
plot = qsip2.plot_filter_gradient_position(filtered_qsip_data)
123+
124+
_ggplot2_object_to_visualization(
125+
plot, Path(output_dir), width=10, height=10
126+
)

0 commit comments

Comments
 (0)