首页 > 编程语言 > 详细

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

时间:2019-08-22 12:26:09      阅读:311      评论:0      收藏:0      [点我收藏+]

最近总是有需要单独对某一个类型的通路进行超几何分布的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)

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

原文:https://www.cnblogs.com/raisok/p/11393289.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!