Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
rictjo
impetuous
提交
a31304d0
I
impetuous
项目概览
rictjo
/
impetuous
10 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
impetuous
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a31304d0
编写于
8月 18, 2021
作者:
rictjo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scatter2box styles
上级
ddadc595
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
14 deletion
+33
-14
setup.py
setup.py
+1
-1
src/impetuous/visualisation.py
src/impetuous/visualisation.py
+32
-13
未找到文件。
setup.py
浏览文件 @
a31304d0
...
...
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools
.
setup
(
name
=
"impetuous-gfa"
,
version
=
"0.66.
4
"
,
version
=
"0.66.
5
"
,
author
=
"Richard Tjörnhammar"
,
author_email
=
"richard.tjornhammar@gmail.com"
,
description
=
"Impetuous Quantification, a Statistical Learning library for Humans : Alignments, Clustering, Enrichments and Group Analysis"
,
...
...
src/impetuous/visualisation.py
浏览文件 @
a31304d0
...
...
@@ -78,7 +78,7 @@ def bscatter ( X , Y , additional_dictionary=None , title='' , color='#ff0000' ,
hover
=
HoverTool
(
tooltips
=
ttips
)
#
if
p
is
None
:
p
=
figure
(
plot_width
=
600
,
plot_height
=
600
,
p
=
figure
(
plot_width
=
600
,
plot_height
=
600
,
tools
=
[
hover
,
'box_zoom'
,
'wheel_zoom'
,
'pan'
,
'reset'
,
'save'
],
title
=
title
)
...
...
@@ -238,7 +238,7 @@ def a_plot( ds, xvar, yvar, tools, xlab, ylab,
def
box_plot
(
box_source
,
categories
,
not_empty
=
False
,
with_line
=
False
,
tools
=
[
'save'
],
plot_pane_width
=
400
,
plot_pane_height
=
400
,
title
=
''
,
score
=
''
,
scatter_data_source
=
None
)
:
p
=
figure
(
tools
=
tools
,
background_fill_color
=
"#
EFE8E2
"
,
title
=
title
,
x_range
=
categories
,
p
=
figure
(
tools
=
tools
,
background_fill_color
=
"#
FFFFFF
"
,
title
=
title
,
x_range
=
categories
,
plot_width
=
plot_pane_width
,
plot_height
=
plot_pane_height
)
if
'dict'
in
str
(
type
(
box_source
))
:
...
...
@@ -358,10 +358,11 @@ def make_text_search_wb ( name , title='Input name:', variable_name='tval' ,
"""
text_input
=
TextInput
(
value
=
name
,
title
=
title
)
toggle
=
Toggle
(
label
=
"Search"
,
button_type
=
"success"
)
from
bokeh.events
import
ButtonClick
from
bokeh.models
import
Button
,
CustomJS
button
=
Button
()
button
.
label
=
"Search"
;
new_code
=
[]
div
=
Div
(
width
=
500
)
...
...
@@ -431,7 +432,8 @@ def scatter2boxplot( pathways, x1, y1, variables, patients, pathway2patient_x
axis_labels
=
None
,
out_file_name
=
"callback.html"
,
category_override
=
'Time'
,
dynamic_labelx
=
None
,
dynamic_labely
=
None
,
pathway2patient_y
=
None
,
title_l
=
None
,
title_r
=
None
,
patient_pos
=
None
,
category_pos
=
None
,
categories
=
None
,
xLtype
=
'auto'
,
yLtype
=
'auto'
,
chart_dicts
=
None
,
bShow
=
False
,
chart_titles
=
None
,
with_input_search
=
True
)
:
chart_dicts
=
None
,
bShow
=
False
,
chart_titles
=
None
,
with_input_search
=
True
,
bDebug
=
False
,
bReturnFigureHandle
=
True
)
:
#
triggercode
=
".change.emit();"
if
legacy
:
...
...
@@ -678,7 +680,8 @@ function quartileBounds(values,groups) {
arguments
=
arg_dict
for
vd_add_dict
in
vb_chart_dicts
:
arguments
.
update
(
vd_add_dict
)
print
([
item
for
item
in
arguments
.
keys
()],
bokeh_script
)
if
bDebug
:
print
([
item
for
item
in
arguments
.
keys
()],
bokeh_script
)
left_pane_data_source
.
selected
.
js_on_change
(
'indices'
,
CustomJS
(
args
=
arguments
,
code
=
bokeh_script
)
)
if
not
vb_charts
is
None
:
...
...
@@ -691,11 +694,14 @@ function quartileBounds(values,groups) {
#
if
with_input_search
:
arguments
.
update
(
dict
(
left
=
left_pane_data_source
))
text_wb
=
make_text_search_wb
(
'Name of
pathway
'
,
variable_name
=
'uinp'
,
args
=
arguments
,
dep_code
=
bokeh_script
)
text_wb
=
make_text_search_wb
(
'Name of
group
'
,
variable_name
=
'uinp'
,
args
=
arguments
,
dep_code
=
bokeh_script
)
clo
=
row
(
text_wb
,
lo
)
else
:
clo
=
lo
#
if
bReturnFigureHandle
:
return
(
clo
)
if
bShow
:
show
(
clo
)
else
:
...
...
@@ -1042,10 +1048,6 @@ def merge_list_to_rows(pt1,pt2):
return
merged
def
invert_dictlist
(
effects
):
#
# CREATE A SAMPLE EFFECT LOOKUP
...
...
@@ -1229,7 +1231,7 @@ def create_paired_figure_p ( data_df , feature_name = None ,
def
example_dynamic_linking
(
bCLI
=
True
):
desc__
=
""" scatter2boxplot( ["P1","P2","P3"], [10.0,7.0,12.0], [2.0,4.0,16.5], {'funny':["yes","no","maybe"]},
[('','Kalle','0','0'),('','Kalle','1','1'),('','Stina','0','2'),('','Stina','1','3'),('','Jens','0','2'),('','Jens','1','3'),
('','Anna','0','0'),('','Anna','1','1'),('','Adam','0','0'),('','Adam','1','1'),('','Niklas','0','2'),('','Niklas','1','3'),
...
...
@@ -1399,9 +1401,26 @@ def set_scatter2boxplot_style ( plots ,
if
__name__
==
'__main__'
:
example_dynamic_linking
(
False
)
example_lineplot
(
False
)
if
False
:
example_dynamic_linking
(
False
)
example_lineplot
(
False
)
#TODO : ADD MORE CUSTOMIZABILITY FOR USERS. MAKE A DYNAMICALLY LINKED LINEPLOT
if
True
:
plots
=
scatter2boxplot
(
[
"P1"
,
"P2"
,
"P3"
],
[
10.0
,
7.0
,
12.0
],
[
2.0
,
4.0
,
16.5
],
{
'funny'
:[
"yes"
,
"no"
,
"maybe"
]},
[(
''
,
'Kalle'
,
'0'
,
'0'
),(
''
,
'Kalle'
,
'1'
,
'1'
),(
''
,
'Stina'
,
'0'
,
'2'
),(
''
,
'Stina'
,
'1'
,
'3'
),(
''
,
'Jens'
,
'0'
,
'2'
),(
''
,
'Jens'
,
'1'
,
'3'
),
(
''
,
'Anna'
,
'0'
,
'0'
),(
''
,
'Anna'
,
'1'
,
'1'
),(
''
,
'Adam'
,
'0'
,
'0'
),(
''
,
'Adam'
,
'1'
,
'1'
),(
''
,
'Niklas'
,
'0'
,
'2'
),(
''
,
'Niklas'
,
'1'
,
'3'
),
(
''
,
'Lina'
,
'0'
,
'2'
),(
''
,
'Lina'
,
'1'
,
'3'
),(
''
,
'Stina'
,
'0'
,
'0'
),(
''
,
'Stina'
,
'1'
,
'1'
)],
[[
3.0
,
3.1
,
5.2
,
10.2
,
7.0
,
17.1
,
2.0
,
2.5
,
1.5
,
1.8
,
6.1
,
16.2
,
7.4
,
16.3
,
3.2
,
2.4
],
[
4.1
,
14.0
,
2.3
,
2.3
,
2.0
,
3.0
,
2.0
,
13.1
,
4.0
,
12.2
,
4.2
,
14.0
,
2.1
,
2.2
,
4.5
,
15.5
],
[
14.1
,
2.1
,
2.2
,
2.1
,
3.2
,
3.4
,
12.5
,
2.5
,
15.6
,
5.6
,
1.2
,
2.0
,
2.2
,
2.2
,
11.1
,
2.1
]
],
[
125.2
,
125.2
,
75.0
,
75.0
,
75.0
,
75.0
,
175.0
,
175.0
,
135.2
,
135.2
,
65.0
,
65.0
,
55.0
,
55.0
,
195.0
,
195.0
],
[
0
,
0
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
0
,
0
]
,
{
'x1'
:
'x axis'
,
'y1'
:
'y axis'
,
'x2'
:
'x axis'
,
'y2'
:
'y axis'
,
0
:
(
'healthy'
,
"blue"
),
1
:
(
'sick'
,
'red'
)}
,
categories
=
{
'0'
:
'Basal-H'
,
'1'
:
'30min-H'
,
'2'
:
'Basal-S'
,
'3'
:
'30min-S'
},
patient_pos
=
1
,
category_pos
=
3
,
bShow
=
False
)
set_scatter2boxplot_style
(
plots
)
show
(
plots
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录