compBijection(ScISI)
compBijection()所属R语言包:ScISI
A recursive function that greedily handles the alignment issue
一个递归函数,贪婪地处理对齐问题
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function takes a matrix of similarity measures (e.g. Jaccard Index) between the TSNMat and the estMat and finds the maximal value of this matrix and records its position (i,j). Then it matches C-i to K-j and then deletes row i and colunm j creating a matrix with one less row and one less colunm. The function calls itself recursively using this smaller matrix as the new argument. It stops when there are either no rows left or no columns left or the matrix of similarity measures is reduced to a 0-matrix and breaks from the recursive loop.
这个函数接受一个相似的措施(如Jaccard指数)之间的TSNMat和estMat矩阵,并认为这个矩阵的最大价值,并记录其位置(I,J)。那么它匹配词来KJ,然后删除第i行和j colunm创造一个少一个排和一个少colunm矩阵。该函数调用自身的递归使用这个小矩阵作为新的参数。它停止时,是有没有行向左或向左或不列,矩阵的相似性措施是降低到0-矩阵和递归循环中断。
用法----------Usage----------
compBijection(TSNMat, estMat, c2kMatrix, bijMat, counter = 1)
参数----------Arguments----------
参数:TSNMat
The first bipartite graph matrix
第一个二分图矩阵
参数:estMat
The second bipartite graph matrix
第二个二分图矩阵
参数:c2kMatrix
A matrix of similarity measure
一个矩阵的相似性度量
参数:bijMat
A recording matrix to keep the alignment
录音矩阵,以保持对齐
参数:counter
A place keeping index
一个地方保持指数
Details
详情----------Details----------
The function creates a greedy matching between two bipartite graphs (where complexes C-i of the first bipartite graph matrix, bg1, is matched to complexes K-j of the second bipartite graph matrix, bg2). The particular greedy algorithm is as follows:
该函数创建一个两二部图(词的第一个二分图矩阵,BG1,配合物的匹配,以配合第二次二分图矩阵,BG2 KJ)贪婪匹配。特别贪心算法如下:
1. When the function is called, the parameter c2kMatrix is parsed and the maximal element, m, is found. If m is not unique in the matrix, the function looks to every position where m occurs: (i,j)...(m,n). To chose a particular position, the size of the complexes are taken into consideration, i.e. the function compares the cardinalities of (C-i + K-j) ... (C-n + K-n). And the pair, wlog (i,j), of complexes with the largest cardinality is selected (if there is again a tie amongst cardinalities, then a random choice is made).
1。当函数被调用时,参数c2kMatrix被解析,极大元,米,被发现。如果m是在独特的矩阵,功能看起来到每个岗位,其中m发生:(I,J)...(M,N)。要选择一个特定的位置,配合物的大小考虑,即功能比较的基数(CI + KJ)... (C - N + K-N)。和,wlog(I,J)配合物的最大基数,对被选中(如果有,又是一个在基数中的领带,然后随机选择)。
2. The function matches C-i to K-j and records this alignment into bijMat. Row i and colunm j is deleted from c2kMatrix, creating a new matrix called c2kM.
2。功能相匹配词KJ和记录到bijMat这一调整。排我和j colunm从c2kMatrix删除,创建一个新的矩阵称为c2kM。
3. If the dimension of this matrix is nonzero or if the matrix itself has some nonzero element, the function recursively calls itself with the new argument, c2kM.
3。如果这个矩阵的维数是非零或如果矩阵本身具有一定的非零元素,函数的递归调用自己的新论点,c2kM。
4. Because the dimension is always decreased with every call, this function must terminate in some finite number of steps.
4。因为维度始终与减少每次通话时,此功能必须终止一些数量有限的步骤。
5. bijMat will have recorded the greedily matched complexes between bg1 and bg2.
5。 bijMat将记录之间BG1和BG2的贪婪匹配的复合物。
值----------Value----------
A matrix with the rows recording the alignment: the first colunm records complexes of TSNMat; the second column records complexes of estMat; and the third column records the similarity measure. The rows will also denote the ordering of the matchings, i.e. row 1 will denote the first match, etc.
第二列记录的estMat复合物;和第三列记录的相似性度量,的第一colunm记录络合物TSNMat:记录行的对齐矩阵。行会也表示匹配的顺序,即第1行表示的首场比赛,等等。
作者(S)----------Author(s)----------
Tony Chiang
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|