score_sequence
Compute log probabilities for a DNA sequence using the Evo 2 model. Returns the model's likelihood score for the sequence with mean or sum aggregation.
Instructions
Compute log probabilities for DNA sequence under Evo 2 model.
Evaluates the likelihood of a DNA sequence under the Evo 2 language model. Returns the model's log probability score for the entire sequence, which can be reduced using either mean or sum aggregation.
Args:
sequence: DNA sequence to score. Should contain standard IUPAC nucleotides (A, C, G, T, N).
checkpoint: Model checkpoint identifier. If None, uses the default checkpoint.
See list_available_checkpoints() for available options.
reduce_method: Method for aggregating per-token scores. Must be either "mean"
(average log probability across all tokens) or "sum" (sum of all log probabilities).
Returns: Dictionary containing: - checkpoint: The checkpoint identifier used - sequence: The normalized input sequence - reduce_method: The reduction method applied - scores: List of computed score values (typically length 1)
Raises: AssertionError: If sequence is empty or reduce_method is not "mean" or "sum".
Example: >>> scores = score_sequence("ATCGATCG") >>> print(f"Score: {scores['scores'][0]}")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sequence | Yes | ||
| checkpoint | No | ||
| reduce_method | No | mean |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||