HLATypingTools
Getting Started
Install from PyPI (recommended)
To use HLATypingTools, run pip install HLATypingTools in your terminal.
All python packages necessary for HLATypingTools will automatically be downloaded.
Usage
If you haven't decrypted the data yet (first time you are using the package and you did request access to the product), run:
from hlatypingtools.decrypt_file import decrypt_file
password: str = "___" # Replace with password provided by the author
decrypt_file(password)
It should print File decrypted successfully.
Then you can use the package as follows:
from hlatypingtools.get_info import get_allele_info
allele: str = "A*01:01"
print(get_allele_info(allele, "Broad")) # will output A1
print(get_allele_info(allele, "Assigned Type")) # will output A1
print(get_allele_info(allele, "G Group")) # will output A*01:01:01G
print(get_allele_info(allele, "P Group")) # will output A*01:01P
print(get_allele_info(allele, "% locus")) # will output 11.906
Or as follows:
from hlatypingtools.get_info import get_locus
print(get_locus("A*01:01")) # will output HLA_A
Or as follows to output all possible high-resolution alleles for a given low-resolution typing:
from hlatypingtools.get_info import get_same_low_res_broad, get_same_low_res_assigned_type
broad = "DQ3"
print("DQB1*03:01" in get_same_low_res_broad(broad)) # will output True
print("DQB1*03:02" in get_same_low_res_broad(broad)) # will output True
assigned_type = "DQ7"
print("DQB1*03:01" in get_same_low_res_assigned_type(assigned_type)) # will output True
print("DQB1*03:02" in get_same_low_res_assigned_type(assigned_type)) # will output False
Note:
- Broad = something like A1, B7, Cw1, DR1, DQ3 (!!!), DQA1*01, DR52, DPB1*01, or DPA1*01
- Assigned Type = something like A1, B7, Cw1, DR1, DQ7 (!!!), DQA1*01, DR52, DPB1*01, or DPA1*01
Exit codes
0: Wrong password.
1: Tried to acess the functions of the package without decrypting the data first.
2: type_info requested is not available.
3: wrong format for a low-resolution input. Has to be of the form A1, B7, Cw1, DR1, DQ3, DQA1*01, DR52, DPB1*01, or
DPA1*01.
About the source code
- Follows PEP8 Style Guidelines.
- All functions are unit-tested with pytest.
- All variables are correctly type-hinted, reviewed with static type checker
mypy. - All functions are documented with docstrings.
Useful links:
Metadata
Release files for hlatypingtools 1.0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hlatypingtools-1.0.8.1.tar.gz | 205.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hlatypingtools-1.0.8.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 409.8 kB
Release files / hlatypingtools-1.0.8.1.tar.gz
| Download URL | hlatypingtools-1.0.8.1.tar.gz |
|---|---|
| Size | 205.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce15d0cc55d9929d995ee640ec1019bbfcf3dff57cf5a47b3b1cb5d53d6a9843
|
|
BLAKE2b-256 checksum How to use checksums |
c4f400bb4b63e558434b00336c0844cc9eef1a0f911b5b632a10e464a5f791ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.6 Windows/10
|
Release files / hlatypingtools-1.0.8.1-py3-none-any.whl
| Download URL | hlatypingtools-1.0.8.1-py3-none-any.whl |
|---|---|
| Size | 204.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
898b0a878e5be8a528fd479d2f2d30d950f31088126cc22027caae0b9153632c
|
|
BLAKE2b-256 checksum How to use checksums |
57babafc8ee1840cbd79d5d469adf629f9ba8188af096387a2c822f487363762
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.6 Windows/10
|