File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -204,9 +204,14 @@ def _redux_allele(
204204 # C*12:02:02 => C*12:02:01G
205205 # C*12:02 => C*12:02:01G
206206
207+ # Remove little 'g' before processing
208+ # if allele.endswith('g'):
209+ # allele = allele[:-1]
210+
207211 if allele .endswith (("P" , "G" )):
208212 if redux_type in ["lg" , "lgx" , "G" ]:
209213 allele = allele [:- 1 ]
214+
210215 if self ._config ["ping" ] and re_ping :
211216 # ping: alleles that are in P group but not in G groups are defined
212217 # for 2-field alleles. If not already in 2-field form, reduce it to
@@ -810,6 +815,10 @@ def _is_valid_allele(self, allele):
810815 @param allele:
811816 @return:
812817 """
818+ # Alleles ending with little 'g' are valid_alleles
819+ if allele .endswith ("g" ):
820+ # remove the 'g' character
821+ allele = allele [:- 1 ]
813822 # Alleles ending with P or G are valid_alleles
814823 if allele .endswith (("P" , "G" )):
815824 # remove the last character
Original file line number Diff line number Diff line change @@ -88,3 +88,17 @@ Feature: Alleles
8888 | MICA *040 | lgx | MICA *040 |
8989 | MICB *006 | lgx | MICB *006 |
9090 | MICB *029 | lgx | MICB *029 |
91+
92+
93+ Scenario Outline : Alleles with little 'g'
94+
95+ Alleles that are little 'g' are valid alleles.
96+
97+ Given the allele as <Allele>
98+ When reducing on the <Level> level
99+ Then the reduced allele is found to be <Redux Allele>
100+
101+ Examples :
102+ | Allele | Level | Redux Allele |
103+ | A *30 :02g | lgx | A *30 :02 |
104+ | HLA -A *01 :01g | G | HLA -A *01 :01 :01G |
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Feature: P and G Groups
2323
2424 Examples :
2525 | Allele | Level | Redux Allele |
26+ | DQA1 *03 :03 :09 | lg | DQA1 *03 :03g |
2627 | C *06 :17 | lgx | C *06 :02 |
2728
2829 Examples : DRB4*01s
You can’t perform that action at this time.
0 commit comments