本文整理汇总了Python中oncotator.Annotator.Annotator._applyManualAnnotations方法的典型用法代码示例。如果您正苦于以下问题:Python Annotator._applyManualAnnotations方法的具体用法?Python Annotator._applyManualAnnotations怎么用?Python Annotator._applyManualAnnotations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oncotator.Annotator.Annotator
的用法示例。
在下文中一共展示了Annotator._applyManualAnnotations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testDefaultAnnotations
# 需要导入模块: from oncotator.Annotator import Annotator [as 别名]
# 或者: from oncotator.Annotator.Annotator import _applyManualAnnotations [as 别名]
def testDefaultAnnotations(self):
"""Test that the default annotation values populate properly. """
annotator = Annotator()
default_annotations = {"test2": "foo2", "test3": "Should not be seen"}
overrides = {'test3': 'foo3'}
m1 = MutationData()
m1.createAnnotation("test1", "foo1")
m1.createAnnotation("test2", "")
m2 = MutationData()
m2.createAnnotation("test1", "")
m3 = MutationData()
m3.createAnnotation("test1", "")
m3.createAnnotation("test2", "foo2-original")
muts = [m1, m2, m3]
muts2 = annotator._applyManualAnnotations(muts, overrides)
muts_final_gen = annotator._applyDefaultAnnotations(muts2, default_annotations)
muts_final = []
for m in muts_final_gen:
self.assertTrue(m['test3'] == "foo3", "Override did not work")
muts_final.append(m)
self.assertTrue(muts_final[0]['test1'] == "foo1")
self.assertTrue(muts_final[0]['test2'] == "foo2")
self.assertTrue(muts_final[0]['test3'] == "foo3")
self.assertTrue(muts_final[1]['test1'] == "")
self.assertTrue(muts_final[1]['test2'] == "foo2")
self.assertTrue(muts_final[1]['test3'] == "foo3")
self.assertTrue(muts_final[2]['test1'] == "")
self.assertTrue(muts_final[2]['test2'] == "foo2-original")
self.assertTrue(muts_final[2]['test3'] == "foo3")