def _get_intron_transcript_records(self): if len(self.Exons) < 2: self._set_null_values(["Introns"]) return exon_positions = [(exon.Location.Start, exon.Location.End) for exon in self.Exons] exon_positions.sort() end = exon_positions[-1][-1] exon_map = Map(locations=exon_positions, parent_length=end) intron_map = exon_map.shadow() intron_positions = [(span.Start, span.End) for span in intron_map.spans if span.Start != 0] chrom = self.Location.CoordName strand = self.Location.Strand introns = [] rank = 1 if strand == -1: intron_positions.reverse() for s, e in intron_positions: coord = self.genome.makeLocation(CoordName=chrom, Start=s, End=e, Strand=strand, ensembl_coord=False) introns.append(Intron(self.genome, self.db, rank, self.StableId, coord)) rank += 1 self._cached['Introns'] = tuple(introns)