Skip to content

Commit 63ef9cf

Browse files
committed
- Add GL String examples
- Compare GL String in sort
1 parent 48fc326 commit 63ef9cf

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

pyard/smart_sort.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ def smart_sort_comparator(a1, a2):
4444
if a1 == a2:
4545
return 0
4646

47-
# Ignore GL String matches
47+
# GL String matches
4848
if re.search(glstring_chars, a1) or re.search(glstring_chars, a2):
49-
return 0
49+
if a1 > a2:
50+
return 1
51+
else:
52+
return -1
5053

5154
# remove any non-numerics
5255
a1 = re.sub(expr_regex, '', a1)

tests/features/mac.feature

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Feature: MAC (Multiple Allele Code)
1616

1717

1818
Examples: MACs with allelic expansions
19-
| Allele | Level | Redux Allele |
20-
| B*08:ASXJP | G | B*08:01:01G |
21-
| B*08:ASXJP | lgx | B*08:01 |
22-
| C*07:HTGM | lgx | C*07:01/C*07:150Q |
19+
| Allele | Level | Redux Allele |
20+
| B*08:ASXJP | G | B*08:01:01G |
21+
| B*08:ASXJP | lgx | B*08:01 |
22+
| C*07:HTGM | lgx | C*07:01/C*07:150Q |
23+
| A*01:AC+A*01:AB | G | A*01:01:01G/A*01:02+A*01:01:01G/A*01:03:01G |
24+
| A*01:01+A*01:AB | G | A*01:01:01G+A*01:01:01G/A*01:02 |

0 commit comments

Comments
 (0)