Skip to content

Commit 0d87189

Browse files
committed
Path for empty files
- Use given `data_dir` for mac files. - bumped version to 0.0.17
1 parent 21272d4 commit 0d87189

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

pyard/pyard.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,14 @@ def __init__(self, dbversion: str='Latest',
128128

129129
imgt_hla_url = 'https://raw.githubusercontent.com/ANHIG/IMGTHLA/'
130130
ars_url = imgt_hla_url + dbversion + '/wmda/hla_nom_g.txt'
131+
allele_url = imgt_hla_url + dbversion + "/Allelelist.txt"
132+
131133
ars_file = data_dir + '/hla_nom_g.' + str(dbversion) + ".txt"
132134
allele_file = data_dir + '/AlleleList.' + str(dbversion) + ".txt"
133135
mac_file = data_dir + "/mac.txt"
134136
mac_pickle = data_dir + "/mac.pickle"
137+
# dna_relshp.csv is part of the codebase
135138
broad_file = os.path.dirname(__file__) + "/dna_relshp.csv"
136-
#print("mac_file:", mac_file)
137-
138-
allele_url = "https://raw.githubusercontent.com/ANHIG/IMGTHLA/" \
139-
+ dbversion + "/Allelelist.txt"
140139

141140
# Downloading ARS file
142141
if not os.path.isfile(ars_file):
@@ -155,7 +154,7 @@ def __init__(self, dbversion: str='Latest',
155154
if not os.path.isfile(mac_pickle):
156155
if verbose:
157156
logging.info("Downloading MAC file")
158-
self.mac = all_macs(mac_file)
157+
self.mac = all_macs(mac_file, data_dir=data_dir)
159158

160159
# Writing dict to pickle file
161160
with open(mac_pickle, 'wb') as handle:

pyard/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@
4848
# mac_dict = df.set_index("Code").to_dict('index')
4949
# return mac_dict
5050

51-
def all_macs(csv_file, url='https://hml.nmdp.org/mac/files/numer.v3.zip'):
51+
def all_macs(csv_file, url='https://hml.nmdp.org/mac/files/numer.v3.zip', data_dir=os.path.dirname(__file__)):
5252
urllib.request.urlretrieve(url, 'numeric.v3.zip')
5353
zip_ref = zipfile.ZipFile('numeric.v3.zip', 'r')
54-
data_dir = os.path.dirname(__file__)
5554
zip_ref.extractall(data_dir)
5655
zip_ref.close()
5756
data = []

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.0.16',
45+
version='0.0.17',
4646
description="ARD reduction for HLA with python",
4747
long_description=readme + '\n\n' + history,
4848
author="CIBMTR",

0 commit comments

Comments
 (0)