From d81106a7902f4c076a34f5ab5d3b427893aa7151 Mon Sep 17 00:00:00 2001 From: vladsaveliev Date: Fri, 26 Sep 2025 13:08:26 +0200 Subject: [PATCH 1/3] Update API version --- biomni/llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biomni/llm.py b/biomni/llm.py index 61747b685..878ba8739 100644 --- a/biomni/llm.py +++ b/biomni/llm.py @@ -111,7 +111,7 @@ def get_llm( raise ImportError( # noqa: B904 "langchain-openai package is required for Azure OpenAI models. Install with: pip install langchain-openai" ) - API_VERSION = "2024-12-01-preview" + API_VERSION = "2025-04-01-preview" model = model.replace("azure-", "") return AzureChatOpenAI( openai_api_key=os.getenv("OPENAI_API_KEY"), From bcf8e8535c1badd4e6a14ac056b9e7e9128f51e2 Mon Sep 17 00:00:00 2001 From: vladsavelyev Date: Mon, 29 Sep 2025 11:53:10 +0200 Subject: [PATCH 2/3] Adjust for OpenAI --- biomni/agent/a1.py | 27 +++++++++++-- biomni/tool/bioengineering.py | 8 +++- biomni/tool/cancer_biology.py | 2 +- biomni/tool/cell_biology.py | 8 ++-- biomni/tool/genomics.py | 12 +++--- .../tool/tool_description/bioengineering.py | 18 +++++---- biomni/tool/tool_description/cell_biology.py | 2 +- biomni/tool/tool_description/database.py | 4 +- biomni/tool/tool_description/genomics.py | 6 +-- biomni/tool/tool_description/microbiology.py | 12 +++--- .../tool_description/molecular_biology.py | 12 +++--- biomni/tool/tool_description/pathology.py | 2 +- biomni/tool/tool_description/pharmacology.py | 38 +++++++++---------- biomni/tool/tool_description/physiology.py | 2 +- .../tool_description/synthetic_biology.py | 2 +- 15 files changed, 92 insertions(+), 63 deletions(-) diff --git a/biomni/agent/a1.py b/biomni/agent/a1.py index c69d5230d..39599d6c5 100644 --- a/biomni/agent/a1.py +++ b/biomni/agent/a1.py @@ -1879,19 +1879,38 @@ def wrapper(**kwargs) -> dict: # Map your types to Python types type_map = {"str": str, "int": int, "float": float, "bool": bool, "List[str]": list[str], "dict": dict} + def get_python_type(param_info): + """Convert Biomni schema type to Python type.""" + param_type_str = param_info["type"] + + # Handle array types with proper items inspection + if param_type_str == "array" and "items" in param_info: + items_type = param_info["items"]["type"] + if items_type == "string": + return list[str] + elif items_type == "number": + return list[float] + elif items_type == "integer": + return list[int] + elif items_type == "boolean": + return list[bool] + else: + return list[str] # default to string list + + # Handle regular types + return type_map.get(param_type_str, str) + # Add required parameters for param_info in required_params: param_name = param_info["name"] - param_type_str = param_info["type"] - param_type = type_map.get(param_type_str, str) + param_type = get_python_type(param_info) new_params.append(inspect.Parameter(param_name, inspect.Parameter.KEYWORD_ONLY, annotation=param_type)) # Add optional parameters for param_info in optional_params: param_name = param_info["name"] - param_type_str = param_info["type"] - param_type = type_map.get(param_type_str, str) + param_type = get_python_type(param_info) # Make it optional optional_type = param_type | None diff --git a/biomni/tool/bioengineering.py b/biomni/tool/bioengineering.py index e2263ca12..5da865097 100644 --- a/biomni/tool/bioengineering.py +++ b/biomni/tool/bioengineering.py @@ -1,3 +1,5 @@ +from typing import List + def analyze_cell_migration_metrics( image_sequence_path, pixel_size_um=1.0, @@ -231,7 +233,11 @@ def analyze_cell_migration_metrics( return log.strip() -def perform_crispr_cas9_genome_editing(guide_rna_sequences, target_genomic_loci, cell_tissue_type): +def perform_crispr_cas9_genome_editing( + guide_rna_sequences: List[str], + target_genomic_loci: str, + cell_tissue_type: str +) -> str: """Simulates CRISPR-Cas9 genome editing process including guide RNA design, delivery, and analysis. Parameters diff --git a/biomni/tool/cancer_biology.py b/biomni/tool/cancer_biology.py index c512bbea1..a4d0251a5 100644 --- a/biomni/tool/cancer_biology.py +++ b/biomni/tool/cancer_biology.py @@ -265,7 +265,7 @@ def analyze_ddr_network_in_cancer(expression_data_path, mutation_data_path, outp return research_log -def analyze_cell_senescence_and_apoptosis(fcs_file_path): +def analyze_cell_senescence_and_apoptosis(fcs_file_path: str) -> str: """Analyze flow cytometry data to quantify senescent and apoptotic cell populations. Parameters diff --git a/biomni/tool/cell_biology.py b/biomni/tool/cell_biology.py index 88aca18ef..deff543de 100644 --- a/biomni/tool/cell_biology.py +++ b/biomni/tool/cell_biology.py @@ -1,4 +1,6 @@ -def quantify_cell_cycle_phases_from_microscopy(image_paths, output_dir="./results"): +from typing import List + +def quantify_cell_cycle_phases_from_microscopy(image_paths: List[str], output_dir: str = "./results") -> str: """Quantify the percentage of cells in each cell cycle phase using Calcofluor white stained microscopy images. This function processes microscopy images where cell walls/septa are stained with Calcofluor white, @@ -159,7 +161,7 @@ def quantify_cell_cycle_phases_from_microscopy(image_paths, output_dir="./result return log -def quantify_and_cluster_cell_motility(image_sequence_path, output_dir="./results", num_clusters=3): +def quantify_and_cluster_cell_motility(image_sequence_path: str, output_dir: str = "./results", num_clusters: int = 3) -> str: """Quantify cell motility features from time-lapse microscopy images and cluster cells based on motility patterns. Parameters @@ -571,7 +573,7 @@ def analyze_flow_cytometry_immunophenotyping( return log -def analyze_mitochondrial_morphology_and_potential(morphology_image_path, potential_image_path, output_dir="./output"): +def analyze_mitochondrial_morphology_and_potential(morphology_image_path: str, potential_image_path: str, output_dir: str = "./output") -> str: """Quantifies metrics of mitochondrial morphology and membrane potential from fluorescence microscopy images. Parameters diff --git a/biomni/tool/genomics.py b/biomni/tool/genomics.py index 7d19a9ad4..b74c8ecfa 100644 --- a/biomni/tool/genomics.py +++ b/biomni/tool/genomics.py @@ -798,7 +798,7 @@ def create_panhumanpy_env(env_name): # === Integration === -def create_scvi_embeddings_scRNA(adata_filename, batch_key, label_key, data_dir): +def create_scvi_embeddings_scRNA(adata_filename: str, batch_key: str, label_key: str, data_dir: str) -> str: # Import scvi-tools correctly - the package name is still 'scvi' when installed try: import scvi @@ -839,7 +839,7 @@ def create_scvi_embeddings_scRNA(adata_filename, batch_key, label_key, data_dir) return "\n".join(steps) -def create_harmony_embeddings_scRNA(adata_filename, batch_key, data_dir): +def create_harmony_embeddings_scRNA(adata_filename: str, batch_key: str, data_dir: str) -> str: # https://pypi.org/project/harmony-pytorch/ from harmony import harmonize @@ -911,7 +911,7 @@ def get_uce_embeddings_scRNA( return "\n".join(steps) -def map_to_ima_interpret_scRNA(adata_filename, data_dir, custom_args=None): +def map_to_ima_interpret_scRNA(adata_filename: str, data_dir: str, custom_args=None) -> str: """Map cell embeddings from the input dataset to the Integrated Megascale Atlas reference dataset using UCE embeddings.""" from sklearn.neighbors import NearestNeighbors @@ -1088,7 +1088,7 @@ def gene_set_enrichment_analysis( return f"An error occurred: {e}" -def analyze_chromatin_interactions(hic_file_path, regulatory_elements_bed, output_dir="./output"): +def analyze_chromatin_interactions(hic_file_path: str, regulatory_elements_bed: str, output_dir: str = "./output") -> str: """Analyze chromatin interactions from Hi-C data to identify enhancer-promoter interactions and TADs. Parameters @@ -1421,7 +1421,7 @@ def get_matrix(chrom, balance_if_possible=True): return "\n".join(log) -def analyze_comparative_genomics_and_haplotypes(sample_fasta_files, reference_genome_path, output_dir="./output"): +def analyze_comparative_genomics_and_haplotypes(sample_fasta_files: str, reference_genome_path: str, output_dir: str = "./output") -> str: """Perform comparative genomics and haplotype analysis on multiple genome samples. This function aligns multiple genome samples to a reference, identifies variants, @@ -1962,7 +1962,7 @@ def find_enriched_motifs_with_homer( return log -def analyze_genomic_region_overlap(region_sets, output_prefix="overlap_analysis"): +def analyze_genomic_region_overlap(region_sets: str, output_prefix: str = "overlap_analysis") -> str: """Analyze overlaps between two or more sets of genomic regions. Parameters diff --git a/biomni/tool/tool_description/bioengineering.py b/biomni/tool/tool_description/bioengineering.py index a6dc862e0..6bd8105a9 100644 --- a/biomni/tool/tool_description/bioengineering.py +++ b/biomni/tool/tool_description/bioengineering.py @@ -49,7 +49,8 @@ "nucleotides each) targeting the " "genomic region of interest", "name": "guide_rna_sequences", - "type": "List[str]", + "type": "array", + "items": {"type": "string"}, }, { "default": None, @@ -120,13 +121,13 @@ "default": None, "description": "Time points at which drug concentrations were measured (in hours)", "name": "time_points", - "type": "List[float] or numpy.ndarray", + "type": "array", "items": {"type": "number"}, }, { "default": None, "description": "Measured drug concentration at each time point", "name": "concentration_data", - "type": "List[float] or numpy.ndarray", + "type": "array", "items": {"type": "number"}, }, ], }, @@ -192,13 +193,13 @@ "default": None, "description": "Neural spiking activity data, shape (n_timepoints, n_neurons)", "name": "neural_data", - "type": "numpy.ndarray", + "type": "array", }, { "default": None, "description": "Behavioral data, shape (n_timepoints, n_behavioral_variables)", "name": "behavioral_data", - "type": "numpy.ndarray", + "type": "array", }, ], }, @@ -216,13 +217,14 @@ "simple example whole-cell model " "will be used.", "name": "ode_function", - "type": "callable", + "type": "object", }, { "default": "(0, 100)", "description": "Tuple of (start_time, end_time) for the simulation.", "name": "time_span", - "type": "tuple", + "type": "array", + "items": {"type": "number"}, }, { "default": 1000, @@ -247,7 +249,7 @@ "If array-like, order must match the " "order expected by the ODE function.", "name": "initial_conditions", - "type": "dict or array-like", + "type": "object", }, { "default": None, diff --git a/biomni/tool/tool_description/cell_biology.py b/biomni/tool/tool_description/cell_biology.py index 5d51a22c5..4ed9188d7 100644 --- a/biomni/tool/tool_description/cell_biology.py +++ b/biomni/tool/tool_description/cell_biology.py @@ -16,7 +16,7 @@ "default": None, "description": "List of file paths to microscopy images of cells stained with Calcofluor white", "name": "image_paths", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, } ], }, diff --git a/biomni/tool/tool_description/database.py b/biomni/tool/tool_description/database.py index 2b875f5c6..f61f84852 100644 --- a/biomni/tool/tool_description/database.py +++ b/biomni/tool/tool_description/database.py @@ -141,7 +141,7 @@ "default": None, "description": "List of specific attributes to retrieve", "name": "attributes", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], "required_parameters": [ @@ -149,7 +149,7 @@ "default": None, "description": "List of PDB identifiers to query", "name": "identifiers", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, } ], }, diff --git a/biomni/tool/tool_description/genomics.py b/biomni/tool/tool_description/genomics.py index 564f2f1e3..2eeeaa845 100644 --- a/biomni/tool/tool_description/genomics.py +++ b/biomni/tool/tool_description/genomics.py @@ -165,7 +165,7 @@ "default": None, "description": "Custom command line arguments to pass to the UCE script", "name": "custom_args", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], "required_parameters": [ @@ -329,7 +329,7 @@ "default": None, "description": "Paths to FASTA files containing whole-genome sequences to be analyzed", "name": "sample_fasta_files", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, @@ -650,7 +650,7 @@ "default": None, "description": "List of Ensembl gene IDs (e.g., ['ENSG00000012048', 'ENSG00000012049'])", "name": "ensembl_gene_ids", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, } ], }, diff --git a/biomni/tool/tool_description/microbiology.py b/biomni/tool/tool_description/microbiology.py index f82ef18d3..f020b813d 100644 --- a/biomni/tool/tool_description/microbiology.py +++ b/biomni/tool/tool_description/microbiology.py @@ -247,7 +247,7 @@ "default": None, "description": "Names of the biofilm samples corresponding to od_values", "name": "sample_names", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": 0, @@ -270,7 +270,7 @@ "representing absorbance readings " "for samples", "name": "od_values", - "type": "List[float] or numpy.ndarray", + "type": "array", "items": {"type": "number"}, } ], }, @@ -427,25 +427,25 @@ "default": None, "description": "Initial population sizes for each microbial species", "name": "initial_populations", - "type": "List[int]", + "type": "array", "items": {"type": "integer"}, }, { "default": None, "description": "Per capita growth rates for each species", "name": "growth_rates", - "type": "List[float]", + "type": "array", "items": {"type": "number"}, }, { "default": None, "description": "Per capita death/clearance rates for each species", "name": "clearance_rates", - "type": "List[float]", + "type": "array", "items": {"type": "number"}, }, { "default": None, "description": "Maximum sustainable population for each species", "name": "carrying_capacities", - "type": "List[float]", + "type": "array", "items": {"type": "number"}, }, ], }, diff --git a/biomni/tool/tool_description/molecular_biology.py b/biomni/tool/tool_description/molecular_biology.py index 39a13d72f..b6ae95600 100644 --- a/biomni/tool/tool_description/molecular_biology.py +++ b/biomni/tool/tool_description/molecular_biology.py @@ -122,7 +122,7 @@ "default": None, "description": "Single primer or list of primers", "name": "short_seqs", - "type": "Union[str, List[str]]", + "type": "string", }, ], }, @@ -181,7 +181,7 @@ "default": None, "description": "Names of restriction enzymes to use for digestion", "name": "enzyme_names", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], }, @@ -207,7 +207,7 @@ "default": None, "description": "List of restriction enzyme names to check", "name": "enzymes", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], }, @@ -318,7 +318,7 @@ "default": None, "description": "List of insert lengths in bp", "name": "insert_lengths", - "type": "List[int]", + "type": "array", "items": {"type": "integer"}, }, { "default": False, @@ -428,7 +428,7 @@ "default": None, "description": "List of existing primers with their sequences and optional names", "name": "existing_primers", - "type": "Optional[List[Dict[str, str]]]", + "type": "array", "items": {"type": "object", "additionalProperties": {"type": "string"}}, }, { "default": True, @@ -553,7 +553,7 @@ "name + fwd_oligo + rev_oligo (oligo pair with matching overhangs) or " "name + sequence (double-stranded DNA fragment containing restriction sites)", "name": "fragments", - "type": "List[Dict[str, str]]", + "type": "array", "items": {"type": "object", "additionalProperties": {"type": "string"}}, }, ], }, diff --git a/biomni/tool/tool_description/pathology.py b/biomni/tool/tool_description/pathology.py index 5661bb269..6d89e5196 100644 --- a/biomni/tool/tool_description/pathology.py +++ b/biomni/tool/tool_description/pathology.py @@ -178,7 +178,7 @@ "default": None, "description": "List of marker names corresponding to each channel in the image", "name": "markers_list", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], }, diff --git a/biomni/tool/tool_description/pharmacology.py b/biomni/tool/tool_description/pharmacology.py index 66bb5f130..f9deb7a97 100644 --- a/biomni/tool/tool_description/pharmacology.py +++ b/biomni/tool/tool_description/pharmacology.py @@ -57,7 +57,7 @@ "default": None, "description": "List of SMILES strings representing small molecules to dock", "name": "smiles_list", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, @@ -69,13 +69,13 @@ "default": None, "description": "3D coordinates [x, y, z] of the docking box center", "name": "box_center", - "type": "List[float]", + "type": "array", "items": {"type": "number"}, }, { "default": None, "description": "Dimensions [x, y, z] of the docking box", "name": "box_size", - "type": "List[float]", + "type": "array", "items": {"type": "number"}, }, ], }, @@ -152,7 +152,7 @@ "default": None, "description": "List of SMILES strings representing chemical compounds to analyze", "name": "smiles_list", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, } ], }, @@ -177,7 +177,7 @@ "default": None, "description": "List of SMILES strings representing chemical compounds", "name": "smiles_list", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, @@ -198,7 +198,7 @@ "containing name, active ingredient, " "concentration, and excipients", "name": "formulations", - "type": "List[dict]", + "type": "array", "items": {"type": "object"}, }, { "default": None, @@ -207,13 +207,13 @@ "temperature, humidity (optional), " "and description", "name": "storage_conditions", - "type": "List[dict]", + "type": "array", "items": {"type": "object"}, }, { "default": None, "description": "List of time points in days to evaluate stability", "name": "time_points", - "type": "List[int]", + "type": "array", "items": {"type": "integer"}, }, ], }, @@ -280,7 +280,7 @@ "default": None, "description": "Time points (hours) at which measurements were taken", "name": "time_points", - "type": "List[float] or numpy.ndarray", + "type": "array", "items": {"type": "number"}, }, { "default": None, @@ -496,7 +496,7 @@ "default": None, "description": "List of drug names to query for interactions", "name": "drug_names", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, } ], "optional_parameters": [ @@ -504,13 +504,13 @@ "default": None, "description": "Filter results by specific interaction types", "name": "interaction_types", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, "description": "Filter results by severity levels (Major, Moderate, Minor)", "name": "severity_levels", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, @@ -528,7 +528,7 @@ "default": None, "description": "List of drugs to analyze for combination safety", "name": "drug_list", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, } ], "optional_parameters": [ @@ -592,7 +592,7 @@ "default": None, "description": "List of drugs to avoid interactions with", "name": "contraindicated_drugs", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], "optional_parameters": [ @@ -632,13 +632,13 @@ "default": None, "description": "Optional filter by severity levels ['serious', 'non_serious']", "name": "severity_filter", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, "description": "Optional filter by outcomes ['life_threatening', 'hospitalization', 'death']", "name": "outcome_filter", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": 100, @@ -664,7 +664,7 @@ "default": None, "description": "Optional list of specific sections to retrieve ['indications_and_usage', 'contraindications', 'warnings', 'dosage_and_administration']", "name": "sections", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], }, @@ -684,7 +684,7 @@ "default": None, "description": "Optional filter by recall class ['Class I', 'Class II', 'Class III']", "name": "classification", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, { "default": None, @@ -702,7 +702,7 @@ "default": None, "description": "List of drug names to analyze for safety signals", "name": "drug_list", - "type": "List[str]", + "type": "array", "items": {"type": "string"}, }, ], "optional_parameters": [ diff --git a/biomni/tool/tool_description/physiology.py b/biomni/tool/tool_description/physiology.py index 7583ec7d9..1de98340d 100644 --- a/biomni/tool/tool_description/physiology.py +++ b/biomni/tool/tool_description/physiology.py @@ -176,7 +176,7 @@ "default": None, "description": "List of b-values corresponding to each volume in the 4D DWI data", "name": "b_values", - "type": "List[float]", + "type": "array", "items": {"type": "number"}, }, ], }, diff --git a/biomni/tool/tool_description/synthetic_biology.py b/biomni/tool/tool_description/synthetic_biology.py index ec12fd4b0..542069227 100644 --- a/biomni/tool/tool_description/synthetic_biology.py +++ b/biomni/tool/tool_description/synthetic_biology.py @@ -153,7 +153,7 @@ "reactions with id, name, reactants, " "products, and reversible properties", "name": "reaction_network", - "type": "List[dict]", + "type": "array", "items": {"type": "object"}, }, { "default": None, From 94749c146799347e33eb5f2a95510ae35185cbe1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 09:57:29 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- biomni/tool/bioengineering.py | 6 +- biomni/tool/cell_biology.py | 12 ++-- biomni/tool/genomics.py | 8 ++- .../tool/tool_description/bioengineering.py | 6 +- biomni/tool/tool_description/cell_biology.py | 3 +- biomni/tool/tool_description/database.py | 6 +- biomni/tool/tool_description/genomics.py | 9 ++- biomni/tool/tool_description/microbiology.py | 18 ++++-- .../tool_description/molecular_biology.py | 15 +++-- biomni/tool/tool_description/pathology.py | 3 +- biomni/tool/tool_description/pharmacology.py | 57 ++++++++++++------- biomni/tool/tool_description/physiology.py | 3 +- .../tool_description/synthetic_biology.py | 3 +- 13 files changed, 96 insertions(+), 53 deletions(-) diff --git a/biomni/tool/bioengineering.py b/biomni/tool/bioengineering.py index 5da865097..63546858c 100644 --- a/biomni/tool/bioengineering.py +++ b/biomni/tool/bioengineering.py @@ -1,5 +1,3 @@ -from typing import List - def analyze_cell_migration_metrics( image_sequence_path, pixel_size_um=1.0, @@ -234,9 +232,7 @@ def analyze_cell_migration_metrics( def perform_crispr_cas9_genome_editing( - guide_rna_sequences: List[str], - target_genomic_loci: str, - cell_tissue_type: str + guide_rna_sequences: list[str], target_genomic_loci: str, cell_tissue_type: str ) -> str: """Simulates CRISPR-Cas9 genome editing process including guide RNA design, delivery, and analysis. diff --git a/biomni/tool/cell_biology.py b/biomni/tool/cell_biology.py index deff543de..18a66f213 100644 --- a/biomni/tool/cell_biology.py +++ b/biomni/tool/cell_biology.py @@ -1,6 +1,4 @@ -from typing import List - -def quantify_cell_cycle_phases_from_microscopy(image_paths: List[str], output_dir: str = "./results") -> str: +def quantify_cell_cycle_phases_from_microscopy(image_paths: list[str], output_dir: str = "./results") -> str: """Quantify the percentage of cells in each cell cycle phase using Calcofluor white stained microscopy images. This function processes microscopy images where cell walls/septa are stained with Calcofluor white, @@ -161,7 +159,9 @@ def quantify_cell_cycle_phases_from_microscopy(image_paths: List[str], output_di return log -def quantify_and_cluster_cell_motility(image_sequence_path: str, output_dir: str = "./results", num_clusters: int = 3) -> str: +def quantify_and_cluster_cell_motility( + image_sequence_path: str, output_dir: str = "./results", num_clusters: int = 3 +) -> str: """Quantify cell motility features from time-lapse microscopy images and cluster cells based on motility patterns. Parameters @@ -573,7 +573,9 @@ def analyze_flow_cytometry_immunophenotyping( return log -def analyze_mitochondrial_morphology_and_potential(morphology_image_path: str, potential_image_path: str, output_dir: str = "./output") -> str: +def analyze_mitochondrial_morphology_and_potential( + morphology_image_path: str, potential_image_path: str, output_dir: str = "./output" +) -> str: """Quantifies metrics of mitochondrial morphology and membrane potential from fluorescence microscopy images. Parameters diff --git a/biomni/tool/genomics.py b/biomni/tool/genomics.py index b74c8ecfa..8ac1909a4 100644 --- a/biomni/tool/genomics.py +++ b/biomni/tool/genomics.py @@ -1088,7 +1088,9 @@ def gene_set_enrichment_analysis( return f"An error occurred: {e}" -def analyze_chromatin_interactions(hic_file_path: str, regulatory_elements_bed: str, output_dir: str = "./output") -> str: +def analyze_chromatin_interactions( + hic_file_path: str, regulatory_elements_bed: str, output_dir: str = "./output" +) -> str: """Analyze chromatin interactions from Hi-C data to identify enhancer-promoter interactions and TADs. Parameters @@ -1421,7 +1423,9 @@ def get_matrix(chrom, balance_if_possible=True): return "\n".join(log) -def analyze_comparative_genomics_and_haplotypes(sample_fasta_files: str, reference_genome_path: str, output_dir: str = "./output") -> str: +def analyze_comparative_genomics_and_haplotypes( + sample_fasta_files: str, reference_genome_path: str, output_dir: str = "./output" +) -> str: """Perform comparative genomics and haplotype analysis on multiple genome samples. This function aligns multiple genome samples to a reference, identifies variants, diff --git a/biomni/tool/tool_description/bioengineering.py b/biomni/tool/tool_description/bioengineering.py index 6bd8105a9..6a1978ffd 100644 --- a/biomni/tool/tool_description/bioengineering.py +++ b/biomni/tool/tool_description/bioengineering.py @@ -121,13 +121,15 @@ "default": None, "description": "Time points at which drug concentrations were measured (in hours)", "name": "time_points", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, { "default": None, "description": "Measured drug concentration at each time point", "name": "concentration_data", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, ], }, diff --git a/biomni/tool/tool_description/cell_biology.py b/biomni/tool/tool_description/cell_biology.py index 4ed9188d7..9af0a8b4c 100644 --- a/biomni/tool/tool_description/cell_biology.py +++ b/biomni/tool/tool_description/cell_biology.py @@ -16,7 +16,8 @@ "default": None, "description": "List of file paths to microscopy images of cells stained with Calcofluor white", "name": "image_paths", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, } ], }, diff --git a/biomni/tool/tool_description/database.py b/biomni/tool/tool_description/database.py index f61f84852..d973cb22a 100644 --- a/biomni/tool/tool_description/database.py +++ b/biomni/tool/tool_description/database.py @@ -141,7 +141,8 @@ "default": None, "description": "List of specific attributes to retrieve", "name": "attributes", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], "required_parameters": [ @@ -149,7 +150,8 @@ "default": None, "description": "List of PDB identifiers to query", "name": "identifiers", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, } ], }, diff --git a/biomni/tool/tool_description/genomics.py b/biomni/tool/tool_description/genomics.py index 2eeeaa845..21836e198 100644 --- a/biomni/tool/tool_description/genomics.py +++ b/biomni/tool/tool_description/genomics.py @@ -165,7 +165,8 @@ "default": None, "description": "Custom command line arguments to pass to the UCE script", "name": "custom_args", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], "required_parameters": [ @@ -329,7 +330,8 @@ "default": None, "description": "Paths to FASTA files containing whole-genome sequences to be analyzed", "name": "sample_fasta_files", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, @@ -650,7 +652,8 @@ "default": None, "description": "List of Ensembl gene IDs (e.g., ['ENSG00000012048', 'ENSG00000012049'])", "name": "ensembl_gene_ids", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, } ], }, diff --git a/biomni/tool/tool_description/microbiology.py b/biomni/tool/tool_description/microbiology.py index f020b813d..a3e346949 100644 --- a/biomni/tool/tool_description/microbiology.py +++ b/biomni/tool/tool_description/microbiology.py @@ -247,7 +247,8 @@ "default": None, "description": "Names of the biofilm samples corresponding to od_values", "name": "sample_names", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": 0, @@ -270,7 +271,8 @@ "representing absorbance readings " "for samples", "name": "od_values", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, } ], }, @@ -427,25 +429,29 @@ "default": None, "description": "Initial population sizes for each microbial species", "name": "initial_populations", - "type": "array", "items": {"type": "integer"}, + "type": "array", + "items": {"type": "integer"}, }, { "default": None, "description": "Per capita growth rates for each species", "name": "growth_rates", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, { "default": None, "description": "Per capita death/clearance rates for each species", "name": "clearance_rates", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, { "default": None, "description": "Maximum sustainable population for each species", "name": "carrying_capacities", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, ], }, diff --git a/biomni/tool/tool_description/molecular_biology.py b/biomni/tool/tool_description/molecular_biology.py index b6ae95600..e0336535e 100644 --- a/biomni/tool/tool_description/molecular_biology.py +++ b/biomni/tool/tool_description/molecular_biology.py @@ -181,7 +181,8 @@ "default": None, "description": "Names of restriction enzymes to use for digestion", "name": "enzyme_names", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], }, @@ -207,7 +208,8 @@ "default": None, "description": "List of restriction enzyme names to check", "name": "enzymes", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], }, @@ -318,7 +320,8 @@ "default": None, "description": "List of insert lengths in bp", "name": "insert_lengths", - "type": "array", "items": {"type": "integer"}, + "type": "array", + "items": {"type": "integer"}, }, { "default": False, @@ -428,7 +431,8 @@ "default": None, "description": "List of existing primers with their sequences and optional names", "name": "existing_primers", - "type": "array", "items": {"type": "object", "additionalProperties": {"type": "string"}}, + "type": "array", + "items": {"type": "object", "additionalProperties": {"type": "string"}}, }, { "default": True, @@ -553,7 +557,8 @@ "name + fwd_oligo + rev_oligo (oligo pair with matching overhangs) or " "name + sequence (double-stranded DNA fragment containing restriction sites)", "name": "fragments", - "type": "array", "items": {"type": "object", "additionalProperties": {"type": "string"}}, + "type": "array", + "items": {"type": "object", "additionalProperties": {"type": "string"}}, }, ], }, diff --git a/biomni/tool/tool_description/pathology.py b/biomni/tool/tool_description/pathology.py index 6d89e5196..67393ce8e 100644 --- a/biomni/tool/tool_description/pathology.py +++ b/biomni/tool/tool_description/pathology.py @@ -178,7 +178,8 @@ "default": None, "description": "List of marker names corresponding to each channel in the image", "name": "markers_list", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], }, diff --git a/biomni/tool/tool_description/pharmacology.py b/biomni/tool/tool_description/pharmacology.py index f9deb7a97..b50e79e1c 100644 --- a/biomni/tool/tool_description/pharmacology.py +++ b/biomni/tool/tool_description/pharmacology.py @@ -57,7 +57,8 @@ "default": None, "description": "List of SMILES strings representing small molecules to dock", "name": "smiles_list", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, @@ -69,13 +70,15 @@ "default": None, "description": "3D coordinates [x, y, z] of the docking box center", "name": "box_center", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, { "default": None, "description": "Dimensions [x, y, z] of the docking box", "name": "box_size", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, ], }, @@ -152,7 +155,8 @@ "default": None, "description": "List of SMILES strings representing chemical compounds to analyze", "name": "smiles_list", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, } ], }, @@ -177,7 +181,8 @@ "default": None, "description": "List of SMILES strings representing chemical compounds", "name": "smiles_list", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, @@ -198,7 +203,8 @@ "containing name, active ingredient, " "concentration, and excipients", "name": "formulations", - "type": "array", "items": {"type": "object"}, + "type": "array", + "items": {"type": "object"}, }, { "default": None, @@ -207,13 +213,15 @@ "temperature, humidity (optional), " "and description", "name": "storage_conditions", - "type": "array", "items": {"type": "object"}, + "type": "array", + "items": {"type": "object"}, }, { "default": None, "description": "List of time points in days to evaluate stability", "name": "time_points", - "type": "array", "items": {"type": "integer"}, + "type": "array", + "items": {"type": "integer"}, }, ], }, @@ -280,7 +288,8 @@ "default": None, "description": "Time points (hours) at which measurements were taken", "name": "time_points", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, { "default": None, @@ -496,7 +505,8 @@ "default": None, "description": "List of drug names to query for interactions", "name": "drug_names", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, } ], "optional_parameters": [ @@ -504,13 +514,15 @@ "default": None, "description": "Filter results by specific interaction types", "name": "interaction_types", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, "description": "Filter results by severity levels (Major, Moderate, Minor)", "name": "severity_levels", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, @@ -528,7 +540,8 @@ "default": None, "description": "List of drugs to analyze for combination safety", "name": "drug_list", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, } ], "optional_parameters": [ @@ -592,7 +605,8 @@ "default": None, "description": "List of drugs to avoid interactions with", "name": "contraindicated_drugs", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], "optional_parameters": [ @@ -632,13 +646,15 @@ "default": None, "description": "Optional filter by severity levels ['serious', 'non_serious']", "name": "severity_filter", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, "description": "Optional filter by outcomes ['life_threatening', 'hospitalization', 'death']", "name": "outcome_filter", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": 100, @@ -664,7 +680,8 @@ "default": None, "description": "Optional list of specific sections to retrieve ['indications_and_usage', 'contraindications', 'warnings', 'dosage_and_administration']", "name": "sections", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], }, @@ -684,7 +701,8 @@ "default": None, "description": "Optional filter by recall class ['Class I', 'Class II', 'Class III']", "name": "classification", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, { "default": None, @@ -702,7 +720,8 @@ "default": None, "description": "List of drug names to analyze for safety signals", "name": "drug_list", - "type": "array", "items": {"type": "string"}, + "type": "array", + "items": {"type": "string"}, }, ], "optional_parameters": [ diff --git a/biomni/tool/tool_description/physiology.py b/biomni/tool/tool_description/physiology.py index 1de98340d..5e27ca0b0 100644 --- a/biomni/tool/tool_description/physiology.py +++ b/biomni/tool/tool_description/physiology.py @@ -176,7 +176,8 @@ "default": None, "description": "List of b-values corresponding to each volume in the 4D DWI data", "name": "b_values", - "type": "array", "items": {"type": "number"}, + "type": "array", + "items": {"type": "number"}, }, ], }, diff --git a/biomni/tool/tool_description/synthetic_biology.py b/biomni/tool/tool_description/synthetic_biology.py index 542069227..312068f3b 100644 --- a/biomni/tool/tool_description/synthetic_biology.py +++ b/biomni/tool/tool_description/synthetic_biology.py @@ -153,7 +153,8 @@ "reactions with id, name, reactants, " "products, and reversible properties", "name": "reaction_network", - "type": "array", "items": {"type": "object"}, + "type": "array", + "items": {"type": "object"}, }, { "default": None,