加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
step1_unit_test.py 993 Bytes
一键复制 编辑 原始数据 按行查看 历史
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])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化