Calculate advanced molecular descriptors including shape indices, connectivity indices, and structural features for QSAR and drug discovery.
Use the same ChemicalToolsClient class as defined in the molecular-properties-calculation skill.
This workflow calculates advanced molecular descriptors used in QSAR modeling, drug discovery, and computational chemistry.
Workflow Steps:
Implementation:
## Initialize client
HEADERS = {"SCP-HUB-API-KEY": "<your-api-key>"}
client = ChemicalToolsClient(
"https://scp.intern-ai.org.cn/api/v1/mcp/31/SciToolAgent-Chem",
HEADERS
)
if not await client.connect():
print("connection failed")
exit()
## Input: SMILES string to analyze
smiles = "CCO" # Ethanol
print(f"=== Molecular Descriptors for {smiles} ===\n")
## Step 1: Calculate Kappa shape indices
print("Step 1: Kappa Shape Indices")
for tool in ["GetKappa1", "GetKappa2", "GetKappa3"]:
result = await client.client.call_tool(
tool,
arguments={"smiles": smiles}
)
result_data = client.parse_result(result)
print(f"{tool}: {result_data}")
print()
## Step 2: Calculate Chi connectivity indices
print("Step 2: Chi Connectivity Indices")
for tool in ["GetChi0n", "GetChi0v", "GetChi1n", "GetChi1v"]:
result = await client.client.call_tool(
tool,
arguments={"smiles": smiles}
)
result_data = client.parse_result(result)
print(f"{tool}: {result_data}")
print()
## Step 3: Calculate structural features
print("Step 3: Structural Features")
# Rotatable bonds
result = await client.client.call_tool(
"GetRotatableBondsNum",
arguments={"smiles": smiles}
)
print(f"Rotatable bonds: {client.parse_result(result)}")
# Hydrogen bond donors and acceptors
result = await client.client.call_tool(
"GetHBDNum",
arguments={"smiles": smiles}
)
print(f"H-bond donors: {client.parse_result(result)}")
result = await client.client.call_tool(
"GetHBANum",
arguments={"smiles": smiles}
)
print(f"H-bond acceptors: {client.parse_result(result)}")
# Ring counts
result = await client.client.call_tool(
"GetRingsNum",
arguments={"smiles": smiles}
)
print(f"Number of rings: {client.parse_result(result)}")
result = await client.client.call_tool(
"GetAromaticRingsNum",
arguments={"smiles": smiles}
)
print(f"Aromatic rings: {client.parse_result(result)}")
print()
## Step 4: Calculate physicochemical descriptors
print("Step 4: Physicochemical Descriptors")
# LogP and molar refractivity (Crippen descriptors)
result = await client.client.call_tool(
"GetCrippenDescriptors",
arguments={"smiles": smiles}
)
print(f"Crippen descriptors (LogP, MR): {client.parse_result(result)}")
# Topological polar surface area
result = await client.client.call_tool(
"CalculateTPSA",
arguments={"smiles": smiles}
)
print(f"TPSA: {client.parse_result(result)}")
# Fraction of sp3 carbons
result = await client.client.call_tool(
"GetFractionCSP3",
arguments={"smiles": smiles}
)
print(f"Fraction sp3 carbons: {client.parse_result(result)}")
print()
await client.disconnect()
SciToolAgent-Chem Server:
Shape Descriptors:
GetKappa1, GetKappa2, GetKappa3: Kappa shape indices (molecular shape)Connectivity Indices:
GetChi0n, GetChi0v: Zero-order chi indicesGetChi1n, GetChi1v: First-order chi indicesGetChi2n, GetChi2v: Second-order chi indicesGetChi3n, GetChi3v, GetChi4n, GetChi4v: Higher-order chi indicesStructural Features:
GetRotatableBondsNum: Count rotatable bonds (flexibility)GetHBDNum/GetHBANum: Hydrogen bond donors/acceptorsGetRingsNum: Total ring countGetAromaticRingsNum: Aromatic ring countGetAliphaticRingsNum: Aliphatic ring countPhysicochemical Descriptors:
GetCrippenDescriptors: LogP (lipophilicity) and molar refractivityCalculateTPSA: Topological polar surface areaGetFractionCSP3: Fraction of sp³ hybridized carbonsGetLabuteASA: Labute accessible surface areaInput:
smiles: Molecule in SMILES formatOutput:
Kappa Shape Indices
Chi Connectivity Indices
Structural Features
Physicochemical Descriptors
Lipinski's Rule of Five:
Veber's Rules (Oral Bioavailability):
CNS Drug-Likeness:
The SciToolAgent-Chem server provides 160+ tools including:
GetBCUT: BCUT descriptorsGetAutocorrelation2D/GetAutocorrelation3D: Autocorrelation descriptorsGetWHIM: WHIM descriptorsGetGETAWAY: GETAWAY descriptorsGetMORSE: MORSE descriptorsGetRDF: Radial distribution functionGetUSR/GetUSRCAT: Ultrafast shape recognition descriptors