def cds_seq(self):
"""Lookup transcript, exon and UTR info from Ensembl Rest API."""
if not self._cds_seq:
seq_info = client.perform_rest_action(
'/sequence/id/{0}'.format(self.transcript_id),
params={'type': 'cds'})
seq_str = seq_info['seq']
if seq_str.startswith('N') or seq_str.endswith('N'):
seq_str = seq_str.strip('N')
seq = Seq(seq_str, IUPAC.unambiguous_dna)
self._cds_seq = seq
self._aa_seq = seq.translate()
else:
seq = self._cds_seq
return seq
评论列表
文章目录