Exemplo n.º 1
0
def interactive_distance_histograms(dm, sample_metadata):
    def on_update(category, metadata, check_within, check_between):
        order = []
        if check_within:
            order.append('Within')
        if check_between:
            order.append('Between')
        distance_histogram(dm, category, metadata, order=order)
    check_within = widgets.Checkbox(description='Show within category', value=True)
    check_between = widgets.Checkbox(description='Show between category', value=True)
    extras = widgets.VBox(children=[check_within, check_between])
    return metadata_controls(sample_metadata, on_update, extras)
Exemplo n.º 2
0
def interactive_plot_pcoa(metadata, dms):

    def on_update(category, metadata, metric):
        dm = dms[metric]
        filtered_dm, _ = filter_dm_and_map(dm, metadata)
        pc = pcoa(filtered_dm)
        pc.plot(df=metadata,
        column=category,
        axis_labels=['PC 1', 'PC 2', 'PC 3'],
        s=35).set_size_inches(12, 9)

    metric_but = ipywidgets.Dropdown(options=list(dms.keys()), description='Metrics')
    extras = ipywidgets.VBox(children=[metric_but])

    return metadata_controls(metadata, on_update, extras)
Exemplo n.º 3
0
def interactive_plot_pcoa(metadata, dms):
    def on_update(category, metadata, metric):
        dm = dms[metric]
        filtered_dm, _ = filter_dm_and_map(dm, metadata)
        pc = pcoa(filtered_dm)
        pc.plot(df=metadata,
                column=category,
                axis_labels=['PC 1', 'PC 2', 'PC 3'],
                s=35).set_size_inches(12, 9)

    metric_but = ipywidgets.Dropdown(options=list(dms.keys()),
                                     description='Metrics')
    extras = ipywidgets.VBox(children=[metric_but])

    return metadata_controls(metadata, on_update, extras)
Exemplo n.º 4
0
def interactive_distance_histograms(dm, sample_metadata):
    def on_update(category, metadata, check_within, check_between):
        order = []
        if check_within:
            order.append('Within')
        if check_between:
            order.append('Between')
        distance_histogram(dm, category, metadata, order=order)

    check_within = ipywidgets.Checkbox(description='Show within category',
                                       value=True)
    check_between = ipywidgets.Checkbox(description='Show between category',
                                        value=True)
    extras = ipywidgets.VBox(children=[check_within, check_between])
    return metadata_controls(sample_metadata, on_update, extras)
Exemplo n.º 5
0
def interactive_distance_violinplots(dms, sample_metadata):

    def on_update(category, metadata, metric, check_within, check_between):
        order = []
        if check_within:
            order.append('Within')
        if check_between:
            order.append('Between')

        dm = dms[metric]
        distance_violinplots(dm, category, metadata, metric, order=order)

    check_within = ipywidgets.Checkbox(description='Show within category', value=True)
    check_between = ipywidgets.Checkbox(description='Show between category', value=True)
    metric_but = ipywidgets.Dropdown(options=list(dms.keys()), description='Metrics')


    extras = ipywidgets.VBox(children=[metric_but, check_within, check_between])
    return metadata_controls(sample_metadata, on_update, extras)
Exemplo n.º 6
0
def interactive_distance_violinplots(dms, sample_metadata):
    def on_update(category, metadata, metric, check_within, check_between):
        order = []
        if check_within:
            order.append('Within')
        if check_between:
            order.append('Between')

        dm = dms[metric]
        distance_violinplots(dm, category, metadata, metric, order=order)

    check_within = ipywidgets.Checkbox(description='Show within category',
                                       value=True)
    check_between = ipywidgets.Checkbox(description='Show between category',
                                        value=True)
    metric_but = ipywidgets.Dropdown(options=list(dms.keys()),
                                     description='Metrics')

    extras = ipywidgets.VBox(
        children=[metric_but, check_within, check_between])
    return metadata_controls(sample_metadata, on_update, extras)