Exemplo n.º 1
0
    "#013349", "#00846F", "#372101", "#FFB500", "#C2FFED", "#A079BF",
    "#CC0744", "#C0B9B2", "#C2FF99", "#001E09", "#00489C", "#6F0062",
    "#0CBD66", "#EEC3FF", "#456D75", "#B77B68", "#7A87A1", "#788D66",
    "#885578", "#0089A3", "#FF8A9A", "#D157A0", "#BEC459", "#456648",
    "#0086ED", "#886F4C", "#34362D", "#B4A8BD", "#00A6AA", "#452C2C",
    "#636375", "#A3C8C9", "#FF913F", "#938A81", "#575329", "#00FECF",
    "#B05B6F", "#8CD0FF", "#3B9700", "#04F757", "#C8A1A1", "#1E6E00",
    "#7900D7", "#A77500", "#6367A9", "#A05837", "#6B002C", "#772600",
    "#D790FF", "#9B9700", "#549E79", "#FFF69F", "#201625", "#CB7E98",
    "#72418F", "#BC23FF", "#99ADC0", "#3A2465", "#922329", "#5B4534",
    "#FDE8DC", "#404E55", "#FAD09F", "#A4E804", "#f58231", "#324E72", "#402334"
]
for i in range(len(color_array3)):
    label = 'SC3 label: _' + str(i) + '_'
    net.set_cat_color(axis='col',
                      cat_index=1,
                      cat_name=label,
                      inst_color=color_array3[i])
#console.log(color_array[i]);

if use_user_label == '1':
    for j in range(len(unique_array)):
        userlabel = 'User\'s label: _' + str(unique_array[j]) + '_'
        net.set_cat_color(axis='col',
                          cat_index=2,
                          cat_name=userlabel,
                          inst_color=color_array3[63 - j])
net.cluster(dist_type='cos', enrichrgram=True, run_clustering=False)
# write jsons for front-end visualizations
out = wd + 'json/' + outname + '.json'
net.write_json_to_file('viz', out, 'indent')
Exemplo n.º 2
0
'''
Python 2.7
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
net = Network()

# load matrix tsv file
net.load_file('txt/heatmap_features.txt')

net.set_cat_color('row', 1, 'Feature Type: Interactivity', 'yellow')
net.set_cat_color('row', 1, 'Feature Type: Sharing', 'blue')
net.set_cat_color('row', 1, 'Feature Type: Usability', 'orange')
net.set_cat_color('row', 1, 'Feature Type: Biology-Specific', 'red')

net.cluster(dist_type='cos',
            views=[],
            dendro=True,
            filter_sim=0.1,
            calc_cat_pval=False,
            enrichrgram=False)

# write jsons for front-end visualizations
net.write_json_to_file('viz', 'json/mult_view.json', 'indent')
Exemplo n.º 3
0
'''
Python 2.7
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
net = Network()

# load matrix tsv file
net.load_file('../data_mats/df_predict_merge.txt')

net.set_cat_color('row', 1, 'virus: chik', 'blue')
net.set_cat_color('row', 1, 'virus: zika', 'red')
net.cluster(enrichrgram=False)

# transfer colors from original to predicted categories
########################################################

# make category colors the same for Chik groups
for inst_cat in net.viz['cat_colors']['row']['cat-1']:
    new_cat = inst_cat.replace('original', 'predict')
    inst_color = net.viz['cat_colors']['row']['cat-1'][inst_cat]
    net.set_cat_color('row', 3, new_cat, inst_color)

net.cluster(enrichrgram=False)

# write jsons for front-end visualizations