本文整理汇总了Python中oncotator.Annotator.Annotator.annotate_mutations方法的典型用法代码示例。如果您正苦于以下问题:Python Annotator.annotate_mutations方法的具体用法?Python Annotator.annotate_mutations怎么用?Python Annotator.annotate_mutations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oncotator.Annotator.Annotator
的用法示例。
在下文中一共展示了Annotator.annotate_mutations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _simple_annotate
# 需要导入模块: from oncotator.Annotator import Annotator [as 别名]
# 或者: from oncotator.Annotator.Annotator import annotate_mutations [as 别名]
def _simple_annotate(self, is_skip_no_alts):
runSpec = RunSpecification()
runSpec.initialize(None, None, datasources=[], is_skip_no_alts=is_skip_no_alts)
# Initialize the annotator with the runspec
annotator = Annotator()
annotator.initialize(runSpec)
m = MutationData()
m.chr = "1"
m.start = "12941796"
m.end = "12941796"
m.alt_allele = "G"
m.ref_allele = "T"
m.createAnnotation("alt_allele_seen", "False")
m2 = MutationData()
m2.chr = "1"
m2.start = "12941796"
m2.end = "12941796"
m2.alt_allele = "G"
m2.ref_allele = "T"
muts = [m, m2]
muts = annotator.annotate_mutations(muts)
ctr = 0
for m in muts:
ctr += 1
return ctr
示例2: testAnnotateListOfMutations
# 需要导入模块: from oncotator.Annotator import Annotator [as 别名]
# 或者: from oncotator.Annotator.Annotator import annotate_mutations [as 别名]
def testAnnotateListOfMutations(self):
"""Test that we can initialize an Annotator, without an input or output and then feed mutations,
one at a time... using a runspec"""
# Locate the datasource directory and create a runspec
dbDir = self.config.get("DEFAULT", "dbDir")
ds = DatasourceFactory.createDatasources(dbDir)
runSpec = RunSpecification()
runSpec.initialize(None, None, datasources=ds)
# Initialize the annotator with the runspec
annotator = Annotator()
annotator.initialize(runSpec)
m = MutationData()
m.chr = "1"
m.start = "12941796"
m.end = "12941796"
m.alt_allele = "G"
m.ref_allele = "T"
muts = [m]
muts = annotator.annotate_mutations(muts)
m2 = muts.next()
self.assertTrue(m2.get("gene", None) is not None)
示例3: testSkippingAltsForSingleMut
# 需要导入模块: from oncotator.Annotator import Annotator [as 别名]
# 或者: from oncotator.Annotator.Annotator import annotate_mutations [as 别名]
def testSkippingAltsForSingleMut(self):
"""Test a simple case where a single mutation with alt_allele_seen of False is not produced."""
runSpec = RunSpecification()
runSpec.initialize(None, None, datasources=[], is_skip_no_alts=True)
# Initialize the annotator with the runspec
annotator = Annotator()
annotator.initialize(runSpec)
m = MutationData()
m.chr = "1"
m.start = "12941796"
m.end = "12941796"
m.alt_allele = "G"
m.ref_allele = "T"
m.createAnnotation("alt_allele_seen", "False")
muts = [m]
muts = annotator.annotate_mutations(muts)
self.assertRaises(StopIteration, muts.next)