openprotein.design#
Design new sequences based on your stated objectives and our genetic algorithm!
- class openprotein.design.DesignAPI[source]#
Interface for calling Designer endpoints
- __init__(session)[source]#
- Parameters:
session (APISession)
- list_designs()[source]#
List designs.
- Return type:
list[DesignFuture]
- get_design(design_id)[source]#
Get design.
- Parameters:
design_id (str) – ID of 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 based on your assaydata, a trained ML model and Criteria (specified here).
- Parameters:
assay (AssayDataset) – The AssayDataset to design from.
criteria (Criteria | Subcriterion | Criterion) – Criteria for evaluating the design. Use documentation for syntactic sugar to easily create.
num_steps (int) – The number of steps in the genetic algo. Default is 8.
pop_size (int) – The population size for the genetic algo. Default is 1024.
n_offsprings (int) – The number of offspring for the genetic algo. Default is 5120.
crossover_prob (float) – The crossover probability for the genetic algo. Default is 1.0.
crossover_prob_pointwise (float) – The pointwise crossover probability for the genetic algo. Default is 0.2.
mutation_average_mutations_per_seq (int) – The average number of mutations per sequence. Default is 1.
allowed_tokens (DesignConstraint | dict[int, list[str]]) – A dict of positions and allows 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:
- 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:
Generator