31
31
from webweb import Web
32
32
from wordcloud import STOPWORDS , WordCloud
33
33
34
- from . import dendrogram , utils , wgcna
34
+ from . import utils
35
+ from .linkers import get_clustergrammer_link
36
+ from .translate import hex2rgb , mpl_to_html_image
35
37
36
38
# matplotlib.use("Agg")
37
39
@@ -2128,7 +2130,7 @@ def get_sankey_plot(
2128
2130
label = nodes ,
2129
2131
color = [
2130
2132
(
2131
- "rgba" + str (utils . hex2rgb (node_colors [c ]))
2133
+ "rgba" + str (hex2rgb (node_colors [c ]))
2132
2134
if node_colors [c ].startswith ("#" )
2133
2135
else node_colors [c ]
2134
2136
)
@@ -2140,7 +2142,7 @@ def get_sankey_plot(
2140
2142
target = [list (nodes ).index (i ) for i in data [args ["target" ]].tolist ()],
2141
2143
value = data [args ["weight" ]].tolist (),
2142
2144
color = [
2143
- "rgba" + str (utils . hex2rgb (c )) if c .startswith ("#" ) else c
2145
+ "rgba" + str (hex2rgb (c )) if c .startswith ("#" ) else c
2144
2146
for c in data [args ["source_colors" ]].tolist ()
2145
2147
],
2146
2148
label = hover_data ,
@@ -2413,7 +2415,7 @@ def get_clustergrammer_plot(data, identifier, args):
2413
2415
)
2414
2416
clustergrammer_net .load_df (data )
2415
2417
2416
- link = utils . get_clustergrammer_link (clustergrammer_net , filename = None )
2418
+ link = get_clustergrammer_link (clustergrammer_net , filename = None )
2417
2419
2418
2420
iframe = html .Iframe (src = link , width = 1000 , height = 900 )
2419
2421
@@ -2547,7 +2549,7 @@ def get_WGCNAPlots(data, identifier):
2547
2549
height = 800 ,
2548
2550
)
2549
2551
)
2550
- dendro_tree = wgcnaAnalysis .get_dendrogram (
2552
+ dendro_tree = wgcna_analysis .get_dendrogram (
2551
2553
METDiss , METDiss .index , distfun = None , linkagefun = "ward" , div_clusters = False
2552
2554
)
2553
2555
if dendro_tree is not None :
@@ -2611,12 +2613,12 @@ def get_WGCNAPlots(data, identifier):
2611
2613
)
2612
2614
)
2613
2615
):
2614
- df = wgcnaAnalysis .get_percentiles_heatmap (
2616
+ df = wgcna_analysis .get_percentiles_heatmap (
2615
2617
METcor , dendro_tree , bydendro = True , bycols = False
2616
2618
).T
2617
2619
else :
2618
- df = wgcnaAnalysis .df_sort_by_dendrogram (
2619
- wgcnaAnalysis .df_sort_by_dendrogram (METcor , dendro_tree ).T ,
2620
+ df = wgcna_analysis .df_sort_by_dendrogram (
2621
+ wgcna_analysis .df_sort_by_dendrogram (METcor , dendro_tree ).T ,
2620
2622
dendro_tree ,
2621
2623
)
2622
2624
@@ -3271,7 +3273,7 @@ def get_km_plot(data, identifier, args):
3271
3273
plot .set_xlabel (xlabel )
3272
3274
plot .set_ylabel (ylabel )
3273
3275
if environment == "app" :
3274
- figure = utils . mpl_to_html_image (plot .figure , width = 800 )
3276
+ figure = mpl_to_html_image (plot .figure , width = 800 )
3275
3277
result = html .Div (id = identifier , children = [figure ])
3276
3278
else :
3277
3279
result = plot .figure
@@ -3311,7 +3313,7 @@ def get_cumulative_hazard_plot(data, identifier, args):
3311
3313
plot .set_xlabel (xlabel )
3312
3314
plot .set_ylabel (ylabel )
3313
3315
if environment == "app" :
3314
- figure = utils . mpl_to_html_image (plot .figure , width = 800 )
3316
+ figure = mpl_to_html_image (plot .figure , width = 800 )
3315
3317
result = html .Div (id = identifier , children = [figure ])
3316
3318
else :
3317
3319
result = plot .figure
0 commit comments