Example #1
0
 def to_gtf_features(self, source=None, score=1000):
     if source is None:
         source = 'assemblyline'
     # transcript feature
     f = GTFFeature()
     f.seqid = self.chrom
     f.source = source
     f.feature_type = 'transcript'
     f.start = self.start
     f.end = self.end
     f.score = score
     f.strand = strand_int_to_str(self.strand)
     f.phase = '.'
     f.attrs = self.attrs
     features = [f]
     # exon features
     for i, e in enumerate(self.exons):
         f = GTFFeature()
         f.seqid = self.chrom
         f.source = source
         f.feature_type = 'exon'
         f.start = e.start
         f.end = e.end
         f.score = score
         f.strand = strand_int_to_str(self.strand)
         f.phase = '.'
         f.attrs = self.attrs.copy()
         f.attrs["exon_number"] = i
         features.append(f)
     return features
Example #2
0
 def to_gtf_features(self, source=None, score=1000):
     if source is None:
         source = 'assemblyline'
     # transcript feature
     f = GTFFeature()
     f.seqid = self.chrom
     f.source = source
     f.feature_type = 'transcript'
     f.start = self.start
     f.end = self.end
     f.score = score
     f.strand = strand_int_to_str(self.strand)
     f.phase = '.'
     f.attrs = self.attrs
     features = [f]
     # exon features
     for i,e in enumerate(self.exons):
         f = GTFFeature()
         f.seqid = self.chrom
         f.source = source
         f.feature_type = 'exon'
         f.start = e.start
         f.end = e.end
         f.score = score
         f.strand = strand_int_to_str(self.strand)
         f.phase = '.'
         f.attrs = self.attrs.copy()
         f.attrs["exon_number"] = i
         features.append(f)
     return features