本文整理汇总了Python中oncotator.TranscriptProviderUtils.TranscriptProviderUtils.render_transcript_change方法的典型用法代码示例。如果您正苦于以下问题:Python TranscriptProviderUtils.render_transcript_change方法的具体用法?Python TranscriptProviderUtils.render_transcript_change怎么用?Python TranscriptProviderUtils.render_transcript_change使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oncotator.TranscriptProviderUtils.TranscriptProviderUtils
的用法示例。
在下文中一共展示了TranscriptProviderUtils.render_transcript_change方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_transcript_change_from_tx
# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import render_transcript_change [as 别名]
def generate_transcript_change_from_tx(self, tx, variant_type, vc, start_genomic_space, end_genomic_space, ref_allele, alt_allele):
"""
:param vc:
:return:
"""
if vc.get_vc() == VariantClassification.SPLICE_SITE and vc.get_secondary_vc() == VariantClassification.INTRON:
return ""
# dist_from_exon = self._get_splice_site_coordinates(tx, start_genomic_space, end_genomic_space, vc.get_exon_i())
# exon_i = vc.get_exon_i()
# return TranscriptProviderUtils.render_splice_site_transcript_change(tx, dist_from_exon, exon_i, vc.get_secondary_vc() == VariantClassification.INTRON)
if vc.get_cds_start_in_exon_space() == "" or vc.get_cds_start_in_exon_space() < 0:
return ""
exon_position_start,exon_position_end = TranscriptProviderUtils.convert_genomic_space_to_exon_space(int(start_genomic_space), int(end_genomic_space), tx)
if tx.get_strand() == "-":
cds_position_start_cds_space = exon_position_start - int(vc.get_cds_start_in_exon_space())+1
cds_position_end_cds_space = exon_position_end - int(vc.get_cds_start_in_exon_space())+1
else:
cds_position_start_cds_space = exon_position_start - int(vc.get_cds_start_in_exon_space())
cds_position_end_cds_space = exon_position_end - int(vc.get_cds_start_in_exon_space())
observed_allele_stranded, reference_allele_stranded = self._get_stranded_alleles(ref_allele, alt_allele, tx)
result = TranscriptProviderUtils.render_transcript_change(variant_type, vc.get_vc(), cds_position_start_cds_space, cds_position_end_cds_space, reference_allele_stranded, observed_allele_stranded, vc.get_secondary_vc())
return result
示例2: test_render_transcript_change
# 需要导入模块: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 别名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import render_transcript_change [as 别名]
def test_render_transcript_change(self, variant_type, vc, exon_position_start, exon_position_end, ref_allele_stranded, alt_allele_stranded, gt, secondary_vc):
"""Simple test of transcript change, once parameters have been rendered. """
guess = TranscriptProviderUtils.render_transcript_change(variant_type, vc, exon_position_start, exon_position_end, ref_allele_stranded, alt_allele_stranded, secondary_vc)
self.assertTrue(guess == gt, "Incorrect guess gt <> guess: %s <> %s" % (gt, guess))