"""Constants for the nanobody design project.""" from pathlib import Path from virtual_lab.agent import Agent from virtual_lab.prompts import SCIENTIFIC_CRITIC # Meetings constants num_iterations = 5 num_rounds = 3 # Models model = "gpt-4o-2024-08-06" model_mini = "gpt-4o-mini-2024-07-18" # Discussion paths discussions_dir = Path("discussions") workflow_phases = [ "team_selection", "project_specification", "tools_selection", "implementation_agent_selection", "esm", "alphafold", "rosetta", "workflow_design", ] ablations_phases = ["ablations"] human_eval_phases = ["human_eval"] finetuning_phases = ["finetuning"] review_phases = ["unpaired_cysteine"] phases = workflow_phases + ablations_phases + human_eval_phases + finetuning_phases + review_phases discussions_phase_to_dir = {phase: discussions_dir / phase for phase in phases} # Prompts background_prompt = "You are working on a research project to use machine learning to develop antibodies or nanobodies for the newest variant of the SARS-CoV-2 spike protein that also, ideally, have activity against other circulating minor variants and past variants." nanobody_prompt = "Your team previous decided to modify existing nanobodies to improve their binding to the newest variant of the SARS-CoV-2 spike protein." experimental_results_prompt = """Your team has designed 92 mutated nanobodies (23 each for the wild-type nanobodies H11-D4, Nb21, Ty1, and VHH-72) to improve their binding to the KP.3 variant of the SARS-CoV-2 spike protein receptor binding domain (RBD). Each nanobody has 1-4 mutations relative to the wild-type nanobody. Your team used ESM log-likelihood ratios (ESM LLR) to score the nanobody mutations independent of the antigen, AlphaFold-Multimer to predict the structure of the mutated nanobody in complex with the KP.3 RBD and compute the interface pLDDT (AF ipLDDT) as a metric of binding confidence, and Rosetta to calculate the binding energy of the mutated nanobody in complex with the KP.3 RBD (RS dG) based on the AlphaFold-Multimer predicted structure followed by a Rosetta relaxation. You have ranked the mutant nanobodies and selected the top ones using a weighted score of WS = 0.2 * (ESM LLR) + 0.5 * (AF ipLDDT) - 0. 3 * (RS dG). The 92 selected nanobodies were tested along with the four wild-type nanobodies using an ELISA assay to measure binding to the Wuhan, JN.1, KP.3, KP2.3, and BA.2 strains of the SARS-CoV-2 spike RBD. Note that the JN.1 strain is closely related to KP.3 and KP2.3. BSA was used as a negative control. Most of the mutated nanobodies showed at least moderate expression levels. The ELISA results are as follows: H11-D4: The wild-type only binds to the Wuhan RBD. Most mutants show binding to the Wuhan RBD as well, including one with a higher binding level than the wild-type. However, that mutant and two others bind non-specifically to the negative control BSA along with other strains of the SARS-CoV-2 RBD. No mutant nanobody shows specific binding to any strain other than the Wuhan RBD. Nb21: The wild-type only binds to the Wuhan RBD. All mutant nanobodies also bind to the Wuhan RBD. There are no non-specific binders. One mutant nanobody with mutations I77V, L59E, Q87A, and R37Q binds to the Wuhan RBD (strong binding), the JN.1 RBD (moderate binding), and the KP.3 RBD (weak binding). Thus, this mutant introduces specific binding to JN.1 and KP.3 that the wild-type does not possess, and it increases binding to the Wuhan RBD. Ty1: The wild-type only binds to the Wuhan RBD. Many mutant nanobodies do not show binding, but several show moderate binding to the Wuhan RBD. One mutant nanobody with mutations V32F, G59D, N45S, and F32S binds to the Wuhan RBD (strong binding) and the JN.1 RBD (moderate binding). This mutant introduces specific binding to JN.1 that the wild-type does not possess, and it increases binding to the Wuhan RBD. Additionally, there are is one mutant with weak, non-specific binding to BSA and other RBD strains. VHH-72: The wild-type only binds to the Wuhan RBD. Most mutants show binding to the Wuhan RBD as well, including several with a higher binding level than the wild-type. Two mutant nanobodies bind non-specifically to BSA and several RBD strains. No mutant nanobody shows specific binding to any strain other than the Wuhan RBD.""" # Set up agents # Generic agent generic_agent = Agent( title="Assistant", expertise="helping people with their problems", goal="help people with their problems", role="help people with their problems", model=model, ) # Generic team lead generic_team_lead = Agent( title=f"{generic_agent.title} Lead", expertise=generic_agent.expertise, goal=generic_agent.goal, role=generic_agent.role, model=model, ) # Generic team generic_team = [ Agent( title=f"{generic_agent.title} {i}", expertise=generic_agent.expertise, goal=generic_agent.goal, role=generic_agent.role, model=model, ) for i in range(1, 5) ] # Team lead principal_investigator = Agent( title="Principal Investigator", expertise="applying artificial intelligence to biomedical research", goal="perform research in your area of expertise that maximizes the scientific impact of the work", role="lead a team of experts to solve an important problem in artificial intelligence for biomedicine, make key decisions about the project direction based on team member input, and manage the project timeline and resources", model=model, ) # Scientific critic scientific_critic = SCIENTIFIC_CRITIC # Specialized science agents immunologist = Agent( title="Immunologist", expertise="antibody engineering and immune response characterization", goal="guide the development of antibodies/nanobodies that elicit a strong and broad immune response", role="advise on immunogenicity, cross-reactivity with other variants, and potential for therapeutic application, ensuring the designs are viable for experimental validation and downstream applications", model=model, ) machine_learning_specialist = Agent( title="Machine Learning Specialist", expertise="developing algorithms for protein-ligand interactions and optimization", goal="create and apply machine learning models to predict antibody efficacy and optimize binding affinity across SARS-CoV-2 variants", role="lead the development of AI tools for predicting interactions and refining antibody designs based on computational results", model=model, ) computational_biologist = Agent( title="Computational Biologist", expertise="protein structure prediction and molecular dynamics simulations", goal="develop predictive models to identify potential antibody/nanobody candidates and simulate interactions with the SARS-CoV-2 spike protein", role="provide insights into structural dynamics, guide virtual screening efforts, and validate computational predictions with simulations", model=model, ) # Team members team_members = ( immunologist, machine_learning_specialist, computational_biologist, scientific_critic, )