predict_interval_gradients_batch

predict_interval_gradients_batch#

DnaClient.predict_interval_gradients_batch(gene_ids, *, organism=Organism.HOMO_SAPIENS, requested_output, sequence_length, conditions=None, cell_conditionings=None, cell_condition_names=None, progress_bar=True, max_workers=5)[source]#

Generate input gradients for a batch of genes and/or conditions.

Parameters:
  • gene_ids (str | Sequence[str]) – Single Ensembl gene ID (broadcast across conditions) or a sequence of Ensembl gene IDs.

  • organism (Organism (default: <Organism.HOMO_SAPIENS: 9606>)) – Organism to use for the predictions.

  • requested_output (OutputType) – Output type to compute gradients for.

  • sequence_length (int) – Width of the input interval. Must be dna_client.SEQUENCE_LENGTH_100KB or dna_client.SEQUENCE_LENGTH_1MB.

  • conditions (Sequence[ModelCondition | str] | None (default: None)) – Optional sequence of conditions or composite curies.

  • cell_conditionings (Sequence[AnnData] | None (default: None)) – Optional sequence of expression conditioning inputs (AnnData).

  • cell_condition_names (Sequence[str] | None (default: None)) – Optional sequence of labels for expression conditioning. When provided, output track names are suffixed with each label. Must be provided when cell_conditionings is used.

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

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

Return type:

list[InputGradientsOutput]

Returns:

List of InputGradientsOutput objects in request order.

Raises:
  • TypeError – If conditions or cell_condition_names is passed as a bare str instead of a sequence of strings.

  • ValueError – If any provided sequence length does not match the number of requests.