from_anndata

Contents

from_anndata#

alphagenome.models.v2.gene_counts_condition.from_anndata(adata, target=None)[source]#

Converts AnnData rows to a CellConditioningInput proto.

This constructs the proto using bulk array slices for performance.

Parameters:
  • adata (AnnData) – An AnnData object. adata.X contains the count matrix, and adata.var_names contains the gene IDs.

  • target (CellConditioningInput | None (default: None)) – Optional CellConditioningInput proto to populate in-place (this avoids copying the potentially large submessage). If provided, the message will be Cleared and populated in-place without copying.

Return type:

CellConditioningInput

Returns:

A CellConditioningInput proto.