### Install rowan-python with uv Source: https://docs.rowansci.com/api/python/v3 Install the rowan Python client using uv. ```bash uv add rowan-python ``` -------------------------------- ### Install rowan-python with pixi Source: https://docs.rowansci.com/api/python/v3 Install the rowan Python client using pixi. ```bash pixi add --pypi rowan-python ``` -------------------------------- ### Install rowan-python with pip Source: https://docs.rowansci.com/api/python/v3 Install the rowan Python client using pip. ```bash pip install rowan-python ``` -------------------------------- ### set_project usage example Source: https://docs.rowansci.com/api/python/v3/api/project Example usage of set_project to activate a project by name, followed by a get_folder call. ```python rowan.set_project("CDK2 campaign") folder = rowan.get_folder("docking/batch_1") ``` -------------------------------- ### get_folder usage example Source: https://docs.rowansci.com/api/python/v3/api/folder Retrieves a folder by path and uses its UUID to submit a docking workflow. ```python folder = rowan.get_folder("CDK2/docking/batch_1") workflow = rowan.submit_docking_workflow(..., folder_uuid=folder.uuid) ``` -------------------------------- ### Quickstart: submit and stream a geometry optimization workflow Source: https://docs.rowansci.com/api/python/v3 Runs a geometry optimization on isoprene using the rapid_semiempirical preset, submits it to a folder, and streams each optimization step as it completes. Prints a link to the workflow and the number of optimization steps and final energy. ```python import rowan folder = rowan.get_folder("examples") workflow = rowan.submit_basic_calculation_workflow( initial_molecule=rowan.Molecule.from_smiles("CC(=C)C=C"), preset="rapid_semiempirical", tasks=["optimize"], name="Isoprene Optimization", folder=folder, ) print(f"View workflow at: https://labs.rowansci.com/calculation/{workflow.uuid}") for result in workflow.stream_result(poll_interval=3): if result.calculation_uuid: mols = rowan.retrieve_calculation_molecules(result.calculation_uuid) print(f" {len(mols)} opt steps, energy={mols[-1].get('energy') if mols else None}") print(result) ``` -------------------------------- ### Example return value for run_optimize Source: https://docs.rowansci.com/api/rdkit The expected structure returned by the run_optimize function. ```json { "rdkit_molecule: , "energies": [-323.7187770466773, -323.72498584120694] } ``` -------------------------------- ### get_project function signature Source: https://docs.rowansci.com/api/python/v3/api/project Gets a project by exact name, optionally creating it if not found. create defaults to False. ```python get_project(name: str, create: bool = False) -> Project ``` -------------------------------- ### Example return value for run_conformers Source: https://docs.rowansci.com/api/rdkit The expected structure returned by the run_conformers function. ```json { "rdkit_molecule": , "energies": [-323.7187770466773, -323.72498584120694] } ``` -------------------------------- ### Covalent docking setup with GninaSettings Source: https://docs.rowansci.com/api/python/v3/workflows/docking Sets up covalent gnina docking by resolving the reactive protein atom index from the prepared protein and configuring GninaSettings with scoring_function='vina' and both covalent atom indices. Requires the ligand in its post-reaction, covalently bound topology. ```python prepared_protein = preparation_workflow.result().get_prepared_protein() reactive_protein_atom_index = prepared_protein.get_atom_index( chain="A", residue=reactive_residue, atom="SG" ) settings = rowan.GninaSettings( scoring_function="vina", covalent_ligand_atom_index=reactive_ligand_atom_index, covalent_protein_atom_index=reactive_protein_atom_index, ) workflow = rowan.submit_docking_workflow( prepared_protein.uuid, pocket=[center, size], initial_molecule=ligand, docking_settings=settings, ) ``` -------------------------------- ### run_pka: Run pKa workflow on a single molecule Source: https://docs.rowansci.com/api/rdkit Imports run_pka from rowan.rowan_rdkit, creates a molecule from SMILES, and prints acidic and basic pKa values. The example uses phenylacetic acid. ```python from rowan.rowan_rdkit import run_pka mol = Chem.MolFromSmiles("O=C(O)Cc1ccccc1") # Phenylacetic acid result = run_pka(mol) print(result["acidic_pkas"], result["basic_pkas"]) ``` -------------------------------- ### get_project Source: https://docs.rowansci.com/api/python/v3/api/project Gets a project by exact name, optionally creating it if it does not exist. Does not change the active project. ```APIDOC ## get_project ### Description Gets a project by exact name, optionally creating it if it does not exist. Does not change the active project. ### Method get_project ### Signature `get_project(name: str, create: bool = False) -> Project` ### Parameters - **name** (str) - Required - Exact name of the project. - **create** (bool) - Optional - If True, create the project when no exact match exists. Default: False. ### Returns - **Project** - Matched (or newly created) project. ### Raises - **ValueError** - If no match is found and `create` is False. ``` -------------------------------- ### root_folder function signature and example usage Source: https://docs.rowansci.com/api/python/v3/api/folder Gets the root folder of the active project. The root folder is the top of the folder tree. The example shows how to iterate over children and navigate to a subfolder using the / operator. ```python root_folder() -> Folder ``` ```python root = rowan.root_folder() for child in root.children(): print(child.name) batch = root / "CDK2" / "docking" ``` -------------------------------- ### Submit basic calculation workflow with full API Source: https://docs.rowansci.com/python-api Uses the low-level API to submit a GFN2-xTB energy calculation for methyl acetate and print the result. ```python import rowan from stjames import Molecule # rowan.api_key = "rowan-sk..." folder = rowan.get_folder("examples") workflow = rowan.submit_basic_calculation_workflow( initial_molecule=Molecule.from_smiles("CC(=O)OC"), name="methyl acetate energy", tasks=["energy"], method="gfn2_xtb", engine="xtb", folder=folder, ) result = workflow.result() print(result) ``` -------------------------------- ### PeriodicCell from_string usage and error examples Source: https://docs.rowansci.com/api/python/v3/api/molecule Examples of parsing valid strings into PeriodicCell objects and handling common ValueError scenarios for malformed input. ```python >>> PeriodicCell.from_string("[(1, -2, 3.0), [4e1, +5, 6], (7.1, 8, 9)]") PeriodicCell(lattice_vectors=((1.0, -2.0, 3.0), (40.0, 5.0, 6.0), (7.1, 8.0, 9.0)), is_periodic=(True, True, True)) PeriodicCell.from_string("[(a, -2, 3.0), [4e1, +5, 6], (7.1, 8, 9)]") Traceback (most recent call last): ... ValueError: Could not parse cell from string: [(a, -2, 3.0), [4e1, +5, 6], (7.1, 8, 9)] PeriodicCell.from_string("[(1, -2, 3.0), [4e1, +5, 6], (7.1, 8, 9, 10)]") Traceback (most recent call last): ... ValueError: Cell must be a 3x3 matrix: got [(1, -2, 3.0), [4e1, +5, 6], (7.1, 8, 9, 10)] PeriodicCell.from_string("[('a', -2, 3.0), [4e1, +5, 6], (7.1, 8, 9)]") Traceback (most recent call last): ValueError: Cell must be a 3x3 matrix of numbers: got [('a', -2, 3.0), [4e1, +5, 6], (7.1, 8, 9)] ``` -------------------------------- ### get_status Source: https://docs.rowansci.com/api/python/v3/api/workflow Gets the status of the workflow. ```APIDOC ## get_status ### Description Gets the status of the workflow. ### Method SDK Method ### Signature ```python get_status() -> stjames.Status ``` ### Returns - **Status** - Status of the workflow, as an instance of stjames.Status. ``` -------------------------------- ### get_folder(path: str, create: bool = True) -> Folder Source: https://docs.rowansci.com/api/python/v3/api/folder Gets a folder by name or nested path within the default project. This is the easiest way to get a folder to use as a location for calculations. By default, any missing folders along the path are created automatically. ```APIDOC ## get_folder(path: str, create: bool = True) -> Folder ### Description Gets a folder by name or nested path within the default project. This is the easiest way to get a folder to use as a location for calculations. By default, any missing folders along the path are created automatically. ### Parameters - **path** (str) - Required - Folder name or `/`-separated path, e.g. `"project/subdir/run1"`. - **create** (bool) - Optional - If True (default), create missing folders. If False, raise ValueError if any segment is not found. Default: `True`. ### Returns - **Folder** - Deepest `Folder` in the path. ### Raises - **ValueError** - If the path is empty, or `create=False` and a folder is not found. ### Example ```python folder = rowan.get_folder("CDK2/docking/batch_1") workflow = rowan.submit_docking_workflow(..., folder_uuid=folder.uuid) ``` ``` -------------------------------- ### iMTDSettings.from_mode Source: https://docs.rowansci.com/api/python/v3/workflows/conformer-search-settings Creates an iMTDSettings instance from a Mode preset, defining calculation speed and parameters. ```APIDOC ## iMTDSettings.from_mode ### Description Creates an iMTDSettings instance from a Mode preset, defining calculation speed and parameters. ### Method classmethod ### Signature from_mode(mode: Mode) -> Self ### Parameters - **mode** (Mode) - Required - The preset mode: RECKLESS, RAPID, CAREFUL, or METICULOUS. ### Returns - **Self** - An iMTDSettings instance configured according to the selected mode. ### Mode Presets - **RECKLESS**: GFN-FF//MTD(GFN-FF), Megaquick, No GC, No rotamer metadynamics, Energy window = 5.0, Run scaling factor = 0.5, 6 MTD runs - **RAPID**: GFN0//MTD(GFN-FF), Superquick, No GC, No rotamer metadynamics, Energy window = 5.0, Run scaling factor = 0.5, 6 MTD runs - **CAREFUL**: GFN2//MTD(GFN-FF), Quick, GC (for iMTD-GC), Rotamer metadynamics (for iMTD-GC), Energy window = 5.0, Run scaling factor = 0.5, 6 MTD runs - **METICULOUS**: GFN2//MTD(GFN2), "Normal", GC (for iMTD-GC), Rotamer metadynamics (for iMTD-GC), Energy window = 6.0, Run scaling factor = 1, 14 MTD runs (2 with extreme values) ``` -------------------------------- ### get_project_uuid Source: https://docs.rowansci.com/api/python/v3/api/project Get the active project UUID from the module-level attribute rowan.project_uuid. ```APIDOC ## get_project_uuid ### Description Get the active project UUID from the module-level attribute rowan.project_uuid. ### Method get_project_uuid ### Signature `get_project_uuid() -> str | None` ### Returns - **str | None** - Project UUID string, or None if not set. ``` -------------------------------- ### OpenConfSettings Source: https://docs.rowansci.com/api/python/v3/workflows/conformer-search-settings Settings for OpenConf-based conformer generation. Users can instantiate this pydantic model with the specified fields to configure the search. ```APIDOC ## OpenConfSettings ### Description Settings for OpenConf-based conformer generation. OpenConf uses a hybrid ETKDG seeding + MCMM torsion-walk exploration strategy with PRISM deduplication. ### Inherited Parameters - **constraints** - Required - FREEZE_ATOMS constraints only; pins specified atoms via MMFF position restraints and excludes their rotors from the move set. - **nci** - Required - Not supported. - **max_confs** - Required - Maximum number of conformers to return. - **n_steps** - Required - Number of MCMM exploration steps (primary quality/speed lever). - **energy_window_kcal** - Required - Energy window for keeping conformers (kcal/mol). - **parent_strategy** - Required - How to select parent conformers for mutation: "softmax" (energy-biased), "uniform" (random), "best" (always lowest-energy). - **final_select** - Required - How the final conformer set is selected: "diverse" (k-means clustering) or "energy" (lowest-energy). - **do_final_refine** - Required - Run full MMFF minimization on final set (slower but more accurate geometries). ``` -------------------------------- ### Create a folder with rowan.Folder.create Source: https://docs.rowansci.com/api/python Creates a new folder with the specified name and parent UUID, returning the folder object. ```python rowan.Folder.create( name="new folder", parent_uuid="6dac05de-ce7f-4f6d-b7d2-743981aa1fde", ) ``` -------------------------------- ### Workflow Object Structure Source: https://docs.rowansci.com/api/python An example of the JSON representation of a Workflow object in Rowan. ```json { "name": "water pka", "parent_uuid": "824f1db1-e7ff-4d3f-a102-62c365d0fb80", "notes": "", "starred": false, "public": false, "object_type": "pka", "object_data": { "pka_range": [-5, 25], "deprotonate_elements": ["8"], "deprotonate_atoms": [], "protonate_elements": ["8"], "protonate_atoms": [], "mode": "careful", "initial_molecule": { "charge": 0, "multiplicity": 1, "atoms": [ { "atomic_number": 8, "position": [-0.011994152329862118, 0.3976341784000397, 0] }, { "atomic_number": 1, "position": [-0.7571237087249756, -0.2218356728553772, 0] }, { "atomic_number": 1, "position": [0.7691178917884827, -0.17579850554466248, 0] } ], } }, "email_when_complete": false, "created_at": "2024-09-11T14:34:49.085669Z", "updated_at": null, "started_at": null, "completed_at": null, "uuid": "b834ab26-8533-489c-97a5-bd915f00a6c2", "elapsed": 0, "credits_charged": 0, "object_status": 0, "object_logfile": "", "is_free": true } ``` -------------------------------- ### OpenConfSettings Source: https://docs.rowansci.com/api/python/v3/workflows/conformer-search-settings Settings for OpenConf-based conformer generation. OpenConf uses a hybrid ETKDG seeding + MCMM torsion-walk exploration strategy with PRISM deduplication. This model defines parameters for controlling the conformer search, including constraints, number of steps, energy window, parent selection strategy, final selection method, and optional final refinement. ```APIDOC ## OpenConfSettings ### Description Settings for OpenConf-based conformer generation. OpenConf uses a hybrid ETKDG seeding + MCMM torsion-walk exploration strategy with PRISM deduplication. ### Fields - **constraints** (Sequence[Constraint]) - Default: [] - FREEZE_ATOMS constraints only; pins specified atoms via MMFF position restraints and excludes their rotors from the move set. - **nci** (bool) - Default: false - Not supported; add a constraining potential for non-covalent interactions. - **max_confs** (PositiveInt | None) - Default: null - Maximum number of conformers to return. - **n_steps** (PositiveInt) - Default: 200 - Number of MCMM exploration steps (primary quality/speed lever). - **energy_window_kcal** (PositiveFloat) - Default: 10.0 - Energy window for keeping conformers (kcal/mol). - **parent_strategy** (Literal['softmax', 'uniform', 'best']) - Default: 'softmax' - How to select parent conformers for mutation. Options: 'softmax' (energy-biased; favors low-energy basins), 'uniform' (random; maximizes diversity), 'best' (always mutate the lowest-energy conformer; fastest but least diverse). - **final_select** (Literal['energy', 'diverse']) - Default: 'diverse' - How the final conformer set is selected. Options: 'diverse' (k-means clustering on 3D shape descriptors; one conformer per cluster), 'energy' (lowest-energy conformers only). - **do_final_refine** (bool) - Default: true - Run full MMFF minimization on final set (slower but more accurate geometries). - **settings_type** (Literal['openconf']) - Default: 'openconf' - Discriminator field for settings type. ### Validators - **check_constraints** → constraints - **check_nci** → nci ### Constraint Model Represents a single (absolute) constraint. #### Fields - **constraint_type** (ConstraintType) - Required - Which type of constraint. Enum: 'bond', 'angle', 'dihedral', 'freeze_atoms'. - **atoms** (array of integers) - Required - Atoms in question (1-indexed). - **value** (number | null) - Default: null - Value to constrain to; leaving blank sets current value. ### JSON Schema Example ```json { "$defs": { "Constraint": { "description": "Represents a single (absolute) constraint.\n\n:param constraint_type: which type\n:param atoms: atoms in question (1-indexed)\n:param value: value to constrain to; leaving blank sets current value", "properties": { "constraint_type": { "$ref": "#/$defs/ConstraintType" }, "atoms": { "items": { "exclusiveMinimum": 0, "type": "integer" }, "title": "Atoms", "type": "array" }, "value": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Value" } }, "required": [ "constraint_type", "atoms" ], "title": "Constraint", "type": "object" }, "ConstraintType": { "description": "Different sorts of constraints.", "enum": [ "bond", "angle", "dihedral", "freeze_atoms" ], "title": "ConstraintType", "type": "string" } }, "description": "Settings for OpenConf-based conformer generation.\n\nOpenConf uses a hybrid ETKDG seeding + MCMM torsion-walk exploration\nstrategy with PRISM deduplication.\n\nInherited:\n:param constraints: FREEZE_ATOMS constraints only; pins specified atoms via MMFF\n position restraints and excludes their rotors from the move set\n:param nci: not supported\n:param max_confs: maximum number of conformers to return\n\nNew:\n:param n_steps: number of MCMM exploration steps (primary quality/speed lever)\n:param energy_window_kcal: energy window for keeping conformers (kcal/mol)\n:param parent_strategy: how to select parent conformers for mutation\n - \"softmax\": energy-biased; favors low-energy basins (good for NMR/property prediction)\n - \"uniform\": random; maximizes diversity (good for docking)\n - \"best\": always mutate the lowest-energy conformer; fastest but least diverse\n:param final_select: how the final conformer set is selected\n - \"diverse\": k-means clustering on 3D shape descriptors; one conformer per cluster\n - \"energy\": lowest-energy conformers only (best for Boltzmann-weighted applications)\n:param do_final_refine: run full MMFF minimization on final set (slower but more accurate geometries)", "properties": { "constraints": { "default": [], "items": { "$ref": "#/$defs/Constraint" }, "title": "Constraints", "type": "array" }, "nci": { "default": false, "title": "Nci", "type": "boolean" }, "max_confs": { "anyOf": [ { "exclusiveMinimum": 0, "type": "integer" }, { "type": "null" } ], "default": null, "title": "Max Confs" }, "n_steps": { "default": 200, "exclusiveMinimum": 0, "title": "N Steps", "type": "integer" }, "energy_window_kcal": { "default": 10.0, "exclusiveMinimum": 0, "title": "Energy Window Kcal", "type": "number" }, "parent_strategy": { "default": "softmax", "enum": [ "softmax", "uniform", "best" ], "title": "Parent Strategy", "type": "string" }, "final_select": { "default": "diverse", "enum": [ "energy", "diverse" ], "title": "Final Select", "type": "string" }, "do_final_refine": { "default": true, "title": "Do Final Refine", "type": "boolean" }, "settings_type": { "const": "openconf", "default": "openconf", "title": "Settings Type", "type": "string" } }, "title": "OpenConfSettings", "type": "object" } ``` ``` -------------------------------- ### Folder.contents(size: int = 100) -> list[Folder | Workflow] Source: https://docs.rowansci.com/api/python/v3/api/folder Lists everything directly inside this folder, both child folders and workflows. Folders come first, followed by workflows. ```APIDOC ## Folder.contents ### Description List everything directly inside this folder, both child folders and workflows. Folders come first, followed by workflows. For a single type, use children or workflows. ### Method SDK Method ### Signature contents(size: int = 100) -> list[Folder | Workflow] ### Parameters - **size** (int) - Optional - Maximum number of items of each type to return. Default: 100. ### Returns - **list[Folder | Workflow]** - List of Folder and Workflow objects. ### Raises - **HTTPError** - If the API request fails. ``` -------------------------------- ### Example return value for run_energy Source: https://docs.rowansci.com/api/rdkit The expected JSON-like structure returned by the run_energy function. ```json [ { "conformer_index": 0, "energy": -323.72498584120694 }, { "conformer_index": 1, "energy": -323.72851913600635 }, { "conformer_index": 2, "energy": -323.7187770466773 } ] ``` -------------------------------- ### rowan.Folder.create Source: https://docs.rowansci.com/api/python Creates a new folder and returns the folder object. ```APIDOC ## rowan.Folder.create ### Description Creates a new folder and returns the folder object. ### Method create ### Endpoint rowan.Folder.create ### Parameters - **name** (`str`) - Required - The name of the folder. - **parent_uuid** (`str`) - Required - The UUID of this folder's parent (the folder which contains this folder). - **notes** (`str`) - Optional - Any notes associated with this folder. - **starred** (`bool`) - Optional - Whether or not this folder is starred. - **public** (`bool`) - Optional - Whether or not this folder is publicly viewable. This will propagate to all contained workflows and folders. ### Request Example ``` rowan.Folder.create( name="new folder", parent_uuid="6dac05de-ce7f-4f6d-b7d2-743981aa1fde", ) ``` ### Response #### Success Response Returns the folder object. #### Response Example ``` { "name": "example folder", "parent_uuid": "64b01a92-e52d-45ac-9768-3cc9430eaa6e", "notes": "This is a folder", "starred": false, "public": false, "created_at": "2024-09-10T13:58:39.500Z", "updated_at": "2024-09-10T13:58:39.500Z", "is_root": false, "uuid": "6dac05de-ce7f-4f6d-b7d2-743981aa1fde", } ``` ``` -------------------------------- ### prepare Source: https://docs.rowansci.com/api/python/v3/api/protein Quickly prepare a protein in place using PDBFixer and OpenMM. Runs PDBFixer to fix nonstandard residues, add missing atoms/hydrogens, and optionally optimizes hydrogen positions with OpenMM. ```APIDOC ## prepare ### Description Quickly prepare a protein in place using PDBFixer and OpenMM. Runs PDBFixer to fix nonstandard residues, add missing atoms/hydrogens, and optionally optimizes hydrogen positions with OpenMM. This is the fast preparation option and typically finishes in about a minute or less. Use submit_protein_preparation_workflow for the full protein preparation workflow, which can take around ten minutes but includes Boltz-2 missing-structure modeling, terminal capping, selectable protonation methods, and retained non-polymers. ### Method prepare ### Signature prepare(find_missing_residues: bool = True, add_missing_atoms: bool = True, remove_heterogens: bool = True, keep_waters: bool = False, remove_hydrogens: bool = False, remove_invalid_hydrogens: bool = False, add_hydrogens: bool = True, add_hydrogen_ph: float = 7.0, optimize_hydrogens: bool = True, poll_interval: float = 10.0, timeout: float = 300.0) -> None ### Parameters - **find_missing_residues** (bool) - Optional - Identify and model missing residues. - **add_missing_atoms** (bool) - Optional - Add missing heavy atoms to residues. - **remove_heterogens** (bool) - Optional - Remove ligands, salts, and other heterogens. - **keep_waters** (bool) - Optional - Preserve water molecules when removing heterogens. - **remove_hydrogens** (bool) - Optional - Remove all existing hydrogens before adding new ones. - **remove_invalid_hydrogens** (bool) - Optional - Remove hydrogens not matching the forcefield template. - **add_hydrogens** (bool) - Optional - Add missing hydrogen atoms. - **add_hydrogen_ph** (float) - Optional - pH used to determine protonation states when adding hydrogens. - **optimize_hydrogens** (bool) - Optional - Optimize hydrogen positions with OpenMM energy minimization. - **poll_interval** (float) - Optional - Seconds between status checks (default 10). - **timeout** (float) - Optional - Maximum seconds to wait before raising (default 300). ### Raises - **RuntimeError** - If preparation fails, is stopped, or times out. - **requests.HTTPError** - If any API request fails. ``` -------------------------------- ### ConformerSearchResult.get_energies Source: https://docs.rowansci.com/api/python/v3/workflows/conformer-search Get conformer energies. Optionally returns relative energies in kcal/mol relative to the lowest energy conformer. ```APIDOC ## get_energies ### Description Get conformer energies. If `relative` is True, returns relative energies in kcal/mol (relative to the lowest energy conformer). If False (default), returns absolute energies in Hartree. ### Method `get_energies(relative: bool = False) -> list[float]` ### Parameters - **relative** (bool) - Optional - If True, return relative energies in kcal/mol (relative to the lowest energy conformer). If False (default), return absolute energies in Hartree. ### Returns - **list[float]** - List of conformer energies ordered by energy (lowest first). ``` -------------------------------- ### batch_tautomers: Generate tautomers for multiple molecules Source: https://docs.rowansci.com/api/rdkit Imports batch_tautomers, creates a list of molecules, runs with mode='rapid', and iterates over results to print energy and weight for each tautomer. ```python from rowan.rowan_rdkit import batch_tautomers mols = [Chem.MolFromSmiles("C1=CC=CC=C1O"), Chem.MolFromSmiles("C1=CC=CC=C1N")] results = batch_tautomers(mols, mode="rapid") for taut_list in results: # Each element in taut_list is a list of tautomer data for that molecule for t in taut_list: print(t["predicted_relative_energy"], t["weight"]) ``` -------------------------------- ### Molecule Initialization Source: https://docs.rowansci.com/api/python/v3/api/molecule The constructor for the Molecule class. ```python Molecule(_stjames: Molecule | None = None, **kwargs) ``` -------------------------------- ### DoubleEndedTSSearchResult.get_path_energies Source: https://docs.rowansci.com/api/python/v3/workflows/double-ended-ts-search Gets energies along the reaction path, sorted by distance. Optionally returns relative energies in kcal/mol. ```APIDOC ## DoubleEndedTSSearchResult.get_path_energies ### Description Gets energies along the reaction path, sorted by distance. Optionally returns relative energies in kcal/mol. ### Method Function call ### Endpoint `get_path_energies(relative: bool = False)` ### Parameters - `relative` (bool) - Optional - If True, return relative energies in kcal/mol (relative to the lowest energy point). If False (default), return absolute energies in Hartree. Default: False. ### Returns - `list[float]` - List of energies along the reaction path. ``` -------------------------------- ### root_folder() -> Folder Source: https://docs.rowansci.com/api/python/v3/api/folder Get the root folder of the active project. The root folder is the top of the folder tree you navigate and store workflows in. ```APIDOC ## root_folder ### Description Get the root folder of the active project. The root folder is the top of the folder tree you navigate and store workflows in. Use the active project set via set_project (or rowan.project_uuid), falling back to the default project. ### Method SDK Function ### Signature root_folder() -> Folder ### Example root = rowan.root_folder() for child in root.children(): print(child.name) batch = root / "CDK2" / "docking" ### Returns - **Folder** - Root Folder of the active or default project. ### Raises - **HTTPError** - If the API request fails. ``` -------------------------------- ### Calculation object structure Source: https://docs.rowansci.com/api/python Example of the JSON structure representing a single calculation in Rowan, including settings, molecules, status, name, and elapsed time. ```json { "settings": { "method": "aimnet2_wb97md3", "basis_set": null, "tasks": [ "optimize", "frequencies" ], }, "molecules": [...], "status": 2, "name": "neutral (conformer 1)", "elapsed": 0.09688869799998656, } ``` -------------------------------- ### Run pKa Workflow Source: https://docs.rowansci.com/api Submit a pKa workflow for phenol and print the result. ```python import rowan from stjames import Molecule # rowan.api_key = "rowan-sk..." workflow = rowan.submit_pka_workflow( initial_molecule=Molecule.from_smiles("c1ccccc1O"), name="phenol pka", ) result = workflow.result() print(result.strongest_acid) # ~10.17 ``` ```bash $ python phenol_pka.py 10.168116455063156 ``` -------------------------------- ### from_xyz_file classmethod Source: https://docs.rowansci.com/api/python/v3/api/molecule Creates a molecule from an XYZ file. Allows optional specification of charge and multiplicity. ```python from_xyz_file( path: str | Path, charge: int | None = None, multiplicity: int | None = None, ) -> Self ``` -------------------------------- ### get_energies method Source: https://docs.rowansci.com/api/python/v3/workflows/spin-states Gets energies for each spin state. If relative is True, returns relative energies in kcal/mol relative to the ground state; otherwise returns absolute energies in Hartree. ```python get_energies(relative: bool = False) -> list[float] ``` -------------------------------- ### create_project Source: https://docs.rowansci.com/api/python/v3/api/project Creates a new project with the given name. ```APIDOC ## create_project ### Description Creates a new project with the given name. ### Method create_project ### Signature `create_project(name: str) -> Project` ### Parameters - **name** (str) - Required - Name of the project. ### Returns - **Project** - Newly created project. ``` -------------------------------- ### Submit Basic Calculation Workflow Source: https://docs.rowansci.com/api Use the low-level API to submit a basic energy calculation workflow. ```python import rowan from stjames import Molecule # rowan.api_key = "rowan-sk..." folder = rowan.get_folder("examples") workflow = rowan.submit_basic_calculation_workflow( initial_molecule=Molecule.from_smiles("CC(=O)OC"), name="methyl acetate energy", tasks=["energy"], method="gfn2_xtb", engine="xtb", folder=folder, ) result = workflow.result() print(result) ``` -------------------------------- ### get_path_energies method Source: https://docs.rowansci.com/api/python/v3/workflows/double-ended-ts-search Gets energies along the reaction path, sorted by distance. If `relative` is True, returns relative energies in kcal/mol relative to the lowest energy point; otherwise returns absolute energies in Hartree. ```python get_path_energies(relative: bool = False) -> list[float] ``` -------------------------------- ### Submit calculation with D3BJ correction Source: https://docs.rowansci.com/science/quantum-chemistry/methods-and-basis-sets/corrections Use the Rowan Python API to submit a B3LYP/vDZP calculation with the D3BJ correction for cyclopentane, including optimization and frequency tasks. Requires setting ROWAN_API_KEY as described in the Python API guide. ```python import rowan # load molecule from smiles molecule = rowan.Molecule.from_smiles("C1CCCC1") # cyclopentane # submit the calculation and wait for its result workflow = rowan.submit_basic_calculation_workflow( initial_molecule=molecule, name="opt cyclopentane", method=rowan.Method.B3LYP, basis_set="vDZP", corrections=[rowan.Correction.D3BJ], tasks=["optimize", "frequencies"], ) result = workflow.result() ``` -------------------------------- ### settings property Source: https://docs.rowansci.com/api/python/v3/workflows/relative-binding-free-energy-perturbation Accesses the FEP settings applied to the simulation. ```python settings: TMDRBFESettings ``` -------------------------------- ### submit_multistage_optimization_workflow Source: https://docs.rowansci.com/api/python/v3/workflows/multistage-optimization Submits a multistage-optimization workflow to the API. Defaults to a r2scan_3c//gfn2_xtb stack (GFN2-xTB optimization, r2SCAN-3c single point). Returns a Workflow object. ```APIDOC ## submit_multistage_optimization_workflow ### Description Submits a multistage-optimization workflow to the API. Defaults to a r2scan_3c//gfn2_xtb stack (GFN2-xTB optimization, r2SCAN-3c single point). ### Method POST (workflow submission) ### Endpoint Not specified (API endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **initial_molecule** (StructureInput) - Required - Molecule to optimize. - **optimization_settings** (Sequence[Settings] | None) - Optional - Optimization stages to apply in order. Default: None - **singlepoint_settings** (Settings | None) - Optional - Final singlepoint settings, applied after the last optimization stage. Default: None - **frequencies** (bool) - Optional - Whether to calculate frequencies on the last optimization step. Default: False - **transition_state** (bool) - Optional - Optimize to a transition state rather than a minimum. Applies to every optimization stage, so a transition-state guess is not relaxed to a minimum. Default: False - **name** (str) - Optional - Name of the workflow. Default: 'Multistage Optimization Workflow' - **folder_uuid** (str | None) - Optional - UUID of the folder to place the workflow in. Default: None - **folder** (Folder | None) - Optional - Folder object to store the workflow in. Default: None - **max_credits** (int | None) - Optional - Maximum number of credits to use for the workflow. Default: None - **webhook_url** (str | None) - Optional - URL that Rowan will POST to when the workflow completes. Default: None - **is_draft** (bool) - Optional - If True, submit the workflow as a draft without starting execution. Default: False ### Request Example { "initial_molecule": {}, "optimization_settings": null, "singlepoint_settings": null, "frequencies": false, "transition_state": false, "name": "Multistage Optimization Workflow", "folder_uuid": null, "folder": null, "max_credits": null, "webhook_url": null, "is_draft": false } ### Response #### Success Response (200) - **Workflow** (Workflow) - Workflow object representing the submitted workflow. #### Response Example { "workflow": {} } ### Error Handling - **requests.HTTPError** - if the request to the API fails. ``` -------------------------------- ### Submit a workflow with rowan.compute() Source: https://docs.rowansci.com/api/python Submits a workflow using the high-level compute API, automatically monitors its status, and returns the result when complete. The example uses a SMILES string for the molecule and specifies the redox_potential workflow type. The output shows the oxidation potential value printed from the result. ```python res = rowan.compute( name="benzene redox", molecule="c1ccccc1", workflow_type="redox_potential", ) print(res["object_data"]["oxidation_potential"]) # 2.7466429 ``` -------------------------------- ### batch_pka: Run pKa workflows on multiple molecules Source: https://docs.rowansci.com/api/rdkit Imports batch_pka, creates a list of molecules from SMILES, runs with mode='rapid', and prints results for each molecule. ```python from rowan.rowan_rdkit import batch_pka mols = [Chem.MolFromSmiles(s) for s in ["CCO", "CC(=O)O"]] results = batch_pka(mols, mode="rapid") for r in results: print(r["acidic_pkas"], r["basic_pkas"]) ``` -------------------------------- ### Submit geometry optimization with angle constraint using rowan Python API Source: https://docs.rowansci.com/quantum-chemistry/geometry-optimization Shows how to submit a geometry optimization with a constraint using the Rowan Python API. Requires setting ROWAN_API_KEY for authentication. The example creates a dimethyl ether molecule from SMILES and submits an optimization with an angle constraint on atoms 1, 2, and 3. ```python import rowan molecule = rowan.Molecule.from_smiles("COC") # dimethyl ether workflow = rowan.submit_basic_calculation_workflow( initial_molecule=molecule, name="dimethyl ether constraint optimization", method=rowan.Method.AIMNET2_WB97MD3, tasks=["optimize"], opt_settings={"constraints": [ {"constraint_type": "angle", "atoms": [1, 2, 3]}, ]}, ) result = workflow.result() ``` -------------------------------- ### Create project-scoped API key with Rowan Source: https://docs.rowansci.com/applications/user-facing-platform-integrations Creates a new Rowan project and a project-scoped API key with read_write scope, valid for 1 day. The key is returned in the created_key.key attribute. Use this for project-per-user or project-per-session patterns, passing the key to the isolated runtime and revoking it when no longer needed. ```python import rowan project = rowan.create_project(name=f"platform-session-{session_id}") created_key = rowan.create_api_key( name=f"platform-session-{session_id}", scope="read_write", valid_days=1, scoped_project_uuid=project.uuid, ) session_api_key = created_key.key ``` -------------------------------- ### create_folder(name: str, parent_uuid: str | None = None, notes: str = "", starred: bool = False, public: bool = False) -> Folder Source: https://docs.rowansci.com/api/python/v3/api/folder Create a new folder. If no parent_uuid is given and a project is active, the folder is created inside that project's root folder. ```APIDOC ## create_folder ### Description Create a new folder. If no parent_uuid is given and a project is active (via set_project or rowan.project_uuid), the folder is created inside that project's root folder. ### Method SDK Function ### Signature create_folder(name: str, parent_uuid: str | None = None, notes: str = "", starred: bool = False, public: bool = False) -> Folder ### Parameters - **name** (str) - Required - Name of the folder. - **parent_uuid** (str | None) - Optional - UUID of the parent folder. Default: None. - **notes** (str) - Optional - Description of the folder. Default: ''. - **starred** (bool) - Optional - Whether the folder is starred. Default: False. - **public** (bool) - Optional - Whether the folder is public. Default: False. ### Returns - **Folder** - Newly created folder. ``` -------------------------------- ### create_project function signature Source: https://docs.rowansci.com/api/python/v3/api/project Creates a new project with the given name. ```python create_project(name: str) -> Project ``` -------------------------------- ### download_files method signature Source: https://docs.rowansci.com/api/python/v3/workflows/msa Downloads MSA files for the workflow. Accepts an optional output format and path. Returns a list of paths to downloaded tar.gz files. Raises ValueError if the requested format wasn't in the original output_formats, and HTTPError if the API request fails. ```python download_files( format: MSAOutputFormat | MSAFormat | None = None, path: Path | str | None = None, ) -> list[Path] ``` -------------------------------- ### ETKDGSettings Source: https://docs.rowansci.com/api/python/v3/workflows/conformer-search-settings Settings for ETKDG conformer generation, including inherited screening, constraints, and NCI parameters, plus new parameters for initial conformers, optimization, and MMFF energy cutoffs. ```APIDOC ## ETKDGSettings ### Description Settings for ETKDG conformer generation. Inherits screening, constraints, NCI, and max_confs parameters. Adds parameters for initial conformers, considered conformers, final conformers, MMFF energy cutoff, and MMFF optimization iterations. ### Properties - **constraints** (array of Constraint) - Default: [] - Constraints for conformer generation. - **nci** (boolean) - Default: false - Add a constraining potential for non-covalent interactions (not supported in ETKDG). - **max_confs** (integer or null) - Default: null - Maximum number of conformers to keep. - **num_initial_confs** (integer) - Default: 300 - Number of initial conformers to generate. - **num_confs_considered** (integer) - Default: 100 - Number of conformers to consider for optimization. - **max_mmff_iterations** (integer) - Default: 500 - MMFF optimization iterations. - **max_mmff_energy** (number or null) - Default: 30 - MMFF energy cutoff. - **settings_type** (string) - Default: "etkdg" - Constant value "etkdg". ### Example ```json { "constraints": [], "nci": false, "max_confs": null, "num_initial_confs": 300, "num_confs_considered": 100, "max_mmff_iterations": 500, "max_mmff_energy": 30, "settings_type": "etkdg" } ``` ``` -------------------------------- ### submit_protein_preparation_workflow function signature Source: https://docs.rowansci.com/api/python/v3/workflows/protein-preparation Submits a protein-preparation workflow to the API. Full preparation can take around ten minutes. For a faster PDBFixer/OpenMM-only path, use Protein.prepare(). Raises ValueError for incompatible settings or invalid retained residue mappings, and requests.HTTPError if the API request fails. ```python submit_protein_preparation_workflow( protein: Protein | ProteinUUID, add_missing_method: Literal["boltz_2", "pdbfixer"] | None = "boltz_2", cap_residues: Literal["ace_nme", "terminal_templates"] | None = "ace_nme", protonation_method: Literal[ "openmm", "protonate_utils", "propka_3" ] = "openmm", pH: float = 7.4, retain_protonation: bool = True, retain_non_polymer: dict[str | int, str | None] | None = _DEFAULT_RETAIN_NON_POLYMER, name: str = "Protein Preparation Workflow", folder_uuid: str | None = None, folder: Folder | None = None, max_credits: int | None = None, webhook_url: str | None = None, is_draft: bool = False, ) -> Workflow ``` -------------------------------- ### conformers property Source: https://docs.rowansci.com/api/python/v3/workflows/docking Returns a list of UUID strings for optimized conformers. ```python conformers: list[str] ```