# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['pelc']

package_data = \
{'': ['*'], 'pelc': ['data/*']}

install_requires = \
['openpyxl>=3.0.10,<4.0.0',
 'pandas-stubs>=2.1.4.231227,<3.0.0.0',
 'pandas>=2.1.0,<3.0.0']

setup_kwargs = {
    'name': 'pelc',
    'version': '0.5.4.3',
    'description': 'Python Eplet Load Calculator',
    'long_description': '[![DOI](https://zenodo.org/badge/555576588.svg)](https://zenodo.org/badge/latestdoi/555576588)\n[![Downloads](https://pepy.tech/badge/pelc)](https://pepy.tech/project/pelc)\n# PELC (Python Eplet Load Calculator)\n\n### Overview\nPELC is a Python package designed to calculate efficiently the HLA Eplet Load (based on the\n[EpRegistry database](https://www.epregistry.com.br/)) between donors and recipients by loading in a pandas.DataFrame\nin `eplet_comparison.compute_epletic_load` the recipients\' and donors\' typings.  See minimal reproducible example for\nmore details.\n\n\n### Getting started\n#### Install from PyPI (recommended)\nTo use `pelc`, run `pip install pelc` in your terminal.\n\n\n#### Usage\n\n##### a. Comparing two alleles\nHere is a minimal example of how to use `pelc` to compare two alleles:\n```py\nfrom pelc.simple_comparison import simple_comparison\n\nsimple_comparison(\n    "A*68:01",\n    "A*68:02",\n    "output",  # file will be saved as output.csv in the current directory\n    verifiedonly=False,  # if True, only verified eplets will be considered, otherwise all eplets will be considered\n    interlocus2=True  # doesn\'t matter for class I alleles\n)\n```\nIn the `output.csv` file created in the current directory, you will find two rows: "In A&ast;68:02 but not in \nA&ast;68:01" and "In A&ast;68:01 but not in A&ast;68:02".\n\n##### b. Batch mode\nHere is a minimal example with the file [Template.xlsx](https://github.com/MICS-Lab/pelc/raw/main/Template.xlsx)\n(click to download):\n```py\nimport pandas as pd\n\nfrom pelc import batch_eplet_comp, batch_eplet_comp_aux, output_type\n\nif __name__ == "__main__":\n    input_path: str = "Template.xlsx"\n\n    output_path: str = "MyOutput"\n    input_df: pd.DataFrame = pd.read_excel(\n        input_path,\n        sheet_name="My Sheet",\n        index_col=0,\n    )\n\n    donordf: pd.DataFrame\n    recipientdf: pd.DataFrame\n    donordf, recipientdf = batch_eplet_comp_aux.split_dataframe(input_df)\n\n    batch_eplet_comp.compute_epletic_load(\n        donordf,\n        recipientdf,\n        output_path,\n        output_type.OutputType.DETAILS_AND_COUNT,\n        class_i=True,  # Compute class I eplets comparison?\n        class_ii=True,  # Compute class II eplets comparison?\n        verifiedonly=False,  # How should the epletic charge be computed? Verified eplets only? Or all eplets?\n        exclude=None,  # list of indices to exclude\n        interlocus2=True  # whether or not to take into account interlocus eplets for HLA of class II\n    )\n```\nNote that if a typing is unknown, one can use `A*`, `B*`, ..., `DPB1*` as the allele name for **both** recipients and\ndonors. If the allele is unknown for only of the two individuals, it is necessary to use `A*`, `B*`, ..., `DPB1*` for\nboth individuals otherwise the eplet mismatch computation will not be performed for this donor / recipient pair.\n\n#### Advanced usage:\n##### a. Not taking into account all loci (if they are not typed for example)\nIf one wants to determine the eplet mismatches between a donor and a recipient but without taking into account\na certain locus, one can use `A*`, `B*`, ..., `DPB1*` as the allele name for both recipients and donors on this locus\nand the eplet mismatch computation will only take into account the loci filled in.\n\n##### b. Not creating a file but generating a pandas.DataFrame\nIf one wants to generate a `pandas.DataFrame` directly, the `output_path` argument of `simple_comparison` can be \nset to `None`. The `pandas.DataFrame` will be returned by the function. Same goes for `compute_epletic_load`.\n\n\n#### Exit codes:\n```\n- 55: an eplet did not match the regular expression \'^\\d+\' (ABC, DR, DQ or DP) and it also did not match the regular\nexpression \'^.[PQR]*(\\d+)\' (interlocus2) either.\n```\n\n\n#### Unit tests\nTested on `Python 3.10.6` & `Python 3.11.1`.\n```\nplatform win32 -- Python 3.10.6, pytest-7.4.0, pluggy-1.2.0\nplugins: mypy-0.10.3\ncollected 39 items\n\nunit_tests_mypy.py ..                                                    [  5%]\nunit_tests_simple.py .                                                   [  7%]\npelc\\__init__.py .                                                       [ 10%]\npelc\\_input_sanity_check.py .                                            [ 12%]\npelc\\_open_epregistry_databases.py .                                     [ 15%]\npelc\\_unexpected_alleles.py .                                            [ 17%]\npelc\\batch_eplet_comp.py .                                               [ 20%]\npelc\\batch_eplet_comp_aux.py .                                           [ 23%]\npelc\\output_type.py .                                                    [ 25%]\npelc\\simple_comparison.py .                                              [ 28%]\ntests\\__init__.py .                                                      [ 30%]\ntests\\base_loading_for_tests.py .                                        [ 33%]\ntests\\test_eplet_mismatches.py .........                                 [ 56%]\ntests\\test_extract_key_to_rank_epletes.py ..                             [ 61%]\ntests\\test_is_valid_allele.py ..                                         [ 66%]\ntests\\test_only_one_chromosome.py ..                                     [ 71%]\ntests\\test_pelc.py ..                                                    [ 76%]\ntests\\test_same_locus.py ..                                              [ 82%]\ntests\\test_simple_comparison.py .....                                    [ 94%]\ntests\\test_unexpected_alleles.py ..                                      [100%]\n==================================== mypy =====================================\n\nSuccess: no issues found in 20 source files\n============================= 39 passed in 34.42s =============================\n```\n\n```\nplatform win32 -- Python 3.11.1, pytest-7.2.2, pluggy-1.0.0\nplugins: anyio-3.6.2, mypy-0.10.3\ncollected 39 items\n\nunit_tests_mypy.py ..                                                    [  5%]\nunit_tests_simple.py .                                                   [  7%]\npelc\\__init__.py .                                                       [ 10%]\npelc\\_input_sanity_check.py .                                            [ 12%]\npelc\\_open_epregistry_databases.py .                                     [ 15%]\npelc\\_unexpected_alleles.py .                                            [ 17%]\npelc\\batch_eplet_comp.py .                                               [ 20%]\npelc\\batch_eplet_comp_aux.py .                                           [ 23%]\npelc\\output_type.py .                                                    [ 25%]\npelc\\simple_comparison.py .                                              [ 28%]\ntests\\__init__.py .                                                      [ 30%]\ntests\\base_loading_for_tests.py .                                        [ 33%]\ntests\\test_eplet_mismatches.py .........                                 [ 56%]\ntests\\test_extract_key_to_rank_epletes.py ..                             [ 61%]\ntests\\test_is_valid_allele.py ..                                         [ 66%]\ntests\\test_only_one_chromosome.py ..                                     [ 71%]\ntests\\test_pelc.py ..                                                    [ 76%]\ntests\\test_same_locus.py ..                                              [ 82%]\ntests\\test_simple_comparison.py .....                                    [ 94%]\ntests\\test_unexpected_alleles.py ..                                      [100%]\n==================================== mypy =====================================\n\nSuccess: no issues found in 20 source files\n============================= 39 passed in 32.56s =============================\n```\n\n\n\n### About the source code\n- Follows [PEP8](https://peps.python.org/pep-0008/) Style Guidelines.\n- All functions are unit-tested with [pytest](https://docs.pytest.org/en/stable/).\n- All variables are correctly type-hinted, reviewed with [static type checker](https://mypy.readthedocs.io/en/stable/)\n`mypy`.\n- All functions are documented with [docstrings](https://www.python.org/dev/peps/pep-0257/).\n\n\n\n### Useful links:\n- [Corresponding GitHub repository](https://github.com/MICS-Lab/pelc)\n- [Corresponding PyPI page](https://pypi.org/project/pelc)\n\n\n\n### Citation\nIf you use this software, please cite it as below.\n\n- APA:\n```\nIf you use this software, please cite it as below. \n\nLhotte, R., Clichet, V., Usureau, C. & Taupin, J. (2022). \nPython Eplet Load Calculator (PELC) package (Version 0.5.4.3) [Computer software].\nhttps://doi.org/10.5281/zenodo.7254809\n```\n\n- BibTeX:\n```\n@software{lhotte_romain_2022_7526198,\n  author       = {Lhotte, Romain and\n                  Clichet, Valentin and\n                  Usureau, Cédric and\n                  Taupin, Jean-Luc},\n  title        = {Python Eplet Load Calculator},\n  month        = oct,\n  year         = 2022,\n  publisher    = {Zenodo},\n  version      = {0.5.4.3},\n  doi          = {10.5281/zenodo.7526198},\n}\n```\n',
    'author': 'JasonMendoza2008',
    'author_email': 'lhotteromain@gmail.com',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
