genos.client

Classes

GenosClient([token, timeout, api_map])

GeneOS API unified client.

class GenosClient(token=None, timeout=30, api_map=None)[source]

Bases: object

GeneOS API unified client.

Provides a high-level SDK interface for users to access multiple biological analysis models (mutation, embedding, RNA).

Example

>>> from genos import create_client
>>> client = create_client(token="your_token")
>>> client.variant_predict("hg19", "chr6", 51484075, "T", "G")
>>> client.get_embedding("ATGC...")
>>> client.rna_coverage_track_pred(chrom="chr6", start_pos=51484075)
variant_predict(assembly: str, chrom: str, pos: int, ref: str, alt: str)[source]

Predicts the functional or pathogenic effect of a given 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

get_embedding(sequence: str, model_name: str = 'Genos-1.2B', pooling_method: str = 'mean')[source]

Extracts a numerical embedding representation for a given nucleotide sequence.

Parameters:
  • sequence (str) – DNA sequence string .

  • model_name (str, optional) – Model name to use. Default is “Genos-1.2B”. Options: “Genos-1.2B”, “Genos-10B”

  • pooling_method (str, optional) – Pooling method. Default is “mean”. Options: “mean”, “max”, “last”, “none”

Returns:

  • “sequence”: input sequence

  • ”sequence_length”: length of sequence

  • ”token_count”: number of tokens

  • ”embedding_shape”: shape of embedding array

  • ”embedding_dim”: dimension of embedding

  • ”pooling_method”: pooling method used

  • ”model_type”: model type used

  • ”embedding”: embedding array (list)

Return type:

dict

Raises:
  • ValueError – If sequence is not a valid string or list.

  • ValidationError – If parameters are invalid.

  • APIRequestError – If the API request fails.

rna_coverage_track_pred(chrom: str, start_pos: int)[source]

Predicts RNA-seq coverage track based on genomic coordinates.

This method provides access to RNA-seq Coverage Track Prediction models, allowing users to predict the coverage track of an RNA-seq experiment based on the genomic coordinates.

Parameters:
  • chrom (str) – Chromosome name (e.g., "chr1").

  • start_pos (int) – Genomic start position (1-based index).

Returns:

A JSON response containing the predicted coverage track.

Return type:

dict