加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python scipy包进行GO富集分析p值计算

发布时间:2020-12-20 10:54:34 所属栏目:Python 来源:网络整理
导读:最近总是有需要单独对某一个类型的通路进行超几何分布的p值计算,这里记录一下python包的计算方法 使用scipy的stat里面的hypergeom.sf方法进行富集分析的p值计算 hsaxxxxx AA and Linoleic metabolism KEGG pathways Pathways KEGG (Homo sapiens (human)) 5

最近总是有需要单独对某一个类型的通路进行超几何分布的p值计算,这里记录一下python包的计算方法

使用scipy的stat里面的hypergeom.sf方法进行富集分析的p值计算

hsaxxxxx AA and Linoleic metabolism KEGG pathways Pathways KEGG (Homo sapiens (human)) 59 17 3586 141 3.32E-11

------------ set in set background in background
pathway 59 17 3586 141
description k x m+n m

x: the number of white balls drawn without replacement from an urn which contains both black and white balls.
m: the number of white balls in the urn
n: the number of black balls in the urn
k: number of balls drawn from the urn

from scipy import stats
#需要注意的是16是由17-1得到的
stats.hypergeom.sf(16,3586,141,59)

R中的实现方式

phyper(x,m,n,k,lower.tail=FALSE)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读