encode_cells

encode_cells#

DnaClient.encode_cells(cells, *, progress_bar=True, max_workers=5)[source]#

Encode single-cell count profiles into AlphaGenome 2 latent embeddings.

Runs AlphaGenome 2’s single-cell autoencoder (trained on CELLxGENE) without evaluating the DNA sequence model. Use this as a fast diagnostic check to verify that biological variation across cell states is preserved in embedding space before running sequence predictions or variant scoring. Because the encoder does not explicitly correct batch effects, stratify inputs by batch or donor when comparing conditions.

Cells are split into chunks of at most MAX_ENCODE_CELLS_PER_REQUEST cells, which are encoded in parallel.

Parameters:
  • cells (AnnData) – Human AnnData object with raw integer UMI counts in .X and Ensembl gene IDs (ENSG...) in .var_names.

  • progress_bar (bool (default: True)) – If True, show a progress bar.

  • max_workers (int (default: 5)) – Number of parallel workers to use.

Return type:

ndarray

Returns:

NumPy array of per-cell embeddings with shape (num_cells, latent_dim).