• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

pvalueforgokeggenrichment

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
 

Simple, fast implementation of Fisher’s exact test. . For example, for the following table:

o Having the property Not having the property
Selected 12 5
Not selected 29 2

Perhaps we are interested in whether there is any difference of property in selected vs. non-selected groups, then we can do the Fisher’s exact test.

def fish_test(sample_hit, pop_hit, sample_count, root_count):
### sample_hit: 该样本中基因属于该term下面的个数
### pop_hit: 该物种的所有基因属于该term下面的个数
### sample_count: 样本中基因的个数
### root_count: 该物种在bp/cc/mf root 下基因的个数
sample_hit = int(sample_hit)
pop_hit = int(pop_hit)
sample_count = int(sample_count)
root_count = int(root_count)
sample_nhit = sample_count - sample_hit
pop_nhit = root_count - pop_hit
n1,n2,n3,n4 = (sample_hit, pop_hit - sample_hit,
sample_nhit, pop_nhit - sample_nhit)
p = abs(pvalue(n1,n2,n3,n4).right_tail)
return p

 

使用公式 phyper(k-1,M, N-M, n, lower.tail=FALSE)
     那么做为背景,总体基因为N,属于“化学刺激响应”这个分类的基因有M个。
     现在抽了n个基因,里面有k个基于这个分类,p值为
针对下面这个通路我做了计算, 和 用Python 包算的一致.
> phyper(16-1,45,7057-45,98,lower.tail=FALSE)
[1] 2.503033e-19
> phyper(11-1,48,7057-48,98,lower.tail=FALSE)
[1] 3.09068e-11
 
 
Index Pathway Name Pathway ID Pvalue Pvalue_adjusted Genes Count Pop Hit List_Total Background Genes Class
1 ABC transporters hsa02010 2.50e-19 4.71e-17 16 45 98 7057 Environmental Information Processing
2 Fatty acid metabolism hsa01212 3.09e-11 2.91e-09 11 48 98 7057 Metabolism


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Go开发环境安装发布时间:2022-07-10
下一篇:
go mysql 实现数据库不定字段查询匹配发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap