Skip to content

Commit 32e6f48

Browse files
Added unit tests for DQA1 and DPA1
1 parent 8dd775b commit 32e6f48

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

tests/pytest_160s.xlsx

9.28 KB
Binary file not shown.

tests/pytest_dpa.xlsx

9.28 KB
Binary file not shown.

tests/test_eplet_mismatches.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,48 @@ def test_interlocus2() -> None:
305305
# But we don't want interlocus2 (argument interlocus2 = False).
306306

307307
os.remove(f"{output_path}.csv")
308+
309+
310+
def test_dqa() -> None:
311+
donordf, recipientdf, output_path = base_loading("pytest_160s.xlsx", "Sheet 1")
312+
313+
for class_1 in False, True:
314+
compute_epletic_load(
315+
donordf,
316+
recipientdf,
317+
output_path,
318+
OutputType.DETAILS_AND_COUNT,
319+
class_1, # class_i
320+
True, # class_ii
321+
False, # abv_only
322+
)
323+
324+
output_df: pd.DataFrame = pd.read_csv(f"{output_path}.csv", index_col="Index")
325+
326+
assert output_df.at[8, "EpMismatches"] == "160S_DQ"
327+
assert output_df.at[8, "Eplet Load"] == 1
328+
329+
os.remove(f"{output_path}.csv")
330+
331+
332+
def test_dpa() -> None:
333+
donordf, recipientdf, output_path = base_loading("pytest_dpa.xlsx", "Sheet 1")
334+
335+
for class_1 in False, True:
336+
compute_epletic_load(
337+
donordf,
338+
recipientdf,
339+
output_path,
340+
OutputType.DETAILS_AND_COUNT,
341+
class_1, # class_i
342+
True, # class_ii
343+
False, # abv_only
344+
)
345+
346+
output_df: pd.DataFrame = pd.read_csv(f"{output_path}.csv", index_col="Index")
347+
348+
assert output_df.at[8, "EpMismatches"] == "11A_DP"
349+
# 11A is in DPA1*01:03 (donor typing) but not in DPA1*03:01 (recipient typing)
350+
assert output_df.at[8, "Eplet Load"] == 1
351+
352+
os.remove(f"{output_path}.csv")

0 commit comments

Comments
 (0)