Skip to content

Commit

Permalink
use offset in Transcripts from gencode, so we can get sequence contex…
Browse files Browse the repository at this point in the history
…t beyond gene boundaries for short genes
  • Loading branch information
jeremymcrae committed Aug 23, 2021
1 parent 9b87275 commit 49e6206
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions denovonear/gencode.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ cdef class Gene:
cdef _to_Transcript(self, Tx tx):
''' construct Transcript (python object) from Tx (c++ object)
'''
offset = 10
start = tx.get_start()
end = tx.get_end()
exons = self._convert_exons(tx.get_exons())
cds = self._convert_exons(tx.get_cds())
seq = __genome_[self.chrom][start-1:end-1].seq
seq = __genome_[self.chrom][start-1-offset:end-1+offset].seq
strand = self.strand
tx_id = tx.get_name().decode('utf8')
return Transcript(tx_id, self.chrom, start, end, strand, exons, cds, seq)
return Transcript(tx_id, self.chrom, start, end, strand, exons, cds, seq, offset=offset)

@property
def transcripts(self):
Expand Down

0 comments on commit 49e6206

Please sign in to comment.