From 330699f4137b435516b7047129e44759aa396a2b Mon Sep 17 00:00:00 2001 From: pbashyal-nmdp Date: Tue, 7 Feb 2023 12:09:10 -0600 Subject: [PATCH 1/3] Fix issue with Splits merged together. When creating broad for`DQB1*01`, `DQB1*05` was updated with `DQB1*06` expansion. Variables in Python are not values. - Create a copy of the list - Add test --- pyard/data_repository.py | 3 ++- tests/test_pyard.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyard/data_repository.py b/pyard/data_repository.py index 7a6d9f9..1a4afe6 100644 --- a/pyard/data_repository.py +++ b/pyard/data_repository.py @@ -20,6 +20,7 @@ # > http://www.fsf.org/licensing/licenses/lgpl.html # > http://www.opensource.org/licenses/lgpl-license.php # +import copy from collections import namedtuple import functools import sqlite3 @@ -380,7 +381,7 @@ def generate_alleles_and_xx_codes_and_who( if broad in xx_codes: xx_codes[broad].extend(xx_codes[split]) else: - xx_codes[broad] = xx_codes[split] + xx_codes[broad] = copy.deepcopy(xx_codes[split]) # Save this version of the valid alleles db.save_set(db_connection, "alleles", valid_alleles, "allele") diff --git a/tests/test_pyard.py b/tests/test_pyard.py index 865799d..02f9e05 100644 --- a/tests/test_pyard.py +++ b/tests/test_pyard.py @@ -163,3 +163,9 @@ def test_allele_duplicated(self): def test_imgt_db_version(self): self.assertEqual(self.ard.get_db_version(), int(TestPyArd.db_version)) + + def test_xx_codes_broad_split(self): + self.assertFalse( + "DQB1*06" in self.ard.redux_gl("DQB1*05:XX", "lgx"), + "The split shouldn't include other splits", + ) From dbdb08b278ad061220b1ada00d9d648c6009daf6 Mon Sep 17 00:00:00 2001 From: pbashyal-nmdp Date: Tue, 7 Feb 2023 12:16:51 -0600 Subject: [PATCH 2/3] Bump version to 0.9.0 --- api-spec.yaml | 2 +- pyard/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api-spec.yaml b/api-spec.yaml index 04a45ba..debe488 100644 --- a/api-spec.yaml +++ b/api-spec.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: ARD Reduction description: Reduce to ARD Level - version: "0.8.3" + version: "0.9.0" servers: - url: 'http://localhost:8080' tags: diff --git a/pyard/__init__.py b/pyard/__init__.py index d7cd5ab..1df241a 100644 --- a/pyard/__init__.py +++ b/pyard/__init__.py @@ -25,4 +25,4 @@ from .blender import blender as dr_blender __author__ = """NMDP Bioinformatics""" -__version__ = "0.8.3" +__version__ = "0.9.0" diff --git a/setup.cfg b/setup.cfg index aceba8c..d9e5227 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.8.3 +current_version = 0.9.0 commit = True tag = True diff --git a/setup.py b/setup.py index bfadde3..3277fa9 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup( name="py-ard", - version="0.8.3", + version="0.9.0", description="ARD reduction for HLA with Python", long_description=readme + "\n\n" + history, long_description_content_type="text/markdown", From 2a6066783c1b57b5463554b8ea16393cdda515c0 Mon Sep 17 00:00:00 2001 From: pbashyal-nmdp Date: Tue, 7 Feb 2023 12:27:21 -0600 Subject: [PATCH 3/3] Fix lint issue --- pyard/pyard.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pyard/pyard.py b/pyard/pyard.py index 26f3b90..0170374 100644 --- a/pyard/pyard.py +++ b/pyard/pyard.py @@ -81,7 +81,6 @@ class ARD(object): def __init__( self, imgt_version: str = "Latest", data_dir: str = None, config: dict = None ): - """ ARD will load valid alleles, xx codes and MAC mappings for the given version of IMGT database, downloading and generating the database if