conformityDecomposition(WGCNA)
conformityDecomposition()所属R语言包:WGCNA
Conformity and module based decomposition of a network adjacency matrix.
整合和模块基于网络的邻接矩阵的分解。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function calculates the conformity based approximation A.CF of an adjacency matrix and a factorizability measure codeFactorizability. If a module assignment Cl is provided, it also estimates a corresponding intermodular adjacency matrix. In this case, function automatically carries out the module- and conformity based decomposition of the adjacency matrix described in chapter 2 of (Horvath 2011).
该函数计算符合基于近似A.CF的邻接矩阵和factorizability措施codeFactorizability。如果一个模块分配Cl提供,它也估计一个相应的intermodular的的邻接矩阵。在这种情况下,会自动执行功能基于模块和合格的分解的邻接矩阵(霍瓦特2011)第2章中描述的。
用法----------Usage----------
conformityDecomposition(adj, Cl = NULL)
参数----------Arguments----------
参数:adj
a symmetric numeric matrix (or data frame) whose entries lie between 0 and 1.
一个对称数字矩阵(或数据框),其位于0和1之间的条目。
参数:Cl
a vector (or factor variable) of length equal to the number of rows of adj. The variable assigns each network node (row of adj) to a module. The entries of Cl could be integers or character strings.
adj的数量的行的长度等于(或因子变量)的矢量。变量分配给每一个网络节点(行的adj)一个模块。 Cl的条目可以是整数或字符串。
Details
详细信息----------Details----------
We distinguish two situation depending on whether or not Cl equals NULL. 1) Let us start out assuming that Cl = NULL. In this case, the function calculates the conformity vector for a general, possibly non-factorizable network adj by minimizing a quadratic (sums of squares) loss function. The conformity and factorizability for an adjacency matrix is defined in (Dong and Horvath 2007, Horvath and Dong 2008) but we briefly describe it in the following. A network is called exactly factorizable if the pairwise connection strength (adjacency) between 2 network nodes can be factored into node specific contributions, named node 'conformity', i.e. if adj[i,j]=Conformity[i]*Conformity[j]. The conformity turns out to be highly related to the network connectivity (aka degree). If adj is not exactly factorizable, then the function conformityDecomposition calculates a conformity vector of the exactly factorizable network that best approximates adj. The factorizability measure Factorizability is a number between 0 and 1. The higher Factorizability, the more factorizable is adj. Warning: the algorithm may only converge to a local optimum and it may not converge at all. Also see the notes below.
我们要区分两种情况取决于是否Cl等于NULL。 1)让我们开始假设Cl = NULL。在这种情况下,该函数将计算符合一般向量,可能非因子化网络adj通过最小化损失函数的二次(平方和)。邻接矩阵的的整合和factorizability为中定义(董和霍瓦特2007年,霍瓦特和东2008),但我们简要介绍一下它在下面。的网络被称为完全因子分解,如果成对连接强度(邻接)可被分解成2个网络节点之间的节点的具体贡献,名为“节点”符合“,即如果adj[i,j]=Conformity[i]*Conformity[j]。符合可谓是高度相关的网络连接(又名程度)。如果adj是不完全因子分解,然后计算的功能conformityDecomposition一个符合完全因子分解的矢量网络,最好的接近adj。 factorizability措施Factorizability是0和1之间的一个数。较高的Factorizability,更多的因子分解是:adj。警告:该算法可收敛到局部最优,它可能不收敛。另请参阅下面的注释。
2) Let us now assume that Cl is not NULL, i.e. it specifies the module assignment of each node. Then the function calculates a module- and CF-based approximation of adj (explained in chapter 2 in Horvath 2011). In this case, the function calculates a conformity vector Conformity and a matrix IntermodularAdjacency such that adj[i,j] is approximately equal to Conformity[i]*Conformity[j]*IntermodularAdjacency[module.index[i],module.index[j]] where module.index[i] is the row of the matrix IntermodularAdjacency that corresponds to the module assigned to node i. To estimate Conformity and a matrix IntermodularAdjacency, the function attempts to minimize a quadratic loss function (sums of squares). Currently, the function only implements a heuristic algorithm for optimizing the objective function (chapter 2 of Horvath 2011). Another, more accurate Majorization Minorization (MM) algorithm for the decomposition is implemented in the function propensityDecomposition by Ranola et al (2011).
2)现在让我们假设这Cl是不是NULL,也就是说,它的每个节点分配指定的模块。然后,该函数计算模块和CF-逼近的adj(解释在“霍瓦特2011”第2章)。在这种情况下,该函数将计算的合格向量Conformity和矩阵IntermodularAdjacency,adj[i,j]约等于Conformity[i]*Conformity[j]*IntermodularAdjacency[module.index[i],module.index[j]]module.index[i]行的矩阵IntermodularAdjacency对应的模块分配给节点i。估计Conformity和矩阵IntermodularAdjacency,则该函数尝试,以尽量减少二次损失函数(平方和)。目前,该功能只实现了一个启发式算法优化的目标函数(第2章的霍瓦特2011)。另外,更精确的控制不等式,小众化(MM)的分解算法在功能实现propensityDecompositionRanola等人(2011年)。
值----------Value----------
参数:A.CF
a symmetric matrix that approximates the input matrix adj. Roughly speaking, the i,j-the element of the matrix equals Conformity[i]*Conformity[j]*IntermodularAdjacency[module.index[i],module.index[j]] where module.index[i] is the row of the matrix IntermodularAdjacency that corresponds to the module assigned to node i.
一个对称矩阵,输入矩阵adj相若。粗略地讲,第i,第j元素的矩阵等于Conformity[i]*Conformity[j]*IntermodularAdjacency[module.index[i],module.index[j]]其中module.index[i]是IntermodularAdjacency,对应于分配给节点i的模块的矩阵的行。
参数:Conformity
a numeric vector whose entries correspond to the rows of codeadj. If Cl=NULL then Conformity[i] is the conformity. If Cl is not NULL then Conformity[i] is the intramodular conformity with respect to the module that node i belongs to.
一个数值向量的条目对应的行codeadj。如果Cl=NULL然后Conformity[i]是整合。如果Cl不为null,则Conformity[i]是符合的模块,节点i属于intramodular。
参数:IntermodularAdjacency
a symmetric matrix (data frame) whose rows and columns correspond to the number of modules specified in Cl. Interpretation: it measures the similarity (adjacency) between the modules. In this case, the rows (and columns) of IntermodularAdjacency correspond to the entries of Cl.level.
一个对称矩阵(数据框)的行和列对应的数量的模块中指定Cl。解读:它可以测量各模块之间的相似性(邻接)。在这种情况下,的行(列)中的IntermodularAdjacency对应条目Cl.level。
参数:Factorizability
is a number between 0 and 1. If Cl=NULL then it equals 1, if (and only if) adj is exactly factorizable. If Cl is a vector, then it measures how well the module- and CF based decomposition approximates adj.
是0和1之间的一个数。如果Cl=NULL那么等于1,如果(且仅当)adj的是完全因子分解。如果Cl是一个向量,那么它可以测量模块和CF的分解近似adj。
参数:Cl.level
is a vector of character strings which correspond to the factor levels of the module assignment Cl. Incidentally, the function automatically turns Cl into a factor variable. The components of Conformity and IntramodularFactorizability correspond to the entries of Cl.level.
是一个向量的字符串对应的因子水平的模块分配Cl。顺便说一句,该功能会自动开启Cl到的一个因素变量。成分的一致性和IntramodularFactorizability对应的条目的Cl.level。
参数:IntramodularFactorizability
is a numeric vector of length equal to the number of modules specified by Cl. Its entries report the factorizability measure for each module. The components correspond to the entries of Cl.level.
是一个数值向量的长度等于所指定Cl的数量的模块。它的条目,每个模块的factorizability措施。的组件对应条目Cl.level。
参数:listConformity
注意----------Note----------
Regarding the situation when Cl=NULL. One can easily show that the conformity vector is not unique if adj contains only 2 nodes. However, for more than 2 nodes the conformity is uniquely defined when dealing with an exactly factorizable weighted network whose entries adj[i,j] are larger than 0. In this case, one can get explicit formulas for the conformity (Dong and Horvath 2007).
时的情况Cl=NULL。人们可以很容易的整合向量不是唯一的,如果adj只包含2个节点。然而,对于超过2个节点的整合是唯一定义的处理完全因子分解的加权网络,其adj[i,j]是大于0的项目。在这种情况下,可以得到明确的公式为(董和霍瓦特2007)的的整合。
(作者)----------Author(s)----------
Steve Horvath
参考文献----------References----------
Horvath S, Dong J (2008) Geometric Interpretation of Gene Co-Expression Network Analysis. PloS Computational Biology. 4(8): e1000117. PMID: 18704157 Horvath S (2011) Weighted Network Analysis. Applications in Genomics and Systems Biology. Springer Book. ISBN: 978-1-4419-8818-8 Ranola JMO, Langfelder P, Song L, Horvath S, Lange K (2011) An MM algorithm for the module- and propensity based decomposition of a network. Currently a draft.
参见----------See Also----------
conformityBasedNetworkConcepts
conformityBasedNetworkConcepts
实例----------Examples----------
# assume the number of nodes can be divided by 2 and by 3[假设可划分为2和3的节点数目]
n=6
# here is a perfectly factorizable matrix[这里是一个完美的因子分解矩阵]
A=matrix(1,nrow=n,ncol=n)
# this provides the conformity vector and factorizability measure[这提供了整合的向量和factorizability措施]
conformityDecomposition(adj=A)
# now assume we have a class assignment[现在假设我们有一个类分配]
Cl=rep(c(1,2),c(n/2,n/2))
conformityDecomposition(adj=A,Cl=Cl)
# here is a block diagonal matrix[这里是一个块对角矩阵]
blockdiag.A=A
blockdiag.A[1n/3),(n/3+1):n]=0
blockdiag.A[(n/3+1):n , 1n/3)]=0
block.Cl=rep(c(1,2),c(n/3,2*n/3))
conformityDecomposition(adj= blockdiag.A,Cl=block.Cl)
# another block diagonal matrix[另一个块对角矩阵]
blockdiag.A=A
blockdiag.A[1n/3),(n/3+1):n]=0.3
blockdiag.A[(n/3+1):n , 1n/3)]=0.3
block.Cl=rep(c(1,2),c(n/3,2*n/3))
conformityDecomposition(adj= blockdiag.A,Cl=block.Cl)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|