KEGG KAAS Assignment Score (S_KO) 计算模块
KOAssignmentScore
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| KOgeneCounts | 1 | 基于reverse比对计算出每一个ko中的基因总数 |
| CalculateAssignmentScore | 1 | 计算KEGG的KO分配得分 S_KO |
| Log2BinomialRightTailProbability | 1 | 计算二项分布右尾概率的对数 (以2为底) 即计算 log2( sum_{k=N}^{x} C(x,k) * p^k * (1-p)^(x-k) ) |
| Log2BinomialCoefficient | 1 | 计算二项式系数的对数 (以2为底) log2(C(n, k)), 使用 LogGamma 函数来避免计算大数阶乘导致的溢出。 |
| Log2 | 1 | 计算以2为底的对数 |
| AssignBestKO | 1 | 为单个查询基因分配最佳KO。它会评估所有可能的KO,并选择得分最高的一个。 |
| KOCandidates | 1 |
03 Members
IEnumerable(Of BestHit))基于reverse比对计算出每一个ko中的基因总数
| Name | Type | Description |
|---|---|---|
reverse | IEnumerable(Of BestHit) | query is the KO, use input target as subject reference |
Double, Int32, Int32, Int32, Int32, Double)计算KEGG的KO分配得分 S_KO
这个函数直接对应了 KEGG 帮助文档中的公式:
We define a score for each ortholog group in order to assign the best fitting K numbers to the query gene:
S_KO = S_h - log_2(mn) - log_2( sum_{k=N}^{x} C_k * p^k * (1-p)^{x-k} )
where Sh is the highest score among all ortholog candidates in the ortholog group, m and n are the sequence lengths of the query and the target of BLAST, respectively, N is the number of organisms in ortholog group, x is the number of organisms in the original ortholog group from which this group is derived, and p is the ratio of the size of the original ortholog group versus the size of the entire GENES database. The second term is for the normalization of the first term by sequence lengths, and the third term is a weighting factor to consider the number of ortholog candidates that are found in the original.
| Name | Type | Description |
|---|---|---|
Sh | Double | 最高比特分数 |
m | Int32 | 查询基因长度 |
n | Int32 | 参考基因长度 |
x | Int32 | KO中的总基因数 |
N | Int32 | 满足BHR阈值的基因数 |
p | Double | 单个基因满足BHR阈值的经验概率 (p0) |
Assignment Score (S_KO)
Int32, Int32, Double)计算二项分布右尾概率的对数 (以2为底) 即计算 log2( sum_{k=N}^{x} C(x,k) p^k (1-p)^(x-k) )
| Name | Type | Description |
|---|---|---|
x | Int32 | 总试验次数 (对应KO中的总基因数) |
N | Int32 | 成功的最小次数 (对应满足BHR阈值的基因数) |
p | Double | 单次试验成功的概率 (对应经验概率 p0) |
右尾概率的以2为底的对数
Int32, Int32)计算二项式系数的对数 (以2为底) log2(C(n, k)), 使用 LogGamma 函数来避免计算大数阶乘导致的溢出。
Double)计算以2为底的对数
IEnumerable(Of BHRHit), Dictionary(Of String, Int32), Double)为单个查询基因分配最佳KO。它会评估所有可能的KO,并选择得分最高的一个。
| Name | Type | Description |
|---|---|---|
allBHRHitsForQuery | IEnumerable(Of BHRHit) | 该查询基因与所有参考基因的BHR计算结果列表 |
koGeneCounts | Dictionary(Of String, Int32) | 一个字典,包含每个KO的总基因数 |
bhrThreshold | Double | BHR阈值 |
得分最高的KO分配候选,如果没有则返回Nothing
| Name | Type | Description |
|---|---|---|
groupHits | BestHit() | - |
ko | String | - |
x | Int32 | 获取KO的总基因数 x |
bhrThreshold | Double | - |
empiricalProbability | Double | - |