Skip to content

Commit

Permalink
feat(is_rna): moving the check if a transcript is RNA only to datacom…
Browse files Browse the repository at this point in the history
…piler
  • Loading branch information
andreasprlic committed Oct 3, 2024
1 parent 9a2e049 commit b82ab35
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/hgvs/pretty/console/tx_pos.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ def display(self, data: VariantData) -> str:
"""show the position of the transcript seq"""
var_str = ""

if data.var_c_or_n:
rna_coding = data.var_c_or_n.ac.startswith("NR_")
else:
rna_coding = False
is_rna = data.is_rna

count = -1
for pdata in data.position_details:
Expand All @@ -25,7 +22,7 @@ def display(self, data: VariantData) -> str:

c_pos = pdata.c_pos
interval = pdata.c_interval
if rna_coding:
if is_rna:
c_pos = pdata.n_pos
interval = pdata.n_interval

Expand Down
3 changes: 3 additions & 0 deletions src/hgvs/pretty/datacompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ def data(
pd = reversed(position_details)
position_details = list(pd)

is_rna = var_c_or_n.ac.startswith("NR_") # not sure how to check this for ENSTs

vd = VariantData(
seq_start,
seq_end,
Expand All @@ -365,6 +367,7 @@ def data(
var_c_or_n,
var_p,
position_details,
is_rna
)

return vd
Expand Down
1 change: 1 addition & 0 deletions src/hgvs/pretty/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class VariantData:
var_p: SequenceVariant = None
position_details: List[PositionDetail] = None
all: bool = False
is_rna: bool = False


@dataclass
Expand Down

0 comments on commit b82ab35

Please sign in to comment.