genos.api.variant_predictor

Functions

check_chromosome(chrom)

Check if the chromosome is valid.

check_position(assembly, chrom, pos)

Check if the position is valid.

Classes

VariantPredictorAPI(session, base_url[, timeout])

Wrapper class for the Variant Prediction API endpoint.

check_chromosome(chrom: str) bool[source]

Check if the chromosome is valid.

check_position(assembly: str, chrom: str, pos: int) bool[source]

Check if the position is valid.

class VariantPredictorAPI(session: Session, base_url: str, timeout: int = 30)[source]

Bases: BaseAPI

Wrapper 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.