Skip to content

Commit

Permalink
Merge pull request #197 from pbashyal-nmdp/3130_rename_to_3131
Browse files Browse the repository at this point in the history
Special case 3130->3131 version of allelelist.txt
  • Loading branch information
mmaiers-nmdp authored Feb 9, 2023
2 parents 09cad4e + 5c7c132 commit ab2b7b2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.3
info:
title: ARD Reduction
description: Reduce to ARD Level
version: "0.9.0"
version: "0.9.1"
servers:
- url: 'http://localhost:8080'
tags:
Expand Down
2 changes: 1 addition & 1 deletion pyard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
from .blender import blender as dr_blender

__author__ = """NMDP Bioinformatics"""
__version__ = "0.9.0"
__version__ = "0.9.1"
16 changes: 15 additions & 1 deletion pyard/data_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
# > http://www.fsf.org/licensing/licenses/lgpl.html
# > http://www.opensource.org/licenses/lgpl-license.php
#
import sys
import copy
from collections import namedtuple
import functools
import sqlite3
from urllib.error import HTTPError

import pandas as pd

from . import db
Expand Down Expand Up @@ -334,10 +337,21 @@ def generate_alleles_and_xx_codes_and_who(
if imgt_version == "Latest":
allele_list_url = f"{IMGT_HLA_URL}Latest/Allelelist.txt"
else:
if imgt_version == "3130":
# 3130 was renamed to 3131 for Allelelist file only 🤷🏾‍
imgt_version = "3131"
allele_list_url = (
f"{IMGT_HLA_URL}Latest/allelelist/Allelelist.{imgt_version}.txt"
)
allele_df = pd.read_csv(allele_list_url, header=6, usecols=["Allele"])

try:
allele_df = pd.read_csv(allele_list_url, header=6, usecols=["Allele"])
except HTTPError as e:
print(
f"Failed importing alleles for version {imgt_version} from {allele_list_url}",
file=sys.stderr,
)
sys.exit(1)

# Create a set of valid alleles
# All 2-field, 3-field and the original Alleles are considered valid alleles
Expand Down
10 changes: 2 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.0
current_version = 0.9.1
commit = True
tag = True

Expand All @@ -19,10 +19,4 @@ replace = version: "{new_version}"
universal = 1

[flake8]
exclude =
venv,
.git,
__pycache__,
build,
dist,
docs
exclude = venv, .git, __pycache__, build, dist, docs
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

setup(
name="py-ard",
version="0.9.0",
version="0.9.1",
description="ARD reduction for HLA with Python",
long_description=readme + "\n\n" + history,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit ab2b7b2

Please sign in to comment.