Skip to content

Commit

Permalink
Previous change didn't work on negative strand
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Nov 10, 2021
1 parent 2ca3e08 commit b4571a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyhgvs/models/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_utr5p_size(self):
else:
position = end - start_codon - 1
return cdna_offset + position + cdna_match.get_offset(position)
cdna_offset = cdna_match.cdna_end
cdna_offset += cdna_match.length

# Couldn't find it
cdna_matches = []
Expand Down Expand Up @@ -110,7 +110,7 @@ def find_stop_codon(self, cds_position):
position = stop - stop_pos
return cdna_offset + position + cdna_match.get_offset(position)
else:
cdna_offset = cdna_match.cdna_end
cdna_offset += cdna_match.length
raise ValueError('Stop codon is not in any of the exons')

def cdna_to_genomic_coord(self, coord):
Expand Down Expand Up @@ -233,7 +233,7 @@ def _exon_genomic_to_cdna_coord(self, genomic_coord):
position = cdna_match.tx_position.chrom_stop - genomic_coord
offset = cdna_match.get_offset(position, validate=False)
return cdna_offset + position + offset + 1
cdna_offset = cdna_match.cdna_end
cdna_offset += cdna_match.length

raise ValueError(f"Couldn't find {genomic_coord=}!")

Expand Down

0 comments on commit b4571a7

Please sign in to comment.