py_hla_match.external
- class py_hla_match.external.DPB1Result(status, prediction=None)[source]
Bases:
objectResult 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:
status (DPB1TCEStatus)
prediction (str | None)
- 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:
objectConfiguration 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:
EnumStatus 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:
Classes
|
Result object for a DPB1 TCE API query. |
|
Configuration for DPB1 TCE API endpoints and response keys |
|
Status codes for the DPB1 TCE API interactions. |
Functions
|
Query the EBI DPB1 TCE API for T-Cell Epitope matching. |