當前位置: 首頁>>代碼示例>>Python>>正文


Python TranscriptProviderUtils.test_overlap方法代碼示例

本文整理匯總了Python中oncotator.TranscriptProviderUtils.TranscriptProviderUtils.test_overlap方法的典型用法代碼示例。如果您正苦於以下問題:Python TranscriptProviderUtils.test_overlap方法的具體用法?Python TranscriptProviderUtils.test_overlap怎麽用?Python TranscriptProviderUtils.test_overlap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在oncotator.TranscriptProviderUtils.TranscriptProviderUtils的用法示例。


在下文中一共展示了TranscriptProviderUtils.test_overlap方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _determine_codon_overlap

# 需要導入模塊: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 別名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import test_overlap [as 別名]
 def _determine_codon_overlap(self, s, e, codon_tuple, variant_type):
     if codon_tuple is None:
         return False
     if variant_type == VariantClassification.VT_INS:
         is_codon_overlap = TranscriptProviderUtils.test_overlap(s, s, codon_tuple[0]+1, codon_tuple[1])
     else:
         is_codon_overlap = TranscriptProviderUtils.test_overlap(s, e, codon_tuple[0]+1, codon_tuple[1])
     return is_codon_overlap
開發者ID:alexramos,項目名稱:oncotator,代碼行數:10,代碼來源:VariantClassifier.py

示例2: _is_matching

# 需要導入模塊: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 別名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import test_overlap [as 別名]
    def _is_matching(self, mut, tsv_record):

        chrom = tsv_record[self.tsv_index["chrom"]]
        startPos = tsv_record[self.tsv_index["start"]]
        endPos = tsv_record[self.tsv_index["end"]]
        build = "hg19"

        if self.match_mode == "exact":
            if "ref" in self.tsv_index and "alt" in self.tsv_index:  # ref and alt information is present
                ref = tsv_record[self.tsv_index["ref"]]
                alt = tsv_record[self.tsv_index["alt"]]
                if ref == "-" or alt == "-":  # addresses Mutation Annotation Format based tsv records

                    # TODO: This looks risky to be calling the MutationData constructor directly
                    ds_mut = MutationData(chrom, startPos, endPos, ref, alt, build)
                else:  # addresses tsv records where the input isn't a Mutation Annotation Format file
                    ds_mut = MutUtils.initializeMutFromAttributes(chrom, startPos, endPos, ref, alt, build)

                if mut.chr == ds_mut.chr and mut.ref_allele == ds_mut.ref_allele \
                    and mut.alt_allele == ds_mut.alt_allele and int(mut.start) == int(ds_mut.start) \
                    and int(mut.end) == int(ds_mut.end):
                    return True
            else:  # do not use ref and alt information
                if mut.chr == chrom and int(mut.start) == int(startPos) and int(mut.end) == int(endPos):
                    return True
        else:
           return TranscriptProviderUtils.test_overlap(int(mut.start), int(mut.end), int(startPos), int(endPos))
        return False
開發者ID:Tmacme,項目名稱:oncotator,代碼行數:30,代碼來源:TabixIndexedTsvDatasource.py

示例3: _determine_if_splice_site_overlap

# 需要導入模塊: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 別名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import test_overlap [as 別名]
    def _determine_if_splice_site_overlap(self, start_genomic_space, end_genomic_space, tx, variant_type, dist=2):

        """

        Overlap of start and stop codon (i.e. start of first exon and end of last exon -- stranded) will not be a
            Splice_Site.  This method will return is_splice_site_overlap of False

         If overlap is detected, but the start or end is within dist bp, then this is a splice site.
         start <= end
        INS events only call splice site when they start in the splice site

        :param start_genomic_space: int in genomic space
        :param end_genomic_space: int in genomic space
        :param tx: Transcript
        :param variant_type:
        :param dist:
        :return is_splice_site_overlap, exon_i, is_right_overlap (Higher genomic position --> True)

        """
        exons = tx.get_exons()
        strand = tx.get_strand()

        # If this is an insertion, we only want to count a splice site if it starts in the splice site regions
        if variant_type == VariantClassification.VT_INS:
            end_genomic_space = start_genomic_space

        for i,exon in enumerate(exons):
            is_internal_exon = (i > 0) and (i < (len(exons)-1))
            is_check_left = is_internal_exon or (strand == "-" and i == 0) or (strand == "+" and i == (len(exons)-1))
            is_check_right = is_internal_exon or (strand == "+" and i == 0) or (strand == "-" and i == (len(exons)-1))
            if is_check_left:
                splice_site_left = (exon[0]-dist+1, exon[0]+(dist-1)+1)
                overlap_type_left = TranscriptProviderUtils.test_overlap(start_genomic_space, end_genomic_space, splice_site_left[0], splice_site_left[1])
                if overlap_type_left:
                    return True, i, False
            if is_check_right:
                splice_site_right = (exon[1]-(dist-1), exon[1] + dist)
                overlap_type_right = TranscriptProviderUtils.test_overlap(start_genomic_space, end_genomic_space, splice_site_right[0], splice_site_right[1])
                if overlap_type_right:
                    return True, i, True

        return False, -1, None, False
開發者ID:alexramos,項目名稱:oncotator,代碼行數:44,代碼來源:VariantClassifier.py

示例4: __get_overlapping_records

# 需要導入模塊: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 別名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import test_overlap [as 別名]
    def __get_overlapping_records(self, records, start, end, type):
        if type == "gene":
            st_key, en_key = "start", "end"
        elif type == "transcript":
            st_key, en_key = "footprint_start", "footprint_end"

        out_records = list()
        for r in records:
            if TranscriptProviderUtils.test_overlap(start, end, r[st_key], r[en_key]):
                out_records.append(r)

        return out_records
開發者ID:jcambry,項目名稱:oncotator,代碼行數:14,代碼來源:Gaf.py

示例5: _get_overlapping_transcript_records

# 需要導入模塊: from oncotator.TranscriptProviderUtils import TranscriptProviderUtils [as 別名]
# 或者: from oncotator.TranscriptProviderUtils.TranscriptProviderUtils import test_overlap [as 別名]
 def _get_overlapping_transcript_records(self, records, start, end):
     return [r for r in records if TranscriptProviderUtils.test_overlap(int(start), int(end), r.get_start(), r.get_end())]
開發者ID:alexramos,項目名稱:oncotator,代碼行數:4,代碼來源:EnsemblTranscriptDatasource.py


注:本文中的oncotator.TranscriptProviderUtils.TranscriptProviderUtils.test_overlap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。