本文整理汇总了Python中khmer.GraphLabels.load方法的典型用法代码示例。如果您正苦于以下问题:Python GraphLabels.load方法的具体用法?Python GraphLabels.load怎么用?Python GraphLabels.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类khmer.GraphLabels
的用法示例。
在下文中一共展示了GraphLabels.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_labels_save_load
# 需要导入模块: from khmer import GraphLabels [as 别名]
# 或者: from khmer.GraphLabels import load [as 别名]
def test_get_labels_save_load():
lb_pre = GraphLabels.NodeGraphLabels(20, 1e7, 4)
filename = utils.get_test_data('test-labels.fa')
lb_pre.consume_seqfile_and_tag_with_labels(filename)
# save labels to a file
savepath = utils.get_temp_filename('saved.labels')
lb_pre.save_labels_and_tags(savepath)
# trash the old GraphLabels
del lb_pre
# create new, load labels & tags
graph = Nodegraph(20, 1e7, 4)
lb = GraphLabels.load(savepath, graph)
labels = list(lb.labels())
expected = [0, 1, 2, 3]
for e_label in expected:
assert e_label in labels
for a_label in labels:
assert a_label in expected