openprotein.api.design#

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

class openprotein.api.design.DesignAPI[source]#

interface for calling Design endpoints

__init__(session)[source]#
Parameters:

session (APISession)

create_design_job(design_job)[source]#

Start a protein design job based on your assaydata, a trained ML model and Criteria (specified here).

Parameters:

design_job (DesignJobCreate) – The details of the design job to be created, with the following parameters: - assay_id: The ID for the assay. - criteria: A list of CriterionItem lists for evaluating the design. - num_steps: The number of steps in the genetic algo. Default is 8. - pop_size: The population size for the genetic algo. Default is None. - n_offsprings: The number of offspring for the genetic algo. Default is None. - crossover_prob: The crossover probability for the genetic algo. Default is None. - crossover_prob_pointwise: The pointwise crossover probability for the genetic algo. Default is None. - mutation_average_mutations_per_seq: The average number of mutations per sequence. Default is None. - allowed_tokens: A dict of positions and allows tokens (e.g. {1:[‘G’,’L’]}) ) designating how mutations may occur. Default is None.

Returns:

The created job as a DesignFuture instance.

Return type:

DesignFuture

get_design_results(job_id, step=None, page_size=None, page_offset=None)[source]#

Retrieves the results of a Design job.

Parameters:
  • job_id (str) – The ID for the design job

  • step (int) – The design step to retrieve, if None: retrieve all.

  • page_size (Optional[int], default is None) – The number of results to be returned per page. If None, all results are returned.

  • page_offset (Optional[int], default is None) – The number of results to skip. If None, defaults to 0.

Returns:

The job object representing the Design job.

Return type:

DesignJob

Raises:

HTTPError – If the GET request does not succeed.

class openprotein.api.design.DesignFuture[source]#

Future Job for manipulating results

__init__(session, job, page_size=1000)[source]#
Parameters:
get(step=None, verbose=False)[source]#

Get all the results of the design job.

Parameters:
  • verbose (bool, optional) – If True, print verbose output. Defaults False.

  • step (int | None)

Raises:

APIError – If there is an issue with the API request.

Returns:

A list of predict objects representing the results.

Return type:

List