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


Python TranscriptProviderUtils.determine_closest_distance_from_exon方法代码示例

本文整理汇总了Python中oncotator.TranscriptProviderUtils.TranscriptProviderUtils.determine_closest_distance_from_exon方法的典型用法代码示例。如果您正苦于以下问题:Python TranscriptProviderUtils.determine_closest_distance_from_exon方法的具体用法?Python TranscriptProviderUtils.determine_closest_distance_from_exon怎么用?Python TranscriptProviderUtils.determine_closest_distance_from_exon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oncotator.TranscriptProviderUtils.TranscriptProviderUtils的用法示例。


在下文中一共展示了TranscriptProviderUtils.determine_closest_distance_from_exon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_splice_site_coordinates

# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import determine_closest_distance_from_exon [as 别名]
    def _get_splice_site_coordinates(self, t, start, end, exon_i):
        """Returns distance from exon."""

        left_diff, right_diff = TranscriptProviderUtils.determine_closest_distance_from_exon(start, end, exon_i,  t)

        if abs(left_diff) < abs(right_diff):
            dist_from_exon = left_diff * -1
            if dist_from_exon > -1: dist_from_exon = -1
        elif abs(right_diff) < abs(left_diff):
            dist_from_exon = right_diff * -1
            if dist_from_exon < 1: dist_from_exon = 1
        else:
            dist_from_exon = 0

        if t.get_strand() == "-":
            dist_from_exon *= -1
        return dist_from_exon
开发者ID:alexramos,项目名称:oncotator,代码行数:19,代码来源:VariantClassifier.py

示例2: _extract_exon_info

# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import determine_closest_distance_from_exon [as 别名]
    def _extract_exon_info(self, position, tx):
        """
        Create basic information about the given position relative to the transcript.

        :param int position: in genomic space
        :param Transcript tx:
         :return tuple:
            [0]: closest exon index of the position (0-based),
             [1]: whether the distance was left in genomic space (false for overlap)
             [2]: whether the position overlaps an exon

        """
        exon_index = TranscriptProviderUtils.determine_closest_exon(tx, position, position)
        if exon_index is None:
            return exon_index, None, None, None
        left_distance, right_distance = TranscriptProviderUtils.determine_closest_distance_from_exon(position, position,
                                                                                                     exon_index, tx)
        is_in_exon = (left_distance <= 0) and (right_distance >= 0)
        is_diff_is_positive = (left_distance > 0) and (right_distance > 0)
        is_negative_strand = (tx.get_strand() == "-")
        return exon_index, is_diff_is_positive, is_in_exon, is_negative_strand
开发者ID:alexramos,项目名称:oncotator,代码行数:23,代码来源:EnsemblTranscriptDatasource.py

示例3: test_determine_closest_distance_from_exon_in_exon

# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import determine_closest_distance_from_exon [as 别名]
    def test_determine_closest_distance_from_exon_in_exon(self):
        tx = self.retrieve_test_transcript_MAPK1()

        # Right in exon 1
        left_diff, right_diff = TranscriptProviderUtils.determine_closest_distance_from_exon(22162000, 22162005, 1,  tx)
        self.assertTrue(left_diff < 0 and right_diff > 0, "left distance should be negative while right distance should be positive.")
开发者ID:alexramos,项目名称:oncotator,代码行数:8,代码来源:TranscriptProviderUtilsTest.py


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