openprotein.design#

Design new sequences based on your stated objectives and our genetic algorithm!

class openprotein.design.DesignAPI[source]#

Design API providing the interface to design novel proteins based on your design criteria.

__init__(session)[source]#
Parameters:

session (APISession)

list_designs()[source]#

List all designs.

Returns:

A list of DesignFuture objects representing all designs.

Return type:

list of DesignFuture

get_design(design_id)[source]#

Retrieve a specific design by its ID.

Parameters:

design_id (str) – ID of the design to retrieve.

Returns:

A future object representing the design job and its results.

Return type:

DesignFuture

create_genetic_algorithm_design(assay, criteria, num_steps=25, pop_size=1024, n_offsprings=5120, crossover_prob=1.0, crossover_prob_pointwise=0.2, mutation_average_mutations_per_seq=1, allowed_tokens={})[source]#

Start a protein design job using a genetic algorithm based on assay data, a trained ML model, and specified criteria.

Parameters:
  • assay (AssayDataset) – The AssayDataset to design from.

  • criteria (Criteria or Subcriterion or Criterion) – Criteria for evaluating the design.

  • num_steps (int, optional) – The number of steps in the genetic algorithm. Default is 25.

  • pop_size (int, optional) – The population size for the genetic algorithm. Default is 1024.

  • n_offsprings (int, optional) – The number of offspring for the genetic algorithm. Default is 5120.

  • crossover_prob (float, optional) – The crossover probability for the genetic algorithm. Default is 1.0.

  • crossover_prob_pointwise (float, optional) – The pointwise crossover probability for the genetic algorithm. Default is 0.2.

  • mutation_average_mutations_per_seq (int, optional) – The average number of mutations per sequence. Default is 1.

  • allowed_tokens (DesignConstraint or dict of int to list of str, optional) – A dict of positions and allowed tokens (e.g. {1: [‘G’, ‘L’]}) designating how mutations may occur. Defaults to empty dict.

Returns:

A future object representing the design job and its results.

Return type:

DesignFuture

class openprotein.design.DesignFuture[source]#

A future object that will hold the results of the design job.

__init__(session, job=None, metadata=None)[source]#

Construct a future for a design job.

Takes in either a design job, or the design metadata.

Parameters:
  • session (APISession)

  • job (DesignJob | None)

  • metadata (Design | None)

property id#

ID of the design.

property assay: AssayDataset#

Assay used in the design.

property algorithm: DesignAlgorithm#

Algorithm used in the design.

property criteria: Criteria#

Criteria used in the design.

property num_steps#

Number of steps used in the design.

property num_rows#

Number of rows in the total design output (across all steps).

property allowed_tokens: dict[str, list[str]] | None#

Allowed tokens used in the design.

property pop_size: int#

Population size used in the design.

property n_offsprings: int#

Number of offsprings used in the design.

property crossover_prob: float#

Crossover probability used in the design.

property crossover_prob_pointwise: float#

Crossover probability pointwise used in the design.

property mutation_average_mutations_per_seq: int#

Average mutations per sequence used in the design.

property metadata#

Design metadata.

stream(step=None)[source]#

Return the results from this job as a generator.

Parameters:

step (int | None)

Return type:

Iterator[DesignResult]

get(verbose=False, **kwargs)[source]#

Return the results from this job.

Parameters:

verbose (bool)

Return type:

list[DesignResult]

get_assay()[source]#

Get assay used for design job.

Returns:

Assay dataset used for design.

Return type:

AssayDataset