AlphaGenome 2#

Client, endpoints, outputs, conditions and scorers for AlphaGenome 2.

DNA client#

models.v2.dna_client.create(api_key, *[, ...])

Creates a model client for a given API key.

models.v2.dna_client.ModelVersion(value)

Enumeration of available model checkpoints.

models.v2.dna_client.Organism(value)

Enumeration of all the available organisms.

models.v2.dna_client.validate_sequence_length(length)

Validate that the input sequence length is supported by the model.

models.v2.dna_client.DnaClient(*, channel[, ...])

Client for interacting with a DNA model server.

Sequence lengths#

Supported input sequence lengths, for use with sequence_length arguments and validate_sequence_length(). Input gradient endpoints support only SEQUENCE_LENGTH_100KB and SEQUENCE_LENGTH_1MB.

alphagenome.models.v2.dna_client.SEQUENCE_LENGTH_16KB = 16384#

16,384 bp (2^14).

alphagenome.models.v2.dna_client.SEQUENCE_LENGTH_100KB = 131072#

131,072 bp (2^17).

alphagenome.models.v2.dna_client.SEQUENCE_LENGTH_500KB = 524288#

524,288 bp (2^19).

alphagenome.models.v2.dna_client.SEQUENCE_LENGTH_1MB = 1048576#

1,048,576 bp (2^20).

Limits#

alphagenome.models.v2.dna_client.MAX_CONDITIONING_CELLS = 256#

Maximum number of cells accepted per cell_conditioning call (256).

Endpoints#

The DnaClient exposes the following endpoints:

Method

Description

predict_sequence()

Predict tracks for a raw DNA sequence (predict_sequences for batches).

predict_interval()

Predict tracks for a reference genome interval (predict_intervals for batches).

predict_variant()

Predict tracks for the REF and ALT alleles of a variant (predict_variants for batches).

score_variant()

Score the effect of a variant (score_variants for batches).

score_interval()

Score an interval (score_intervals for batches).

score_ism_variants()

Score all single-base variants in an interval (in silico mutagenesis).

predict_interval_gradients()

Compute input gradients of a gene’s predicted expression (RNA_SEQ, SC_GENE_EXPRESSION, or SC_GENE_EXPRESSION_DENOISED) over an interval centered on the gene’s TSS (predict_interval_gradients_batch for batches).

encode_cells()

Encode raw single-cell UMI counts (human) into per-cell embeddings with the cell encoder, without running the sequence model.

supported_conditions()

List reference conditions with the imputation mode (observed, imputed_supported, or imputed_exploratory) of each output type.

observed_metadata()

Get the metadata for tracks observed during training.

DNA output#

models.v2.dna_output.OutputType(value)

Enumeration of all the available types of outputs.

models.v2.dna_output.Output([atac, cage, ...])

Model outputs for a single prediction.

models.v2.dna_output.OutputMetadata([atac, ...])

Metadata detailing the content of model output.

models.v2.dna_output.VariantOutput(...)

Model outputs for a variant prediction.

models.v2.dna_output.TargetGeneMetadata(...)

Metadata for a single target gene.

models.v2.dna_output.InputGradientsOutput(...)

Model outputs for an input sequence gradient prediction.

Conditions#

Reference conditions (condition=) are built with model_condition; expression conditioning inputs (cell_conditioning=) are prepared with gene_counts_condition.

models.v2.model_condition.ModelCondition([...])

Metadata describing the type of a model condition.

models.v2.model_condition.from_curies(...)

Get a ModelCondition from a list of ontology curies.

models.v2.gene_counts_condition.from_anndata(adata)

Converts AnnData rows to a CellConditioningInput proto.

models.v2.gene_counts_condition.subsample(...)

Subsamples an AnnData object into a mapping of condition label to AnnData.

Variant scorers#

models.v2.variant_scorers.AggregationType(value)

Enum indicating the type of variant scorer aggregation.

models.v2.variant_scorers.BaseVariantScorer(value)

Enum indicating the type of variant scoring.

models.v2.variant_scorers.CenterMaskScorer(...)

Variant scorer for center mask scorers.

models.v2.variant_scorers.ContactMapScorer()

Variant scorer for contact map scorers.

models.v2.variant_scorers.GeneMaskLFCScorer(...)

Variant scorer for gene-mask log fold change scoring.

models.v2.variant_scorers.GeneMaskActiveScorer(...)

Variant scorer for gene-mask active allele scoring.

models.v2.variant_scorers.GeneMaskSplicingScorer(...)

Variant scorer for gene-mask scoring for splicing.

models.v2.variant_scorers.MethylationScorer(width)

Variant scorer for CpG methylation.

models.v2.variant_scorers.PolyadenylationScorer()

Variant scorer for polyadenylation QTLs (paQTLs).

models.v2.variant_scorers.SpliceJunctionScorer()

Variant scorer for splice junction scoring.

models.v2.variant_scorers.get_recommended_scorers(...)

Returns the recommended variant scorers for a given organism.

models.v2.variant_scorers.tidy_anndata(adata)

Formats an AnnData score as a tidy DataFrame.

models.v2.variant_scorers.tidy_scores(scores)

Formats scores into a tidy (long) pandas DataFrame.

alphagenome.models.v2.variant_scorers.RECOMMENDED_VARIANT_SCORERS#

Immutable mapping from a short name (e.g. 'RNA_SEQ', 'ATAC', 'SC_GENE_EXPRESSION_DENOISED', 'SC_GENE_EXPRESSION') to a variant scorer configured with our recommended settings for that output type. Each output type has a log-fold-change style scorer and, where applicable, an _ACTIVE variant that scores absolute activity. Use get_recommended_scorers() to get the subset supported for a given organism and request type.

alphagenome.models.v2.variant_scorers.VariantScorerTypes: TypeAlias#

Union type alias of supported AlphaGenome 2 variant scorer configurations.

Interval scorers#

models.v2.interval_scorers.IntervalAggregationType(value)

Enum indicating the type of interval scorer aggregation.

models.v2.interval_scorers.BaseIntervalScorer(value)

Enum indicating the type of interval scoring.

models.v2.interval_scorers.GeneMaskScorer(...)

Interval scorer for gene-mask scoring.

alphagenome.models.v2.interval_scorers.IntervalScorerTypes#

Union type alias of supported AlphaGenome 2 interval scorer configurations.