本文整理汇总了Python中oncotator.TranscriptProviderUtils.TranscriptProviderUtils.retrieve_effect_dict方法的典型用法代码示例。如果您正苦于以下问题:Python TranscriptProviderUtils.retrieve_effect_dict方法的具体用法?Python TranscriptProviderUtils.retrieve_effect_dict怎么用?Python TranscriptProviderUtils.retrieve_effect_dict使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oncotator.TranscriptProviderUtils.TranscriptProviderUtils
的用法示例。
在下文中一共展示了TranscriptProviderUtils.retrieve_effect_dict方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _choose_best_effect_transcript
# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import retrieve_effect_dict [as 别名]
def _choose_best_effect_transcript(self, txs, variant_type, ref_allele, alt_allele, start, end):
"""Choose the transcript with the most detrimental effect.
The rankings are in TranscriptProviderUtils.
Ties are broken by which transcript has the longer coding length.
:param list txs: list of Transcript
:param str variant_type:
:param str ref_allele:
:param str alt_allele:
:param str start:
:param str end:
:return Transcript:
"""
vcer = VariantClassifier()
effect_dict = TranscriptProviderUtils.retrieve_effect_dict()
best_effect_score = 100000000 # lower score is more likely to get picked
best_effect_tx = None
for tx in txs:
if (ref_allele == "" or ref_allele == "-") and (alt_allele == "" or alt_allele == "-"):
vc = VariantClassification.SILENT
else:
vc = vcer.variant_classify(tx, ref_allele, alt_allele, start, end, variant_type).get_vc()
effect_score = effect_dict.get(vc, 25)
if effect_score < best_effect_score:
best_effect_score = effect_score
best_effect_tx = tx
elif (effect_score == best_effect_score) and (len(best_effect_tx.get_seq()) < len(tx.get_seq())):
best_effect_score = effect_score
best_effect_tx = tx
return best_effect_tx
示例2: _calculate_effect_score
# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import retrieve_effect_dict [as 别名]
def _calculate_effect_score(tx, start, end, alt_allele, ref_allele, variant_type):
"""Compute the effect score"""
effect_dict = TranscriptProviderUtils.retrieve_effect_dict()
vcer = VariantClassifier()
if (ref_allele == "" or ref_allele == "-") and (alt_allele == "" or alt_allele == "-"):
vc = VariantClassification.SILENT
else:
vc = vcer.variant_classify(tx, ref_allele, alt_allele, start, end, variant_type).get_vc()
effect_score = effect_dict.get(vc, 25)
return effect_score