Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
rictjo
impetuous
提交
f20c1f47
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 搜索 >>
提交
f20c1f47
编写于
6月 15, 2021
作者:
rictjo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
associations
上级
d0b41ff2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
1 deletion
+28
-1
setup.py
setup.py
+1
-1
src/impetuous/quantification.py
src/impetuous/quantification.py
+27
-0
未找到文件。
setup.py
浏览文件 @
f20c1f47
...
...
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools
.
setup
(
name
=
"impetuous-gfa"
,
version
=
"0.
49.1
"
,
version
=
"0.
50.0
"
,
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/quantification.py
浏览文件 @
f20c1f47
...
...
@@ -468,6 +468,33 @@ def multivariate_factorisation ( analyte_df , journal_df , formula ,
return
(
res_df
)
def
associations
(
M
,
W
=
None
,
bRanked
=
True
)
:
ispanda
=
lambda
P
:
'pandas'
in
str
(
type
(
P
)).
lower
()
if
not
ispanda
(
M
)
:
print
(
"FUNCTION "
,
'recast_alignments'
,
" REQUIRES "
,
'M'
,
" TO BE A PANDAS DATAFRAME"
)
bValid
=
False
if
not
W
is
None
:
if
not
len
(
W
.
columns
.
values
)
==
len
(
M
.
columns
.
values
):
W
=
M
else
:
bValid
=
True
else
:
W
=
M
if
bRanked
:
from
scipy.stats
import
rankdata
M
=
(
M
.
T
.
apply
(
lambda
x
:
rankdata
(
x
,
'average'
)).
T
-
0.5
)
/
len
(
M
.
columns
)
W
=
(
W
.
T
.
apply
(
lambda
x
:
rankdata
(
x
,
'average'
)).
T
-
0.5
)
/
len
(
W
.
columns
)
rho1
=
M
.
T
.
apply
(
lambda
x
:
np
.
sqrt
(
np
.
dot
(
x
,
x
)
)
)
rho2
=
rho1
if
bValid
:
rho2
=
W
.
T
.
apply
(
lambda
x
:
np
.
sqrt
(
np
.
dot
(
x
,
x
)
)
)
R2
=
pd
.
DataFrame
(
np
.
array
([
np
.
array
([
r
])
for
r
in
rho1
.
values
])
*
[
rho2
.
values
]
,
index
=
rho1
.
index
,
columns
=
rho2
.
index
)
PQ
=
pd
.
DataFrame
(
np
.
dot
(
M
,
W
.
T
),
index
=
rho1
.
index
,
columns
=
rho2
.
index
)
res
=
PQ
/
R2
return
(
res
)
crop
=
lambda
x
,
W
:
x
[:,:
W
]
def
run_shape_alignment_regression
(
analyte_df
,
journal_df
,
formula
,
bVerbose
=
False
,
synonyms
=
None
,
blur_cutoff
=
99.8
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录