本文整理汇总了Python中netzob.Common.Type.TypeConvertor.TypeConvertor.deserializeScores方法的典型用法代码示例。如果您正苦于以下问题:Python TypeConvertor.deserializeScores方法的具体用法?Python TypeConvertor.deserializeScores怎么用?Python TypeConvertor.deserializeScores使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类netzob.Common.Type.TypeConvertor.TypeConvertor
的用法示例。
在下文中一共展示了TypeConvertor.deserializeScores方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: processUPGMA
# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import deserializeScores [as 别名]
def processUPGMA(self):
self.log.debug("Computing the associated matrix")
# Serialize the symbols
(serialSymbols, formatSymbols) = TypeConvertor.serializeSymbols(self.symbols, self.unitSize, self.scores)
self.log.debug("Clustering input format " + formatSymbols)
# Execute the Clustering part in C
debug = False
logging.debug("Execute the clustering part in C ...")
(i_max, j_max, maxScore, scores) = _libNeedleman.getHighestEquivalentGroup(self.doInternalSlick, len(self.symbols), formatSymbols, serialSymbols, self.cb_executionStatus, debug)
listScores = TypeConvertor.deserializeScores(self.symbols, scores)
# Retrieve the scores for each association of symbols
self.scores = {}
for (iuid, juid, score) in listScores:
if iuid not in self.scores.keys():
self.scores[iuid] = {}
if juid not in self.scores.keys():
self.scores[juid] = {}
self.scores[iuid][juid] = score
if iuid not in self.scores[juid].keys():
self.scores[juid][iuid] = score
# Reduce the UPGMA matrix (merge symbols by similarity)
self.computePhylogenicTree()
return (i_max, j_max, maxScore)