Core API
Workflow Class and Functions
Workflow
Bases: BaseModel
A Rowan workflow.
Don’t instantiate this class directly. Instead use one of the submit workflow functions.
Workflow data is not loaded by default to avoid unnecessary downloads that could impact
performance. Call load_data()
to fetch and attach the workflow data to this Workflow
object.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the workflow. |
uuid |
str
|
The UUID of the workflow. |
created_at |
datetime
|
The date and time the workflow was created. |
updated_at |
datetime | None
|
The date and time the workflow was last updated. |
started_at |
datetime | None
|
The date and time the workflow computation was started. |
completed_at |
datetime | None
|
The date and time the workflow was completed. |
status |
Status
|
The status of the workflow. |
parent_uuid |
str
|
The UUID of the parent folder. |
notes |
str
|
Workflow notes. |
starred |
bool
|
Whether the workflow is starred. |
public |
bool
|
Whether the workflow is public. |
workflow_type |
str
|
The type of the workflow. |
data |
dict[str, Any]
|
The data of the workflow. |
email_when_complete |
bool
|
Whether the workflow should send an email when it is complete. |
max_credits |
int | None
|
The maximum number of credits to use for the workflow. |
elapsed |
float | None
|
The elapsed time of the workflow. |
credits_charged |
float
|
The number of credits charged for the workflow. ... |
fetch_latest
fetch_latest(in_place=False)
Loads workflow data from the database and updates the current instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_place
|
bool
|
Whether to update the current instance in-place. |
False
|
Returns:
Type | Description |
---|---|
Self
|
The updated instance (self). |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
update
update(
name=None,
parent_uuid=None,
notes=None,
starred=None,
email_when_complete=None,
public=None,
in_place=False,
)
Updates a workflow in the API with new data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
The new name of the workflow. |
None
|
parent_uuid
|
str | None
|
The UUID of the parent folder. |
None
|
notes
|
str | None
|
A description of the workflow. |
None
|
starred
|
bool | None
|
Whether the workflow is starred. |
None
|
email_when_complete
|
bool | None
|
Whether the workflow should send an email when it is complete. |
None
|
public
|
bool | None
|
Whether the workflow is public. |
None
|
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
wait_for_result
wait_for_result(poll_interval=5)
Wait for the workflow to finish.
This method will block until the workflow has finished computing. It will periodically poll the API to check the status of the workflow.
Returns:
Type | Description |
---|---|
Self
|
The current instance, with the workflow data loaded. |
get_status
get_status()
Gets the status of the workflow.
Returns:
Type | Description |
---|---|
Status
|
The status of the workflow, as an instance of stjames.Status. |
is_finished
is_finished()
Check if the workflow is finished.
This method checks the current status of the workflow and determines if it has completed, failed, or been stopped.
Returns:
Type | Description |
---|---|
bool
|
True if the workflow status is COMPLETED_OK, FAILED, or STOPPED; False otherwise. |
stop
stop()
Stops a workflow.
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
delete
delete()
Deletes the workflow.
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
delete_data
delete_data()
Deletes the workflow data from the API.
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
submit_workflow
submit_workflow(
workflow_type,
workflow_data=None,
initial_molecule=None,
initial_smiles=None,
name=None,
folder_uuid=None,
max_credits=None,
)
Submits a workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workflow_type
|
str
|
The type of workflow to submit. |
required |
workflow_data
|
dict[str, Any] | None
|
A dictionary containing the data required to run the workflow. |
None
|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol | None
|
A molecule object to use as the initial molecule in the workflow. At least one of a molecule or SMILES must be provided. |
None
|
initial_smiles
|
str | None
|
A SMILES string to use as the initial molecule in the workflow. At least one of a molecule or SMILES must be provided. |
None
|
name
|
str | None
|
A name to give to the workflow. |
None
|
folder_uuid
|
str | None
|
The UUID of the folder to store the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
ValueError
|
If neither |
HTTPError
|
If the API request fails. |
retrieve_workflow
retrieve_workflow(uuid)
Retrieves a workflow from the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uuid
|
str
|
The UUID of the workflow to retrieve. |
required |
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the retrieved workflow. |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
retrieve_calculation_molecules
retrieve_calculation_molecules(uuid)
Retrieves a list of molecules from a calculation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uuid
|
str
|
The UUID of the calculation to retrieve molecules from. |
required |
Returns:
Type | Description |
---|---|
list[dict[str, Any]]
|
A list of dictionaries representing the molecules in the calculation. |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
list_workflows
list_workflows(
parent_uuid=None,
name_contains=None,
public=None,
starred=None,
status=None,
workflow_type=None,
page=0,
size=10,
)
Lists workflows subject to the specified criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_uuid
|
str | None
|
The UUID of the parent folder. |
None
|
name_contains
|
str | None
|
Substring to search for in workflow names. |
None
|
public
|
bool | None
|
Filter workflows by their public status. |
None
|
starred
|
bool | None
|
Filter workflows by their starred status. |
None
|
status
|
int | None
|
Filter workflows by their status. |
None
|
workflow_type
|
str | None
|
Filter workflows by their type. |
None
|
page
|
int
|
The page number to retrieve. |
0
|
size
|
int
|
The number of items per page. |
10
|
Returns:
Type | Description |
---|---|
list[Workflow]
|
A list of Workflow objects that match the search criteria. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_basic_calculation_workflow
submit_basic_calculation_workflow(
initial_molecule,
method="uma_m_omol",
tasks=None,
mode="auto",
engine="omol25",
name="Basic Calculation Workflow",
folder_uuid=None,
max_credits=None,
)
Submit a basic calculation workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to perform the calculation on. |
required |
method
|
Method | str
|
The method to use for the calculation. See list of available methods for options. |
'uma_m_omol'
|
tasks
|
list[str] | None
|
A list of tasks to perform for the calculation. |
None
|
mode
|
str
|
The mode to run the calculation in. See list of available modes for options. |
'auto'
|
engine
|
str
|
The engine to use for the calculation. See list of available engines |
'omol25'
|
name
|
str
|
The name of the workflow. |
'Basic Calculation Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_conformer_search_workflow
submit_conformer_search_workflow(
initial_molecule,
conf_gen_mode="rapid",
final_method="aimnet2_wb97md3",
solvent=None,
transistion_state=False,
name="Conformer Search Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a conformer search workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to perform the conformer search on. |
required |
conf_gen_mode
|
str
|
The mode to use for conformer generation. See list of available modes for options. |
'rapid'
|
final_method
|
Method | str
|
The method to use for the final optimization. See list of available methods for options. |
'aimnet2_wb97md3'
|
solvent
|
str | None
|
The solvent to use for the final optimization. See the list of available solvents for valid values. Be aware that not all methods support solvents. |
None
|
transistion_state
|
bool
|
Whether to optimize the transition state. |
False
|
name
|
str
|
The name of the workflow. |
'Conformer Search Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_solubility_workflow
submit_solubility_workflow(
initial_smiles,
solvents=None,
temperatures=None,
name="Solubility Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a solubility workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_smiles
|
str
|
The smiles of the molecule to calculate the solubility of. |
required |
solvents
|
list[str] | None
|
The list of solvents to use for the calculation. |
None
|
temperatures
|
list[float] | None
|
The list of temperatures to use for the calculation. |
None
|
name
|
str
|
The name of the workflow. |
'Solubility Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_pka_workflow
submit_pka_workflow(
initial_molecule,
pka_range=(2, 12),
deprotonate_elements=None,
protonate_elements=None,
mode="careful",
name="pKa Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a pKa workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to calculate the pKa of. |
required |
pka_range
|
tuple[int, int]
|
The range of pKa values to calculate. |
(2, 12)
|
deprotonate_elements
|
list[int] | None
|
The elements to deprotonate. Given by atomic number. |
None
|
protonate_elements
|
list[int] | None
|
The elements to protonate. Given by atomic number. |
None
|
mode
|
str
|
The mode to run the calculation in. See list of available modes for options. |
'careful'
|
name
|
str
|
The name of the workflow. |
'pKa Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_redox_potential_workflow
submit_redox_potential_workflow(
initial_molecule,
reduction=False,
oxidization=True,
mode="rapid",
name="Redox Potential Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a redox potential workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to calculate the redox potential of. |
required |
reduction
|
bool
|
Whether to calculate the reduction potential. |
False
|
oxidization
|
bool
|
Whether to calculate the oxidization potential. |
True
|
mode
|
str
|
The mode to run the calculation in. See list of available modes for options. |
'rapid'
|
name
|
str
|
The name of the workflow. |
'Redox Potential Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_fukui_workflow
submit_fukui_workflow(
initial_molecule,
optimization_method="gfn2_xtb",
fukui_method="gfn1_xtb",
solvent_settings=None,
name="Redox Potential Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a fukui workflow to the API.
:optimization_method: The method to use for the optimization. :fukui_method: The method to use for the fukui calculation. :solvent_settings: The solvent settings to use for the fukui calculation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to calculate the fukui indices of. |
required |
name
|
str
|
The name of the workflow. |
'Redox Potential Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_tautomer_search_workflow
submit_tautomer_search_workflow(
initial_molecule,
mode="careful",
name="Tautomer Search Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a tautomer search workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to calculate the tautomers of. |
required |
mode
|
str
|
The mode to run the calculation in. See list of available modes for options. |
'careful'
|
name
|
str
|
The name of the workflow. |
'Tautomer Search Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_descriptors_workflow
submit_descriptors_workflow(
initial_molecule, name="Descriptors Workflow", folder_uuid=None, max_credits=None
)
Submits a descriptors workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule to calculate the descriptors of. |
required |
name
|
str
|
The name of the workflow. |
'Descriptors Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_scan_workflow
submit_scan_workflow(
initial_molecule,
scan_settings=None,
calculation_engine="omol25",
calculation_method="uma_m_omol",
wavefront_propagation=True,
name="Scan Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a scan workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol
|
The molecule used in the scan. |
required |
scan_settings
|
ScanSettings | dict[str, Any] | None
|
The scan settings. |
None
|
calculation_engine
|
str
|
The engine to use for the calculation. See list of available engines |
'omol25'
|
calculation_method
|
Method | str
|
The method to use for the calculation. See list of available methods for options. |
'uma_m_omol'
|
wavefront_propagation
|
bool
|
Whether to use wavefront propagation in the scan. |
True
|
name
|
str
|
The name of the workflow. |
'Scan Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to store the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_irc_workflow
submit_irc_workflow(
initial_molecule=None,
method="uma_m_omol",
engine="omol25",
preopt=True,
step_size=0.05,
max_irc_steps=30,
name="IRC Workflow",
folder_uuid=None,
max_credits=None,
)
Submits an Intrinsic Reaction Coordinate (IRC) workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol | None
|
The initial molecule to perform the IRC calculation on. |
None
|
method
|
Method | str
|
The computational method to use for the IRC calculation. See list of available methods for options. |
'uma_m_omol'
|
engine
|
str
|
The computational engine to use for the calculation. See list of available engines |
'omol25'
|
preopt
|
bool
|
Whether to perform a pre-optimization of the molecule. |
True
|
step_size
|
float
|
The step size to use for the IRC calculation. |
0.05
|
max_irc_steps
|
int
|
The maximum number of IRC steps to perform. |
30
|
name
|
str
|
The name of the workflow. |
'IRC Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted IRC workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_protein_cofolding_workflow
submit_protein_cofolding_workflow(
initial_protein_sequences,
initial_smiles_list=None,
ligand_binding_affinity_index=None,
use_msa_server=True,
use_potentials=False,
name="Cofolding Workflow",
model=stjames.CofoldingModel.BOLTZ_2.value,
folder_uuid=None,
max_credits=None,
)
Submits a protein cofolding workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_protein_sequences
|
list[str]
|
The sequences of the proteins to be cofolded. |
required |
initial_smiles_list
|
list[str] | None
|
A list of SMILES strings for the ligands to be cofolded with. |
None
|
ligand_binding_affinity_index
|
int | None
|
The index of the ligand for which to compute the binding affinity. |
None
|
use_msa_server
|
bool
|
Whether to use the MSA server for the computation. |
True
|
use_potentials
|
bool
|
Whether to use potentials for the computation. |
False
|
name
|
str
|
The name of the workflow. |
'Cofolding Workflow'
|
model
|
str
|
The model to use for the computation. |
value
|
folder_uuid
|
str | None
|
The UUID of the folder to store the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
submit_docking_workflow
submit_docking_workflow(
protein,
pocket,
initial_molecule=None,
do_csearch=True,
do_optimization=True,
name="Docking Workflow",
folder_uuid=None,
max_credits=None,
)
Submits a Docking workflow to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protein
|
str | Protein
|
The protein to dock. Can be fed as a uuid or a Protein object. |
required |
initial_molecule
|
dict[str, Any] | StJamesMolecule | RdkitMol | None
|
The initial molecule to be docked |
None
|
do_csearch
|
bool
|
Whether to perform a conformational search on the ligand. |
True
|
do_optimization
|
bool
|
Whether to perform an optimization on the ligand. |
True
|
name
|
str
|
The name of the workflow. |
'Docking Workflow'
|
folder_uuid
|
str | None
|
The UUID of the folder to place the workflow in. |
None
|
max_credits
|
int | None
|
The maximum number of credits to use for the workflow. |
None
|
Returns:
Type | Description |
---|---|
Workflow
|
A Workflow object representing the submitted IRC workflow. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
Folder Class and Functions
Folder
Bases: BaseModel
A class representing a folder in the Rowan API.
Attributes:
Name | Type | Description |
---|---|---|
uuid |
str
|
The UUID of the folder. |
name |
str | None
|
The name of the folder. |
parent_uuid |
str | None
|
The UUID of the parent folder. |
notes |
str
|
Folder notes. |
starred |
bool
|
Whether the folder is starred. |
public |
bool
|
Whether the folder is public. |
created_at |
datetime | None
|
The date and time the folder was created. |
fetch_latest
fetch_latest(in_place=False)
Fetch the latest folder data from the API.
This method refreshes the folder object with the latest data from the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_place
|
bool
|
Whether to update the current instance in-place. |
False
|
Returns:
Type | Description |
---|---|
Self
|
The updated instance (self). |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
update
update(name=None, parent_uuid=None, notes=None, starred=None, public=None)
Update a folder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
The new name of the folder. |
None
|
parent_uuid
|
str | None
|
The UUID of the new parent folder. |
None
|
notes
|
str | None
|
A description of the folder. |
None
|
starred
|
bool | None
|
Whether the folder is starred. |
None
|
public
|
bool | None
|
Whether the folder is public. |
None
|
Returns:
Type | Description |
---|---|
Self
|
The updated folder object. |
delete
delete()
Delete the folder and all its contents.
This is a destructive action, it will delete all the folders and workflows that are inside this folder.
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
retrieve_folder
retrieve_folder(uuid)
Retrieves a folder from the API by UUID. Folder UUID can be found in the folder's URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uuid
|
str
|
The UUID of the folder to retrieve. |
required |
Returns:
Type | Description |
---|---|
Folder
|
A Folder object representing the retrieved folder. |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
home_folder
home_folder()
Retrieves the home folder from the API.
Returns:
Type | Description |
---|---|
Folder
|
A Folder object representing the home folder. |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
list_folders
list_folders(
parent_uuid=None, name_contains=None, public=None, starred=None, page=0, size=10
)
Retrieve a list of folders based on the specified criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_uuid
|
str | None
|
UUID of the parent folder to filter by. |
None
|
name_contains
|
str | None
|
Substring to search for in folder names. |
None
|
public
|
bool | None
|
Filter folders by their public status. |
None
|
starred
|
bool | None
|
Filter folders by their starred status. |
None
|
page
|
int
|
Pagination parameter to specify the page number. |
0
|
size
|
int
|
Pagination parameter to specify the number of items per page. |
10
|
Returns:
Type | Description |
---|---|
list[Folder]
|
A list of Folder objects that match the search criteria. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
create_folder
create_folder(name, parent_uuid=None, notes='', starred=False, public=False)
Create a new folder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the folder. |
required |
parent_uuid
|
str | None
|
The UUID of the parent folder. |
None
|
notes
|
str
|
A description of the folder. |
''
|
starred
|
bool
|
Whether the folder is starred. |
False
|
public
|
bool
|
Whether the folder is public. |
False
|
Returns:
Type | Description |
---|---|
Folder
|
The newly created folder. |
User Class and Functions
Organization
Bases: BaseModel
A Rowan organization
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the organization. |
weekly_credits |
float | None
|
The weekly credits of the organization. |
credits |
float | None
|
The credits of the organization. |
OrganizationRole
Bases: BaseModel
A Rowan organization role
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the organization role. |
SubscriptionPlan
Bases: BaseModel
A Rowan subscription plan
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the subscription plan. |
IndividualSubscription
Bases: BaseModel
A Rowan individual subscription
Attributes:
Name | Type | Description |
---|---|---|
subscription_plan |
SubscriptionPlan
|
The subscription plan of the individual subscription. |
User
Bases: BaseModel
A Rowan user
Attributes:
Name | Type | Description |
---|---|---|
uuid |
str
|
The UUID of the user. |
username |
str
|
The username of the user. |
email |
str
|
The email of the user. |
firstname |
str | None
|
The first name of the user. |
lastname |
str | None
|
The last name of the user. |
weekly_credits |
float | None
|
The weekly credits of the user. |
credits |
float | None
|
The credits of the user. |
billing_name |
str | None
|
The billing name of the user. |
billing_address |
str | None
|
The billing address of the user. |
credit_balance_warning |
float | None
|
The credit balance warning of the user. |
organization |
Organization | None
|
The organization of the user. |
organization_role |
OrganizationRole | None
|
The organization role of the user. |
individual_subscription |
IndividualSubscription | None
|
The individual subscription of the user. |
credits_available_string
credits_available_string()
Returns a string showing available credits, including organization credits if applicable
Returns:
Type | Description |
---|---|
str
|
A string showing available credits |
whoami
whoami()
Returns the current user
Protein Class and Functions
Protein
Bases: BaseModel
A Rowan protein.
Data is not loaded by default to avoid unnecessary downloads that could impact performance.
Call load_data()
to fetch and attach the protein data to this Protein
object.
Attributes:
Name | Type | Description |
---|---|---|
uuid |
str
|
The UUID of the protein |
created_at |
datetime | None
|
The creation date of the protein |
used_in_workflow |
bool | None
|
Whether the protein is used in a workflow |
ancestor_uuid |
str | None
|
The UUID of the ancestor protein |
sanitized |
int | None
|
Whether the protein is sanitized |
name |
str | None
|
The name of the protein |
data |
dict | None
|
The data of the protein |
public |
bool | None
|
Whether the protein is public |
refresh
refresh(in_place=True)
Loads protein data
Returns:
Type | Description |
---|---|
Self
|
protein with loaded data |
update
update(name=None, data=None, public=None, pocket=None)
Updates protein data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
The new name of the protein |
None
|
data
|
dict | None
|
The new data of the protein |
None
|
public
|
bool | None
|
Whether the protein is public |
None
|
pocket
|
list[list[float]] | None
|
The new pocket of the protein |
None
|
Returns:
Type | Description |
---|---|
Self
|
The updated protein object |
delete
delete()
Deletes a protein
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails |
sanitize
sanitize()
Sanitizes a protein
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails |
retrieve_protein
retrieve_protein(uuid)
Retrieves a protein from the API using its UUID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uuid
|
str
|
The UUID of the protein to retrieve. |
required |
Returns:
Type | Description |
---|---|
Protein
|
A Protein object representing the retrieved protein. |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails. |
list_proteins
list_proteins(ancestor_uuid=None, name_contains=None, page=0, size=20)
List proteins
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ancestor_uuid
|
str | None
|
The UUID of the ancestor protein to filter by |
None
|
name_contains
|
str | None
|
Substring to search for in protein names |
None
|
page
|
int
|
The page number to retrieve |
0
|
size
|
int
|
The number of items per page |
20
|
Returns:
Type | Description |
---|---|
list[Protein]
|
A list of Protein objects that match the search criteria |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails |
upload_protein
upload_protein(name, file_path)
Uploads a protein from a PDB file to the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the protein to create |
required |
file_path
|
Path
|
The path to the PDB file to upload |
required |
Returns:
Type | Description |
---|---|
Protein
|
A Protein object representing the uploaded protein |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails |
create_protein_from_pdb_id
create_protein_from_pdb_id(name, code)
Creates a protein from a PDB ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the protein to create |
required |
code
|
str
|
The PDB ID of the protein to create |
required |
Returns:
Type | Description |
---|---|
Protein
|
A Protein object representing the created protein |
Raises:
Type | Description |
---|---|
requests.HTTPError
|
if the request to the API fails |
Utilities
get_api_key
get_api_key()
Get the API key from the environment variable ROWAN_API_KEY or the module-level attribute rowan.api_key.
If neither of these are set, raise a ValueError with a helpful message.
Returns:
Type | Description |
---|---|
str
|
The API key. |
smiles_to_stjames
smiles_to_stjames(smiles)
Convert a SMILES string to a stjames.Molecule
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
smiles
|
str
|
A string representing the SMILES notation of the molecule. |
required |
Returns:
Type | Description |
---|---|
Molecule
|
A |
api_client
api_client()
Wraps httpx.Client
with Rowan-specific kwargs.