py_hla_match.external

class py_hla_match.external.DPB1Result(status, prediction=None)[source]

Bases: object

Result object for a DPB1 TCE API query.

Variables:
  • status – The status of the API request (Success or Error code).

  • prediction – The raw prediction string from the API (e.g., ‘Permissive’, ‘Non-Permissive GvH’) if successful, else None.

Parameters:
property is_valid: bool

Returns True if the request was successful and has a prediction.

prediction: str | None = None
status: DPB1TCEStatus
class py_hla_match.external.DPB1TCEConfig(endpoints=None, response_keys=None)[source]

Bases: object

Configuration for DPB1 TCE API endpoints and response keys

Parameters:
  • endpoints (Dict[str, str])

  • response_keys (Dict[str, str])

endpoints: Dict[str, str] = None
response_keys: Dict[str, str] = None
class py_hla_match.external.DPB1TCEStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Status codes for the DPB1 TCE API interactions.

API_ERROR = 'Unknown API Error'
CONFIGURATION_ERROR = 'Configuration Error'
INVALID_ALLELES = 'API Invalid Alleles'
REQUEST_ERROR = 'Request Error'
SUCCESS = 'Success'
TIMEOUT_ERROR = 'Timeout Error'
UNEXPECTED_ERROR = 'Unexpected Error'
VALUE_ERROR = 'Value Error'
py_hla_match.external.query_dpb1_tce(patient_dpb1, patient_dpb2, donor_dpb1, donor_dpb2, version='3.0', timeout=10, config=None)[source]

Query the EBI DPB1 TCE API for T-Cell Epitope matching.

Intended for research workflows.

Parameters:
  • patient_dpb1 (str) – Patient’s first DPB1 allele (e.g. “01:01”)

  • patient_dpb2 (str) – Patient’s second DPB1 allele

  • donor_dpb1 (str) – Donor’s first DPB1 allele

  • donor_dpb2 (str) – Donor’s second DPB1 allele

  • version (str) – API version - “2.0”, “2.1”, or “3.0”

  • timeout (int) – API request timeout in seconds

  • config (DPB1TCEConfig | None) – Configuration object (default if None)

Returns:

DPB1Result object containing status and raw prediction string

Return type:

DPB1Result

Classes

DPB1Result(status[, prediction])

Result object for a DPB1 TCE API query.

DPB1TCEConfig([endpoints, response_keys])

Configuration for DPB1 TCE API endpoints and response keys

DPB1TCEStatus(value[, names, module, ...])

Status codes for the DPB1 TCE API interactions.

Functions

query_dpb1_tce(patient_dpb1, patient_dpb2, ...)

Query the EBI DPB1 TCE API for T-Cell Epitope matching.