当前位置: 首页>>代码示例>>Python>>正文


Python TranscriptProviderUtils.retrieve_effect_dict方法代码示例

本文整理汇总了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
开发者ID:alexramos,项目名称:oncotator,代码行数:33,代码来源:EnsemblTranscriptDatasource.py

示例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
开发者ID:Tmacme,项目名称:oncotator,代码行数:12,代码来源:EnsemblTranscriptDatasource.py


注:本文中的oncotator.TranscriptProviderUtils.TranscriptProviderUtils.retrieve_effect_dict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。