Skip to content

Commit

Permalink
density outlier visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
colinvwood committed Sep 11, 2024
1 parent 66b817e commit b889cf5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
28 changes: 22 additions & 6 deletions q2_qsip2/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from q2_qsip2.workflow import standard_workflow, create_qsip_data
from q2_qsip2.types import QSIP2Data
from q2_qsip2.visualizers._visualizers import (
plot_weighted_average_density, plot_sample_curves
plot_weighted_average_density, plot_sample_curves, plot_density_outliers
)


Expand Down Expand Up @@ -100,13 +100,13 @@
plugin.visualizers.register_function(
function=plot_weighted_average_density,
inputs={
'qsip_object': QSIP2Data
'qsip_data': QSIP2Data
},
parameters={
'group': Str
},
input_descriptions={
'qsip_object': 'The qSIP data for which to plot the weighted average '
'qsip_data': 'The qSIP data for which to plot the weighted average '
'densities.'
},
parameter_descriptions={
Expand All @@ -121,15 +121,31 @@
plugin.visualizers.register_function(
function=plot_sample_curves,
inputs={
'qsip_object': QSIP2Data
'qsip_data': QSIP2Data
},
parameters={},
input_descriptions={
'qsip_object': 'The qSIP data for which to plot the per-sample density '
'qsip_data': 'The qSIP data for which to plot the per-source density '
'curves.'
},
parameter_descriptions={},
name='Plot per-sample density curves.',
name='Plot per-source density curves.',
description=('Placeholder'),
citations=[],
)

plugin.visualizers.register_function(
function=plot_density_outliers,
inputs={
'qsip_data': QSIP2Data
},
parameters={},
input_descriptions={
'qsip_data': 'The qSIP data for which to plot the per-source density '
'outliers.'
},
parameter_descriptions={},
name='Plot per-source density outliers.',
description=('Placeholder'),
citations=[],
)
Expand Down
18 changes: 14 additions & 4 deletions q2_qsip2/visualizers/_visualizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,31 @@
qsip2 = importr('qSIP2')

def plot_weighted_average_density(
output_dir: str, qsip_object: RS4, group: Optional[str] = None
output_dir: str, qsip_data: RS4, group: Optional[str] = None
) -> None:
'''
'''
plot = qsip2.plot_source_wads(qsip_object, group=group)
plot = qsip2.plot_source_wads(qsip_data, group=group)

_ggplot2_object_to_visualization(
plot, Path(output_dir), width=10, height=4
)


def plot_sample_curves(output_dir: str, qsip_object: RS4) -> None:
def plot_sample_curves(output_dir: str, qsip_data: RS4) -> None:
'''
'''
plot = qsip2.plot_sample_curves(qsip_object)
plot = qsip2.plot_sample_curves(qsip_data)

_ggplot2_object_to_visualization(
plot, Path(output_dir), width=10, height=10
)


def plot_density_outliers(output_dir: str, qsip_data: RS4) -> None:
'''
'''
plot = qsip2.plot_density_outliers(qsip_data)

_ggplot2_object_to_visualization(
plot, Path(output_dir), width=10, height=10
Expand Down

0 comments on commit b889cf5

Please sign in to comment.