Skip to content

Commit 429779d

Browse files
Fix regression error for MAC reduction (#152)
* Fix regression error for MAC reduction * Check the fields only * Bump version: 0.7.1 → 0.7.2 * Bump version: 0.7.2 → 0.7.3
1 parent a72d689 commit 429779d

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

extras/sample.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
nmdp_id,r_a_typ1,r_a_typ2,r_b_typ1,r_b_typ2,r_c_typ1,r_c_typ2,r_drb1_typ1,r_drb1_typ2,r_dpb1_typ1,r_dpb1_typ2
2-
123,A*23:71,A*29:79,B*18:67,B*51:275,C*05:01:19,C*02:85:02,DRB1*03:03,DRB1*14:144,DPB1*193:01:01,DPB1*582:01:01
2+
123,A*01:AB,A*29:79,B*18:67,B*51:275,C*05:01:19,C*02:85:02,DRB1*03:03,DRB1*14:144,DPB1*193:01:01,DPB1*582:01:01
33
456,A*01:01:42,A*30:12:02,B*44:02:32,B*35:42,C*03:148,C*04:322,DRB1*13:01:16,DRB1*15:80N,DPB1*914:01:01,DPB1*278:01:01
44
789,A*02:247,A*03:227,B*15:570,B*07:02:01:17,C*16:01:10,C*06:102,DRB1*13:156,DRB1*14:167:01,DPB1*405:01:01,DPB1*479:01:01

pyard/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
from .pyard import ARD
2525

2626
__author__ = """NMDP Bioinformatics"""
27-
__version__ = '0.7.1'
27+
__version__ = '0.7.3'

scripts/pyard-reduce-csv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ def is_3field(allele: str) -> bool:
4949

5050

5151
def is_2field(allele: str) -> bool:
52-
return len(allele.split(':')) == 2
52+
if '*' in allele:
53+
allele = allele.split('*')[1]
54+
fields = allele.split(':')
55+
# Check to see the 2 fields are digits to distinguish from MAC.
56+
return len(fields) == 2 and fields[0].isdigit() and fields[1].isdigit()
5357

5458

5559
def is_P(allele: str) -> bool:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.7.1
2+
current_version = 0.7.3
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
setup(
4444
name='py-ard',
45-
version='0.7.1',
45+
version='0.7.3',
4646
description="ARD reduction for HLA with Python",
4747
long_description=readme + '\n\n' + history,
4848
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)