本文整理匯總了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