Skip to content

Commit

Permalink
0.3.0 -> 0.3.1 ; several changes
Browse files Browse the repository at this point in the history
- New .csv (V. Clichet)
- Completely renamed epitopes in eplets (functions, variables, docstrings, etc ...)
- Fixed unit tests (AbV)
- Optimised is_eplet_to_be_added function
- Fixed Zenodo stuff
- Updated CITATION.cff
- Better README.md
- Fixed ghost alleles
  • Loading branch information
JasonMendoza2008 committed Jan 11, 2023
1 parent 4938e8e commit 3c42b7a
Show file tree
Hide file tree
Showing 22 changed files with 4,578 additions and 4,519 deletions.
11 changes: 7 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
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.3.0) [Computer software]. https://doi.org/10.5281/zenodo.7254809"
Lhotte, R., Clichet, V., Usureau, C. & Taupin, J. (2022). Python Eplet Load Calculator (PELC) package
(Version 0.3.1) [Computer software]. https://doi.org/10.5281/zenodo.7254809"
authors:
- family-names: Lhotte
given-names: Romain
orcid: https://orcid.org/0000-0002-6131-5415
- family-names: Clichet
given-names: Valentin
orcid:
- family-names: Usureau
given-names: Cédric
orcid:
- family-names: Taupin
given-names: Jean-Luc
orcid: https://orcid.org/0000-0002-5766-046X
title: Python Epitope Charge Calculator
version: 0.3.0
title: Python Eplet Load Calculator
version: 0.3.1
doi: doi.org/10.5281/zenodo.7254809
link: https://github.com/MICS-Lab/pecc
date-released: 2022-10-26
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
### Overview
PELC is a Python package designed to calculate efficiently the HLA Eplet Load (based on the
[EpRegistry database](https://www.epregistry.com.br/)) between donors and recipients by loading in a pandas.DataFrame
in `epitope_comparison.compute_epitopic_charge`. See minimal reproducible example for more details.
in `eplet_comparison.compute_epletic_load` the recipients' and donors' typings. See minimal reproducible example for
more details.


### Getting started
Expand All @@ -14,12 +15,13 @@ To use `pelc`, run `pip install pelc` in your terminal.


#### Usage
Here is a minimal example with the file [Template.xlsx](https://github.com/MICS-Lab/pelc/raw/main/Template.xlsx) (click to download):
Here is a minimal example with the file [Template.xlsx](https://github.com/MICS-Lab/pelc/raw/main/Template.xlsx)
(click to download):

```py
import pandas as pd

from pelc import epitope_comparison, epitope_comparison_aux, output_type

from pelc import eplet_comparison, eplet_comparison_aux, output_type

if __name__ == "__main__":
input_path: str = "Template.xlsx"
Expand All @@ -31,13 +33,18 @@ if __name__ == "__main__":

donordf: pd.DataFrame
recipientdf: pd.DataFrame
donordf, recipientdf = epitope_comparison_aux.split_dataframe(input_df)
donordf, recipientdf = eplet_comparison_aux.split_dataframe(input_df)

epitope_comparison.compute_epitopic_charge(
eplet_comparison.compute_epletic_load(
donordf,
recipientdf,
output_path,
output_type.OutputType.DETAILS_AND_COUNT
output_type.OutputType.DETAILS_AND_COUNT,
class_i = True, # Compute class I eplets comparison?
class_ii = True, # Compute class II eplets comparison?
verifiedonly = False, # How should the epletic charge be computed? Verified eplets only? Or all eplets?
exclude = None, # list of indices to exclude
interlocus2 = True # whether or not to take into account interlocus eplets for HLA of class II
)
```

Expand Down Expand Up @@ -115,7 +122,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.3.0) [Computer software].
Lhotte, R., Usureau, C., & Taupin, J. (2022). Python Epitope Charge Calculator (Version 0.3.1) [Computer software].
https://doi.org/10.5281/zenodo.7254809
```

Expand All @@ -126,7 +133,7 @@ https://doi.org/10.5281/zenodo.7254809
doi = {doi.org/10.5281/zenodo.7254809},
month = {10},
title = {{Python Eplet Load Calculator}},
version = {0.3.0},
version = {0.3.1},
year = {2022}
}
```
2 changes: 1 addition & 1 deletion pelc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__version__: str = importlib.metadata.version("pelc")

from . import epitope_comparison, epitope_comparison_aux, output_type
from . import eplet_comparison, eplet_comparison_aux, output_type
22 changes: 22 additions & 0 deletions pelc/_open_epregistry_databases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pandas as pd


def _open_epregistry_database(path_to_csv: str, ghost_allele: str, no_eplets: bool = False) -> pd.DataFrame:
"""
:param path_to_csv: path to the csv EpRegistry database file
:param ghost_allele: allele string to be used as a ghost allele (no eplets)
:return: pandas.DataFrame with the EpRegistry database and the ghost allele
"""

df_db: pd.DataFrame
if no_eplets:
df_db = pd.read_csv(path_to_csv, sep=";", usecols=[0]).set_index("allele")
# add a row to an empty dataframe with concat
df_db = pd.concat([df_db, pd.DataFrame(columns=[], index=[ghost_allele])])
else:
df_db = pd.read_csv(path_to_csv, sep=";").set_index("allele")
# add row with nan values
df_db.loc[ghost_allele] = float("nan")

return df_db
4 changes: 4 additions & 0 deletions pelc/_unexpected_alleles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@


def read_available_alleles(df_ref: pd.DataFrame) -> list[str]:
"""
:param df_ref: reference dataframe
:return: all known alleles in the reference dataframe (df_a, df_b, df_c, df_dr, df_dq, or df_dp)
"""
list_ref: list[str] = list(df_ref.index.values)

return list_ref
Expand Down
Loading

0 comments on commit 3c42b7a

Please sign in to comment.