<reponame>scvannost/clustergrammer-py
'''
The clustergrammer python module can be installed using pip:
pip install clustergrammer

or by getting the code from the repo:
https://github.com/MaayanLab/clustergrammer-py
'''

# from clustergrammer import Network
from clustergrammer import Network
net = Network()

# load matrix tsv file
net.load_stdin()

# optional filtering and normalization
##########################################
# net.filter_sum('row', threshold=20)
# net.normalize(axis='col', norm_type='zscore', keep_orig=True)
# net.filter_N_top('row', 250, rank_type='sum')
# net.filter_threshold('row', threshold=3.0, num_occur=4)
# net.swap_nan_for_zero()

net.make_clust(dist_type='cos',views=['N_row_sum', 'N_row_var'] , dendro=True,
               sim_mat=True, filter_sim=0.1, calc_cat_pval=False)

# output jsons for front-end visualizations
print(net.export_net_json('viz', 'no-indent'))
'''
The clustergrammer python module can be installed using pip:
pip install clustergrammer

or by getting the code from the repo:
https://github.com/MaayanLab/clustergrammer-py
'''

# from clustergrammer import Network
from clustergrammer import Network
net = Network()

# load matrix tsv file
net.load_stdin()

# optional filtering and normalization
##########################################
# net.filter_sum('row', threshold=20)
# net.normalize(axis='col', norm_type='zscore', keep_orig=True)
# net.filter_N_top('row', 250, rank_type='sum')
# net.filter_threshold('row', threshold=3.0, num_occur=4)
# net.swap_nan_for_zero()

net.make_clust(dist_type='cos',views=['N_row_sum', 'N_row_var'] , dendro=True,
               sim_mat=True, filter_sim=0.1, calc_cat_pval=False)

# output jsons for front-end visualizations
print(net.export_net_json('viz', 'no-indent'))
The clustergrammer python module can be installed using pip: pip install clustergrammer  or by getting the code from the repo: https://github.com/MaayanLab/clustergrammer-py # from clustergrammer import Network # load matrix tsv file # optional filtering and normalization ########################################## # net.filter_sum('row', threshold=20) # net.normalize(axis='col', norm_type='zscore', keep_orig=True) # net.filter_N_top('row', 250, rank_type='sum') # net.filter_threshold('row', threshold=3.0, num_occur=4) # net.swap_nan_for_zero() # output jsons for front-end visualizations