Skip to content

Commit

Permalink
Added unit tests. Preparation for v0.2.2.
Browse files Browse the repository at this point in the history
Signed-off-by: JasonMendoza2008 <[email protected]>
  • Loading branch information
JasonMendoza2008 committed Oct 28, 2022
1 parent 6d2c6f4 commit fca6851
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below.
Lhotte, R., Usureau, C. & Taupin, J. (2022). Python Epitope Charge Calculator (PECC) package
(Version 0.2.1) [Computer software]. https://doi.org/10.5281/zenodo.7254809"
(Version 0.2.2) [Computer software]. https://doi.org/10.5281/zenodo.7254809"
authors:
- family-names: Lhotte
given-names: Romain
Expand All @@ -13,7 +13,7 @@ authors:
given-names: Jean-Luc
orcid: https://orcid.org/0000-0002-5766-046X
title: Python Epitope Charge Calculator
version: 0.2.1
version: 0.2.2
doi: doi.org/10.5281/zenodo.7254809
link: https://github.com/MICS-Lab/pecc
date-released: 2022-10-26
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pecc\epitope_comparison_aux.py .
pecc\output_type.py . [ 42%]
tests\__init__.py . [ 47%]
tests\base_loading_for_tests.py . [ 52%]
tests\test_epitope_mismatches.py ..... [ 78%]
tests\test_epitope_mismatches.py ...... [ 78%]
tests\test_pecc.py .. [ 89%]
tests\test_unexpected_alleles.py .. [100%]
```
Expand All @@ -82,7 +82,7 @@ pecc\epitope_comparison_aux.py .
pecc\output_type.py . [ 42%]
tests\__init__.py . [ 47%]
tests\base_loading_for_tests.py . [ 52%]
tests\test_epitope_mismatches.py ..... [ 78%]
tests\test_epitope_mismatches.py ...... [ 78%]
tests\test_pecc.py .. [ 89%]
tests\test_unexpected_alleles.py .. [100%]
```
Expand All @@ -107,7 +107,7 @@ If you use this software, please cite it as below.

- APA:
```
Lhotte, R., Usureau, C., & Taupin, J. (2022). Python Epitope Charge Calculator (Version 0.2.1) [Computer software].
Lhotte, R., Usureau, C., & Taupin, J. (2022). Python Epitope Charge Calculator (Version 0.2.2) [Computer software].
https://doi.org/doi.org/10.5281/zenodo.7254809
```

Expand All @@ -118,7 +118,7 @@ author = {Lhotte, Romain and Usureau, Cédric and Taupin, Jean-Luc},
doi = {doi.org/10.5281/zenodo.7254809},
month = {10},
title = {{Python Epitope Charge Calculator}},
version = {0.2.1},
version = {0.2.2},
year = {2022}
}
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pecc"
version = "0.2.1"
version = "0.2.2"
description = "Python Epitopic Charge Calculator"
authors = ["JasonMendoza2008 <[email protected]>"]
readme = "README.md"
Expand Down
33 changes: 31 additions & 2 deletions tests/test_epitope_mismatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def test_epitope_comparison_details() -> None:
assert ("rq26Y" in list_mismatches_1)
# rq26Y is in DQB1*03:01 but not in DQB1*03:02 (can be checked by aligning the sequences on
# https://www.ebi.ac.uk/ipd/imgt/hla/alignment/)
# The prediction does not output rq26Y although it should
# rq26Y is therefore a false negative
# The prediction does not output rq26Y although it should - rq26Y is therefore a false negative
assert ("rqp37YA" not in list_mismatches_1)
# Both have this eplet
assert ("rp37FV" not in list_mismatches_1)
Expand Down Expand Up @@ -198,3 +197,33 @@ def test_epitope_comparison_dr13() -> None:
assert ("85VV_DR" in output_df_fn.at[8, "EpMismatches"])

os.remove(f"{output_path}.csv")


def test_interlocus2() -> None:
donordf, recipientdf, output_path = base_loading("pytest.xlsx", "False Negs")

compute_epitopic_charge(
donordf,
recipientdf,
output_path,
OutputType.ONLY_DETAILS,
True,
True,
False,
exclude=None,
interlocus2=False
)

output_df_fn: pd.DataFrame = pd.read_csv(f"{output_path}.csv", index_col="Index")

for index_ in range(6, 2146):
assert output_df_fn.at[index_, "EpMismatches"] == "None"

list_mismatches_1: list[str] = output_df_fn.at[1, "EpMismatches"].split(", ")
assert ("rq26Y" not in list_mismatches_1)
# rq26Y is in DQB1*03:01 but not in DQB1*03:02 (can be checked by aligning the sequences on
# https://www.ebi.ac.uk/ipd/imgt/hla/alignment/)
# The prediction does not output rq26Y although it should - rq26Y is therefore a false negative
# But we don't want interlocus2 (argument interlocus2 = False).

os.remove(f"{output_path}.csv")
2 changes: 1 addition & 1 deletion tests/test_pecc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == '0.2.1'
assert __version__ == '0.2.2'

0 comments on commit fca6851

Please sign in to comment.