Introduction Clustergrammer_Widget2 0.4.5

In [13]:
import numpy as np
import pandas as pd
import clustergrammer_widget2
from clustergrammer import *
net = Network()
In [14]:
net.load_file('rc_two_cats.txt')
net.cluster()
In [15]:
net_json = net.export_viz_to_widget()

Visualize Example Gene Expression Toy Dataset

In [16]:
w = clustergrammer_widget2.ExampleWidget(network=net_json)
w

Visualize Random Matrix

In [9]:
# # generate random matrix
# num_rows = 1000
# num_cols = 1000
# 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)
(1000, 1000)
In [10]:
# net.load_df(df)
# net.cluster()
# net_json = net.export_viz_to_widget()
# w = clustergrammer_widget2.ExampleWidget(network=net_json)
# w
In [11]:
import ipywidgets 
In [12]:
ipywidgets.__version__
Out[12]:
'7.4.0'
In [ ]: