55
66DEFAULT_LIMIT = 1000
77
8- PREFERRED_GENE_SOURCE_NAME = " HGNC"
8+ PREFERRED_GENE_SOURCE_NAME = ' HGNC'
99
10- BASE_RETURN_PROPERTIES = [" @rid" , " @class" ]
10+ BASE_RETURN_PROPERTIES = [' @rid' , ' @class' ]
1111
1212GENERIC_RETURN_PROPERTIES = [
13- " name" ,
14- " sourceId" ,
15- " sourceIdVersion" ,
16- " source.name" ,
17- " source.@rid" ,
18- " displayName" ,
19- " deprecated" ,
13+ ' name' ,
14+ ' sourceId' ,
15+ ' sourceIdVersion' ,
16+ ' source.name' ,
17+ ' source.@rid' ,
18+ ' displayName' ,
19+ ' deprecated' ,
2020] + BASE_RETURN_PROPERTIES
2121
22- GENE_RETURN_PROPERTIES = [" biotype" ] + GENERIC_RETURN_PROPERTIES
22+ GENE_RETURN_PROPERTIES = [' biotype' ] + GENERIC_RETURN_PROPERTIES
2323
2424VARIANT_RETURN_PROPERTIES = (
2525 BASE_RETURN_PROPERTIES
26- + [f" type.{ p } " for p in GENERIC_RETURN_PROPERTIES ]
27- + [f" reference1.{ p } " for p in GENE_RETURN_PROPERTIES ]
28- + [f" reference2.{ p } " for p in GENE_RETURN_PROPERTIES ]
29- + [" zygosity" , " germline" , " displayName" ]
26+ + [f' type.{ p } ' for p in GENERIC_RETURN_PROPERTIES ]
27+ + [f' reference1.{ p } ' for p in GENE_RETURN_PROPERTIES ]
28+ + [f' reference2.{ p } ' for p in GENE_RETURN_PROPERTIES ]
29+ + [' zygosity' , ' germline' , ' displayName' ]
3030)
3131
3232POS_VARIANT_RETURN_PROPERTIES = VARIANT_RETURN_PROPERTIES + [
33- " break1Start" ,
34- " break1End" ,
35- " break2Start" ,
36- " break2End" ,
37- " break1Repr" ,
38- " break2Repr" ,
39- " refSeq" ,
40- " untemplatedSeq" ,
41- " untemplatedSeqSize" ,
42- " truncation" ,
43- " assembly" ,
33+ ' break1Start' ,
34+ ' break1End' ,
35+ ' break2Start' ,
36+ ' break2End' ,
37+ ' break1Repr' ,
38+ ' break2Repr' ,
39+ ' refSeq' ,
40+ ' untemplatedSeq' ,
41+ ' untemplatedSeqSize' ,
42+ ' truncation' ,
43+ ' assembly' ,
4444]
4545
4646STATEMENT_RETURN_PROPERTIES = (
4747 BASE_RETURN_PROPERTIES
48- + [" displayNameTemplate" , " sourceId" , " source.name" , " source.displayName" ]
49- + [f" conditions.{ p } " for p in GENERIC_RETURN_PROPERTIES ]
50- + [f" subject.{ p } " for p in GENERIC_RETURN_PROPERTIES ]
51- + [f" evidence.{ p } " for p in GENERIC_RETURN_PROPERTIES ]
52- + [f" relevance.{ p } " for p in GENERIC_RETURN_PROPERTIES ]
53- + [f" evidenceLevel.{ p } " for p in GENERIC_RETURN_PROPERTIES ]
54- + [" reviewStatus" ]
48+ + [' displayNameTemplate' , ' sourceId' , ' source.name' , ' source.displayName' ]
49+ + [f' conditions.{ p } ' for p in GENERIC_RETURN_PROPERTIES ]
50+ + [f' subject.{ p } ' for p in GENERIC_RETURN_PROPERTIES ]
51+ + [f' evidence.{ p } ' for p in GENERIC_RETURN_PROPERTIES ]
52+ + [f' relevance.{ p } ' for p in GENERIC_RETURN_PROPERTIES ]
53+ + [f' evidenceLevel.{ p } ' for p in GENERIC_RETURN_PROPERTIES ]
54+ + [' reviewStatus' ]
5555)
5656
5757
58- ONCOKB_SOURCE_NAME = " oncokb"
59- TSO500_SOURCE_NAME = " tso500"
60- ONCOGENE = " oncogenic"
61- TUMOUR_SUPPRESSIVE = " tumour suppressive"
62- CANCER_GENE = " cancer gene"
63- FUSION_NAMES = [" structural variant" , " fusion" ]
58+ ONCOKB_SOURCE_NAME = ' oncokb'
59+ TSO500_SOURCE_NAME = ' tso500'
60+ ONCOGENE = ' oncogenic'
61+ TUMOUR_SUPPRESSIVE = ' tumour suppressive'
62+ CANCER_GENE = ' cancer gene'
63+ FUSION_NAMES = [' structural variant' , ' fusion' ]
6464
65- GSC_PHARMACOGENOMIC_SOURCE_EXCLUDE_LIST = [" cancer genome interpreter" , " civic" ]
66- GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST = [" CGI" , " CIViC" ]
65+ GSC_PHARMACOGENOMIC_SOURCE_EXCLUDE_LIST = [' cancer genome interpreter' , ' civic' ]
66+ GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST = [' CGI' , ' CIViC' ]
6767
68- BASE_THERAPEUTIC_TERMS = [" therapeutic efficacy" , " eligibility" ]
68+ BASE_THERAPEUTIC_TERMS = [' therapeutic efficacy' , ' eligibility' ]
6969# the order here is the order these are applied, the first category matched is returned
7070RELEVANCE_BASE_TERMS : CategoryBaseTermMapping = [
71- (" therapeutic" , BASE_THERAPEUTIC_TERMS ),
72- (" diagnostic" , [" diagnostic indicator" ]),
73- (" prognostic" , [" prognostic indicator" ]),
74- (" pharmacogenomic" , [" metabolism" , " toxicity" , " dosage" ]),
75- (" cancer predisposition" , [" pathogenic" ]),
76- (" biological" , [" functional effect" , " tumourigenesis" , " predisposing" ]),
71+ (' therapeutic' , BASE_THERAPEUTIC_TERMS ),
72+ (' diagnostic' , [' diagnostic indicator' ]),
73+ (' prognostic' , [' prognostic indicator' ]),
74+ (' pharmacogenomic' , [' metabolism' , ' toxicity' , ' dosage' ]),
75+ (' cancer predisposition' , [' pathogenic' ]),
76+ (' biological' , [' functional effect' , ' tumourigenesis' , ' predisposing' ]),
7777]
78- FAILED_REVIEW_STATUS = " failed"
78+ FAILED_REVIEW_STATUS = ' failed'
7979
80- CHROMOSOMES_HG38 = [f" chr{ i } " for i in range (1 , 23 )] + [" chrX" , " chrY" , " chrM" ]
81- CHROMOSOMES_HG19 = [str (i ) for i in range (1 , 23 )] + ["x" , "y" , "mt" ]
80+ CHROMOSOMES_HG38 = [f' chr{ i } ' for i in range (1 , 23 )] + [' chrX' , ' chrY' , ' chrM' ]
81+ CHROMOSOMES_HG19 = [str (i ) for i in range (1 , 23 )] + ['x' , 'y' , 'mt' ]
8282CHROMOSOMES = CHROMOSOMES_HG38 + CHROMOSOMES_HG19
8383
84- AMBIGUOUS_AA = ["x" , "?" , "X" ]
84+ AMBIGUOUS_AA = ['x' , '?' , 'X' ]
8585AA_3to1_MAPPING = {
86- " Ala" : "A" ,
87- " Arg" : "R" ,
88- " Asn" : "N" ,
89- " Asp" : "D" ,
90- " Asx" : "B" ,
91- " Cys" : "C" ,
92- " Glu" : "E" ,
93- " Gln" : "Q" ,
94- " Glx" : "Z" ,
95- " Gly" : "G" ,
96- " His" : "H" ,
97- " Ile" : "I" ,
98- " Leu" : "L" ,
99- " Lys" : "K" ,
100- " Met" : "M" ,
101- " Phe" : "F" ,
102- " Pro" : "P" ,
103- " Ser" : "S" ,
104- " Thr" : "T" ,
105- " Trp" : "W" ,
106- " Tyr" : "Y" ,
107- " Val" : "V" ,
108- " Ter" : "*" ,
86+ ' Ala' : 'A' ,
87+ ' Arg' : 'R' ,
88+ ' Asn' : 'N' ,
89+ ' Asp' : 'D' ,
90+ ' Asx' : 'B' ,
91+ ' Cys' : 'C' ,
92+ ' Glu' : 'E' ,
93+ ' Gln' : 'Q' ,
94+ ' Glx' : 'Z' ,
95+ ' Gly' : 'G' ,
96+ ' His' : 'H' ,
97+ ' Ile' : 'I' ,
98+ ' Leu' : 'L' ,
99+ ' Lys' : 'K' ,
100+ ' Met' : 'M' ,
101+ ' Phe' : 'F' ,
102+ ' Pro' : 'P' ,
103+ ' Ser' : 'S' ,
104+ ' Thr' : 'T' ,
105+ ' Trp' : 'W' ,
106+ ' Tyr' : 'Y' ,
107+ ' Val' : 'V' ,
108+ ' Ter' : '*' ,
109109}
110110
111111
@@ -127,89 +127,89 @@ def __getitem__(self, key):
127127
128128
129129INPUT_COPY_CATEGORIES = IterableNamespace (
130- AMP = " amplification" ,
131- ANY_GAIN = " copy gain" ,
132- ANY_LOSS = " copy loss" ,
133- DEEP = " deep deletion" ,
134- GAIN = " low level copy gain" ,
135- LOSS = " shallow deletion" ,
130+ AMP = ' amplification' ,
131+ ANY_GAIN = ' copy gain' ,
132+ ANY_LOSS = ' copy loss' ,
133+ DEEP = ' deep deletion' ,
134+ GAIN = ' low level copy gain' ,
135+ LOSS = ' shallow deletion' ,
136136)
137137INPUT_EXPRESSION_CATEGORIES = IterableNamespace (
138- UP = " increased expression" , DOWN = " reduced expression"
138+ UP = ' increased expression' , DOWN = ' reduced expression'
139139)
140140
141141# From: https://github.com/bcgsc/pori_graphkb_parser/blob/ae3738842a4c208ab30f58c08ae987594d632504/src/constants.ts#L33-L80
142142TYPES_TO_NOTATION : Dict [str , str ] = {
143- " acetylation" : "ac" ,
144- " copy gain" : " copygain" ,
145- " copy loss" : " copyloss" ,
146- " deletion" : " del" ,
147- " duplication" : " dup" ,
148- " extension" : " ext" ,
149- " frameshift" : "fs" ,
150- " fusion" : " fusion" ,
151- " indel" : " delins" ,
152- " insertion" : " ins" ,
153- " inversion" : " inv" ,
154- " inverted translocation" : " itrans" ,
155- " methylation" : "me" ,
156- " missense mutation" : " mis" ,
157- " mutation" : " mut" ,
158- " nonsense mutation" : ">" ,
159- " phosphorylation" : " phos" ,
160- " splice-site" : " spl" ,
161- " substitution" : ">" ,
162- " translocation" : " trans" ,
163- " truncating frameshift mutation" : "fs" ,
164- " ubiquitination" : "ub" ,
143+ ' acetylation' : 'ac' ,
144+ ' copy gain' : ' copygain' ,
145+ ' copy loss' : ' copyloss' ,
146+ ' deletion' : ' del' ,
147+ ' duplication' : ' dup' ,
148+ ' extension' : ' ext' ,
149+ ' frameshift' : 'fs' ,
150+ ' fusion' : ' fusion' ,
151+ ' indel' : ' delins' ,
152+ ' insertion' : ' ins' ,
153+ ' inversion' : ' inv' ,
154+ ' inverted translocation' : ' itrans' ,
155+ ' methylation' : 'me' ,
156+ ' missense mutation' : ' mis' ,
157+ ' mutation' : ' mut' ,
158+ ' nonsense mutation' : '>' ,
159+ ' phosphorylation' : ' phos' ,
160+ ' splice-site' : ' spl' ,
161+ ' substitution' : '>' ,
162+ ' translocation' : ' trans' ,
163+ ' truncating frameshift mutation' : 'fs' ,
164+ ' ubiquitination' : 'ub' ,
165165 # deprecated forms and aliases
166- " frameshift mutation" : "fs" ,
167- " frameshift truncation" : "fs" ,
168- " missense variant" : " mis" ,
169- " truncating frameshift" : "fs" ,
170- " missense" : " mis" ,
171- " mutations" : " mut" ,
172- " nonsense" : ">" ,
166+ ' frameshift mutation' : 'fs' ,
167+ ' frameshift truncation' : 'fs' ,
168+ ' missense variant' : ' mis' ,
169+ ' truncating frameshift' : 'fs' ,
170+ ' missense' : ' mis' ,
171+ ' mutations' : ' mut' ,
172+ ' nonsense' : '>' ,
173173}
174174
175175# For match.type_screening() [KBDEV-1056]
176- DEFAULT_NON_STRUCTURAL_VARIANT_TYPE = " mutation"
176+ DEFAULT_NON_STRUCTURAL_VARIANT_TYPE = ' mutation'
177177STRUCTURAL_VARIANT_SIZE_THRESHOLD = 48 # bp
178178STRUCTURAL_VARIANT_TYPES = [
179- " structural variant" ,
180- " insertion" ,
181- " in-frame insertion" ,
182- " deletion" ,
183- " deletion polymorphism" ,
184- " in-frame deletion" ,
185- " translocation" ,
186- " inverted translocation" ,
187- " inversion" ,
188- " indel" ,
189- " fusion" ,
190- " out-of-frame fusion" ,
191- " oncogenic fusion" ,
192- " in-frame fusion" ,
193- " disruptive fusion" ,
194- " duplication" ,
195- " internal duplication" ,
196- " tandem duplication" ,
197- " internal tandem duplication" ,
198- " itd" ,
199- " domain duplication" ,
200- " kinase domain duplication" ,
201- " copy variant" ,
202- " copy number variation" ,
203- " copy number variant" ,
204- " copy loss" ,
205- " copy number loss" ,
206- " shallow deletion" ,
207- " deep deletion" ,
208- " gene deletion" ,
209- " copy gain" ,
210- " copy number gain" ,
211- " low level copy gain" ,
212- " amplification" ,
213- " focal amplification" ,
214- " rearrangement" ,
179+ ' structural variant' ,
180+ ' insertion' ,
181+ ' in-frame insertion' ,
182+ ' deletion' ,
183+ ' deletion polymorphism' ,
184+ ' in-frame deletion' ,
185+ ' translocation' ,
186+ ' inverted translocation' ,
187+ ' inversion' ,
188+ ' indel' ,
189+ ' fusion' ,
190+ ' out-of-frame fusion' ,
191+ ' oncogenic fusion' ,
192+ ' in-frame fusion' ,
193+ ' disruptive fusion' ,
194+ ' duplication' ,
195+ ' internal duplication' ,
196+ ' tandem duplication' ,
197+ ' internal tandem duplication' ,
198+ ' itd' ,
199+ ' domain duplication' ,
200+ ' kinase domain duplication' ,
201+ ' copy variant' ,
202+ ' copy number variation' ,
203+ ' copy number variant' ,
204+ ' copy loss' ,
205+ ' copy number loss' ,
206+ ' shallow deletion' ,
207+ ' deep deletion' ,
208+ ' gene deletion' ,
209+ ' copy gain' ,
210+ ' copy number gain' ,
211+ ' low level copy gain' ,
212+ ' amplification' ,
213+ ' focal amplification' ,
214+ ' rearrangement' ,
215215]
0 commit comments