def __init__(self, hdp, tx_ac, pro_ac):
tx_info = hdp.get_tx_identity_info(tx_ac)<EOL>tx_seq = hdp.get_seq(tx_ac)<EOL>if tx_info is None or tx_seq is None:<EOL><INDENT>raise HGVSDataNotAvailableError(<EOL>"<STR_LIT>".format(tx_ac))<EOL><DEDENT>cds_start = tx_info["<STR_LIT>"] + <NUM_LIT:1><EOL>cds_stop = tx_info["<STR_LIT>"]<EOL>tx_seq_to_translate = tx_seq[cds_start - <NUM_LIT:1>:cds_stop]<EOL>if len(tx_seq_to_translate) % <NUM_LIT:3> != <NUM_LIT:0>:<EOL><INDENT>raise NotImplementedError(<EOL>"<STR_LIT>"<EOL>.format(tx_ac, len(tx_seq_to_translate)))<EOL><DEDENT>tx_seq_cds = Seq(tx_seq_to_translate)<EOL>protein_seq = str(tx_seq_cds.translate())<EOL>if pro_ac is None:<EOL><INDENT>pro_ac = (hdp.get_pro_ac_for_tx_ac(tx_ac)<EOL>or hdp.get_acs_for_protein_seq(protein_seq)[<NUM_LIT:0>])<EOL><DEDENT>self.transcript_sequence = tx_seq<EOL>self.aa_sequence = protein_seq<EOL>self.cds_start = cds_start<EOL>self.cds_stop = cds_stop<EOL>self.protein_accession = pro_ac<EOL>
helper for generating RefTranscriptData from for c_to_p