def get_introns(self): """Returns a list of coordinates that represent the introns for this transcript""" introns = [] for i in range(len(self.exons)-1): ex1 = self.exons[i] ex2 = self.exons[i+1] if self.strand == -1: intron = Coord(self.chrom, ex2.end+1, ex1.start-1, strand=self.strand) else: intron = Coord(self.chrom, ex1.end+1, ex2.start-1, strand=self.strand) intron.exon_5p = ex1 intron.exon_3p = ex2 introns.append(intron) if self.intron_scores is not None: intron.score = self.intron_scores[i] if self.known_intron_flags is not None: if self.known_intron_flags[i] == "1": intron.is_known = True else: intron.is_known = False return introns
def get_introns(self): """Returns a list of coordinates that represent the introns for this transcript""" introns = [] for i in range(len(self.exons) - 1): ex1 = self.exons[i] ex2 = self.exons[i + 1] if self.strand == -1: intron = Coord(self.chrom, ex2.end + 1, ex1.start - 1, strand=self.strand) else: intron = Coord(self.chrom, ex1.end + 1, ex2.start - 1, strand=self.strand) intron.exon_5p = ex1 intron.exon_3p = ex2 introns.append(intron) if self.intron_scores is not None: intron.score = self.intron_scores[i] if self.known_intron_flags is not None: if self.known_intron_flags[i] == "1": intron.is_known = True else: intron.is_known = False return introns