genos.api.variant_predictor
Functions
|
Check if the chromosome is valid. |
|
Check if the position is valid. |
Classes
|
Wrapper class for the Variant Prediction API endpoint. |
- class VariantPredictorAPI(session: Session, base_url: str, timeout: int = 30)[source]
Bases:
BaseAPIWrapper class for the Variant Prediction API endpoint.
This class handles requests to the /predict endpoint for variant pathogenicity prediction. It validates input and raises structured SDK exceptions on errors.
- predict(assembly: str, chrom: str, pos: int, ref: str, alt: str) dict[source]
Predict the pathogenicity of a genetic variant.
- Parameters:
assembly (str) – Reference genome version, allowed values: ‘hg38’ or ‘hg19’.
chrom (str) – Chromosome, e.g., ‘chr6’.
pos (int) – Position, 1-based coordinate.
ref (str) – Reference allele, single letter or sequence.
alt (str) – Alternate allele, single letter or sequence.
- Returns:
- Prediction result, typically containing:
”variant”: input variant
”prediction”: “Pathogenic” or “Benign”
”score_Benign”: float
”score_Pathogenic”: float
- Return type:
dict
- Raises:
ValueError – If any argument is invalid.
APIRequestError – If the API request fails or the server returns an error.