introduction3

# Introduction2 Clustergrammer_Widget2 0.4.5¶

In [1]:

    import numpy as np
    import pandas as pd
    import clustergrammer_widget2
    from clustergrammer import *
    net = Network()

In [2]:

    net.load_file('rc_two_cats.txt')
    net.cluster()

In [3]:

    net_json = net.export_viz_to_widget()

### Visualize Example Gene Expression Toy Dataset¶

In [4]:

    w = clustergrammer_widget2.ExampleWidget(network=net_json)
    w

### Visualize Random Matrix¶

In [ ]:

    # # generate random matrix
    # num_rows = 100
    # num_cols = 450
    # np.random.seed(seed=100)
    # mat = np.random.rand(num_rows, num_cols)

    # # make row and col labels
    # rows = range(num_rows)
    # cols = range(num_cols)
    # rows = [str(i) for i in rows]
    # cols = [str(i) for i in cols]

    # # make dataframe
    # df = pd.DataFrame(data=mat, columns=cols, index=rows)
    # print(df.shape)

In [ ]:

    # net.load_df(df)
    # net.cluster()
    # net_json = net.export_viz_to_widget()
    # w = clustergrammer_widget2.ExampleWidget(network=net_json)
    # w

In [ ]:

    import ipywidgets

In [ ]:

    ipywidgets.__version__

In [ ]: