openprotein.design#
Design new sequences based on your stated objectives and our genetic algorithm!
Interface#
- class openprotein.design.DesignAPI(session)[source]#
- Design API providing the interface to design novel proteins based on your design criteria. - 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:
 
 - 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:
 
 
Results#
- class openprotein.design.DesignFuture(session, job=None, metadata=None)[source]#
- A future object that will hold the results of the design job. - Parameters:
- session (APISession) 
- job (DesignJob) 
- 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:
- **kwargs – Keyword arguments passed to the streaming implementation. 
- step (int | None) 
 
- Returns:
- A generator that yields job results. 
- Return type:
- Generator 
- Raises:
- NotImplementedError – This is an abstract method and must be implemented by a subclass. 
 
 - get(verbose=False, **kwargs)[source]#
- Return all results from the job by consuming the stream. - Parameters:
- verbose (bool, optional) – If True, display a progress bar. Defaults to False. 
- **kwargs – Keyword arguments passed to the stream method. 
 
- Returns:
- A list containing all results from the job. 
- Return type:
- list