代码拉取完成,页面将自动刷新
import umi_tools.network as network
from itertools import product
input_data = {"ACGT": 456,
"AAAT": 90,
"ACAT": 72,
"TCGT": 2,
"CCGT": 2,
"ACAG": 1}
output_data = {"unique": [['ACAG'], ['ACGT'], ['ACAT'], ['CCGT'], ['TCGT'], ['AAAT']],
"percentile": [['ACAG'], ['ACGT'], ['ACAT'], ['CCGT'], ['TCGT'], ['AAAT']],
"cluster": [['ACGT', 'AAAT', 'ACAT', 'CCGT', 'TCGT', 'ACAG']],
"adjacency": [['ACGT', 'CCGT', 'TCGT'], ['AAAT'], ['ACAT', 'ACAG']],
"directional": [['ACGT', 'ACAT', 'TCGT', 'CCGT', 'ACAG'], ['AAAT']]}
methods = ["unique", "percentile", "cluster", "adjacency", "directional"]
for method in methods:
clusterer = network.UMIClusterer(method)
clusters = clusterer(input_data.keys(), input_data, threshold=1)
assert clusters == output_data[method], \
"failed on method %s\n %s is not %s" % (method, clusters, output_data[method])
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。