crested.tl.predict

Contents

crested.tl.predict#

crested.tl.predict(input, model, genome=None, **kwargs)#

Make predictions using the model(s) some input that represents sequences.

If a list of models is provided, the predictions will be averaged across all models.

Parameters:
  • input (str | list[str] | np.array | AnnData) – Input data to make predictions on. Can be a (list of) sequence(s), a (list of) region name(s), a matrix of one hot encodings (N, L, 4), or an AnnData object with region names as its var_names.

  • model (keras.Model | list[keras.Model]) – A (list of) trained keras model(s) to make predictions with.

  • genome (Genome | os.PathLike | None (default: None)) – Genome or path to the genome file. Required if no genome is registered and input is an anndata object or region names.

  • **kwargs – Additional keyword arguments to pass to the keras.Model.predict method.

Return type:

None | np.ndarray

Returns:

Predictions of shape (N, C)

Example

>>> my_sequences = ["ACGT", "CGTA", "GTAC"]
>>> predictions = predict(
...     input=my_sequences,
...     model=my_trained_model,
... )