Skip to main content

No project description provided

Project description

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hlatypingtools-1.0.8.1.tar.gz (205.1 kB view details)

Uploaded Source

Built Distribution

hlatypingtools-1.0.8.1-py3-none-any.whl (204.7 kB view details)

Uploaded Python 3

File details

Details for the file hlatypingtools-1.0.8.1.tar.gz.

File metadata

  • Download URL: hlatypingtools-1.0.8.1.tar.gz
  • Upload date:
  • Size: 205.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.6 Windows/10

File hashes

Hashes for hlatypingtools-1.0.8.1.tar.gz
Algorithm Hash digest
SHA256 ce15d0cc55d9929d995ee640ec1019bbfcf3dff57cf5a47b3b1cb5d53d6a9843
MD5 e592154d5e706f1eb674868eee41007b
BLAKE2b-256 c4f400bb4b63e558434b00336c0844cc9eef1a0f911b5b632a10e464a5f791ab

See more details on using hashes here.

File details

Details for the file hlatypingtools-1.0.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hlatypingtools-1.0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 898b0a878e5be8a528fd479d2f2d30d950f31088126cc22027caae0b9153632c
MD5 272e370b28428855d45d2e87ea038ef1
BLAKE2b-256 57babafc8ee1840cbd79d5d469adf629f9ba8188af096387a2c822f487363762

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page