ovo.core.logic.design_logic¶
Module Contents¶
Functions¶
Get pandas DataFrame with job and pool metadata and workflow parameter information. |
|
Get pandas DataFrame with workflow parameter information for each pool. |
|
Submit a design workflow to the scheduler and create a Pool and DesignJob in the DB. |
|
Get the log of a design job from the scheduler. |
|
Get design job tasks table from the scheduler. |
|
Process the results of a design job and return the pool object. |
|
Update the accepted designs in a pool based on the given acceptance thresholds. |
|
Update the accepted field of designs based on the given thresholds (does not save to DB) |
|
Collect storage paths from designs based on fields returned by DesignWorkflow.get_download_fields(). |
|
Create Design objects from a DataFrame. |
|
Get chain IDs that exist across all provided designs’ specs |
API¶
- ovo.core.logic.design_logic.get_design_jobs_table(project_id: str = None, round_ids: list[str] = None, update=True, **pool_filters) pandas.DataFrame¶
Get pandas DataFrame with job and pool metadata and workflow parameter information.
- ovo.core.logic.design_logic.get_pools_table(project_id: str = None, round_ids: list[str] = None)¶
- ovo.core.logic.design_logic.format_pool_status(job: ovo.core.database.models.DesignJob, processed: bool, update_status: bool = True)¶
- ovo.core.logic.design_logic.get_workflows_table(jobs: list[ovo.core.database.models.DesignJob])¶
Get pandas DataFrame with workflow parameter information for each pool.
- ovo.core.logic.design_logic.submit_design_workflow(workflow: ovo.core.database.models.Workflow, scheduler_key: str, round_id: str, pool_name: str, pool_description: str, return_existing: bool = True, pipeline_name: str = None, resume_failed: bool = False, submission_args: dict = None) tuple[ovo.core.database.models.DesignJob, ovo.core.database.models.Pool]¶
Submit a design workflow to the scheduler and create a Pool and DesignJob in the DB.
- Parameters:
workflow – Workflow object to submit
scheduler_key – Key of the scheduler to use
round_id – ID of the Round to associate the Pool with
pool_name – Name of the Pool to create
pool_description – Description of the Pool to create
return_existing – If a Pool with the same name and parameters already exists in this round, return it instead of raising an error
pipeline_name – Override the pipeline name to submit, e.g. ovo.rfdiffusion-end-to-end or a github url with @version
resume_failed – If a Pool with the same name already exists in this round but its job has failed, submit the job again.
submission_args – Extra submission arguments to override in the scheduler, e.g. {“profile”: “conda”} or {“stub”: True}
- Returns:
Tuple of (DesignJob, Pool)
- ovo.core.logic.design_logic.get_log(design_job: ovo.core.database.models.DesignJob, task_id: str = None, preview: bool = False, tail: int = None) str¶
Get the log of a design job from the scheduler.
- ovo.core.logic.design_logic.get_tasks(design_job: ovo.core.database.models.DesignJob) pandas.DataFrame¶
Get design job tasks table from the scheduler.
- ovo.core.logic.design_logic.process_results(design_job: ovo.core.database.models.DesignJob, callback: Callable = None, wait=True) ovo.core.database.models.Pool¶
Process the results of a design job and return the pool object.
This downloads/copies the workflow results into Storage and saves the Design and DescriptorValue objects to the database.
- ovo.core.logic.design_logic.update_acceptance_thresholds(pools: list[ovo.core.database.models.Pool], acceptance_thresholds: dict[str, ovo.core.database.models.Threshold])¶
Update the accepted designs in a pool based on the given acceptance thresholds.
Save the Design objects and the DesignJob.workflow.acceptance_thresholds to the DB.
- ovo.core.logic.design_logic.update_accepted_design_ids(pool_ids: list[str], accepted_design_ids: list[str])¶
- ovo.core.logic.design_logic.set_designs_accepted(designs: list[ovo.core.database.models.Design], descriptor_values: list[ovo.core.database.models.DescriptorValue], job: ovo.core.database.models.DesignJob, no_warning_for_missing_prefix: str | tuple = None)¶
Update the accepted field of designs based on the given thresholds (does not save to DB)
Makes the following modifications IN PLACE:
If a threshold is enabled but its descriptor values are missing:
set threshold.enabled to False
add a warning in the DesignJob job.warnings
Update the accepted field of each design based on whether it passes the thresholds or not.
- Parameters:
designs – List of Design objects to update
descriptor_values – List of DescriptorValue objects to use for checking thresholds
job – DesignJob object
no_warning_for_missing_prefix – Do not add a warning for missing descriptor keys that start with this prefix/prefixes
- ovo.core.logic.design_logic.collect_storage_paths(download_fields: dict[str, tuple[ovo.core.database.models.Base, str]], design_ids: list) list[str]¶
Collect storage paths from designs based on fields returned by DesignWorkflow.get_download_fields().
- ovo.core.logic.design_logic.create_designs_from_dataframe(df: pandas.DataFrame, id_column: str, column_chains: dict[str, str], pool_id: str) list[ovo.core.database.models.Design]¶
Create Design objects from a DataFrame.
Args: df: pandas DataFrame with design data id_column: column name to use as design ID column_chains: mapping of column names to chain IDs (e.g., {“seq_A”: “A”, “seq_B”: “B”}) pool_id: pool ID for the designs
Returns: list of Design objects
- ovo.core.logic.design_logic.create_designs_from_structure_files(structure_files: list, chains: list[str], pool: ovo.core.database.models.Pool, project_id: str) tuple[list[ovo.core.database.models.Design], list[str]]¶
- ovo.core.logic.design_logic.get_common_chain_ids(design_ids: list[str]) tuple[list[str], list[str]]¶
Get chain IDs that exist across all provided designs’ specs