-
Notifications
You must be signed in to change notification settings - Fork 98
Uncertain ranges #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uncertain ranges #699
Changes from 22 commits
5054739
1f624ad
2bcccc2
722b142
c15c552
8a4341a
1983654
2e4ae22
82d7331
a045165
43a556c
3ea0c5c
1e2a433
0c4c5d7
4a44582
6056847
cce1c6f
261245a
52adbe9
609244a
0364f37
4c7ecbf
cec05d3
f591a1a
8ddecd1
99e0060
053f686
f370655
b6bf4b6
1a857f9
cd949db
485f4cc
e6e16d8
f8e2d2e
8d7fb05
c69cc69
a1a7ece
8f8450d
77fe885
31f6ad9
ed2c56a
04d2398
587c6fb
64284cc
99b6b96
49cb10a
9318465
7993a1d
e96e264
19ddbd1
8bf485a
6c0e85b
c7465fa
efb3395
0c3fe2d
ad59996
855f759
abca23b
877e405
cf5a452
57d6195
7e291c0
ecae174
e9839f9
a2e9ed2
ec70dbc
effc67b
98f63d7
2eb763f
a7854d0
b3be243
7fed4d4
a2b7c30
8f9a9cc
7051f58
f9fe947
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# variant specification. The subset is limited to is limited to those | ||
# rules that define sequence variants precisely. It does not current | ||
# cover rules for translocations or conversions. | ||
|
||
# The basic structure of a HGVS sequence variant is: | ||
# <ac>:<type>.<posedit> | ||
# where <ac> is a sequence accession, <type> determines the sequence | ||
|
@@ -26,7 +26,7 @@ r_variant = accn:ac opt_gene_expr:gene ':' 'r':type '.' r_posedit:posedit -> hgv | |
|
||
############################################################################ | ||
## HGVS Position -- e.g., NM_01234.5:c.22+6 (without an edit) | ||
# This is unofficial syntax | ||
# This is unofficial syntax | ||
|
||
hgvs_position = g_hgvs_position | m_hgvs_position | c_hgvs_position | n_hgvs_position | r_hgvs_position | p_hgvs_position | ||
|
||
|
@@ -65,7 +65,7 @@ r_posedit = (r_interval:pos rna_edit:edit -> hgvs.posedit.PosEdit(pos=pos,edit=e | |
p_posedit = (p_interval:pos pro_edit:edit -> hgvs.posedit.PosEdit(pos=pos,edit=edit)) | ||
| ('(' p_interval:pos pro_edit:edit ')' -> hgvs.posedit.PosEdit(pos=pos,edit=edit, uncertain=True)) | ||
| p_posedit_special | ||
p_posedit_special = | ||
p_posedit_special = | ||
'=':x -> hgvs.posedit.PosEdit(pos=None,edit=x,uncertain=False) | ||
| '(' '=':x ')' -> hgvs.posedit.PosEdit(pos=None,edit=x,uncertain=True) | ||
| '0':x '?' -> hgvs.posedit.PosEdit(pos=None,edit=x,uncertain=True) | ||
|
@@ -122,20 +122,26 @@ pro_ident = '=' -> hgvs.edit.AARefAlt(ref='',alt='' | |
|
||
# potentially indefinite/uncertain intervals | ||
c_interval = def_c_interval | '(' def_c_interval:iv ')' -> iv._set_uncertain() | ||
g_interval = def_g_interval | '(' def_g_interval:iv ')' -> iv._set_uncertain() | ||
g_interval = uncertain_g_interval:iv | ('(' def_g_interval:iv ')' -> iv._set_uncertain()) | def_g_interval | ||
m_interval = def_m_interval | '(' def_m_interval:iv ')' -> iv._set_uncertain() | ||
n_interval = def_n_interval | '(' def_n_interval:iv ')' -> iv._set_uncertain() | ||
p_interval = def_p_interval | '(' def_p_interval:iv ')' -> iv._set_uncertain() | ||
r_interval = def_r_interval | '(' def_r_interval:iv ')' -> iv._set_uncertain() | ||
|
||
# definite intervals | ||
def_g_interval = (g_pos:start '_' g_pos:end -> hgvs.location.Interval(start,end)) | (g_pos:start -> hgvs.location.Interval(start,copy.deepcopy(start))) | ||
def_m_interval = (m_pos:start '_' m_pos:end -> hgvs.location.Interval(start,end)) | (m_pos:start -> hgvs.location.Interval(start,copy.deepcopy(start))) | ||
def_p_interval = (p_pos:start '_' p_pos:end -> hgvs.location.Interval(start,end)) | (p_pos:start -> hgvs.location.Interval(start,copy.deepcopy(start))) | ||
def_r_interval = (r_pos:start '_' r_pos:end -> hgvs.location.Interval(start,end)) | (r_pos:start -> hgvs.location.Interval(start,copy.deepcopy(start))) | ||
def_g_interval = (g_pos:start '_' g_pos:end -> hgvs.location.Interval(start,end)) | (g_pos:start -> hgvs.location.Interval(start,None)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like consistency across parallel ideas. It seems to me that we should either decided to deepcopy in the grammar or not, and do it only one way. What led to changing from the current pattern? (I'm not saying that one is better than the other, but consistency is easier to understand.) |
||
def_m_interval = (m_pos:start '_' m_pos:end -> hgvs.location.Interval(start,end)) | (m_pos:start -> hgvs.location.Interval(start,None)) | ||
def_p_interval = (p_pos:start '_' p_pos:end -> hgvs.location.Interval(start,end)) | (p_pos:start -> hgvs.location.Interval(start,None)) | ||
def_r_interval = (r_pos:start '_' r_pos:end -> hgvs.location.Interval(start,end)) | (r_pos:start -> hgvs.location.Interval(start,None)) | ||
def_c_interval = (c_pos:start '_' c_pos:end -> hgvs.location.BaseOffsetInterval(start,end)) | (c_pos:start -> hgvs.location.BaseOffsetInterval(start,copy.deepcopy(start))) | ||
def_n_interval = (n_pos:start '_' n_pos:end -> hgvs.location.BaseOffsetInterval(start,end)) | (n_pos:start -> hgvs.location.BaseOffsetInterval(start,copy.deepcopy(start))) | ||
|
||
# indefinite ranges | ||
uncertain_g_interval = '(' def_g_interval:ivl_start ')' '_' '(' def_g_interval:ivl_end ')' -> hgvs.location.Interval(start=ivl_start._set_uncertain(), end=ivl_end._set_uncertain()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: "iv" is used elsewhere; please keep for consistency |
||
| def_g_interval:ivl_start '_' '(' def_g_interval:ivl_end ')' -> hgvs.location.Interval(start=ivl_start, end=ivl_end._set_uncertain()) | ||
| '(' def_g_interval:ivl_start ')' '_' def_g_interval:ivl_end -> hgvs.location.Interval(start=ivl_start._set_uncertain(), end=ivl_end) | ||
|
||
|
||
# positions | ||
c_pos = def_c_pos #| '(' def_c_pos:pos ')' -> pos._set_uncertain() | ||
g_pos = def_g_pos #| '(' def_g_pos:pos ')' -> pos._set_uncertain() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this. The second alternative parse (with parentheses) is for an uncertain g_interval.