predict_solubility
Predict aqueous solubility and permeability properties of compounds using ChEMBL compound IDs or SMILES strings for insights into drug development and chemical analysis.
Instructions
Predict aqueous solubility and permeability properties
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chembl_id | No | ChEMBL compound ID | |
| smiles | No | SMILES string (alternative to ChEMBL ID) |
Implementation Reference
- src/index.ts:1584-1673 (handler)The main handler function that implements the predict_solubility tool logic. Fetches molecule properties from ChEMBL API and performs a rule-based prediction of aqueous solubility class and permeability based on logP, PSA, MW, HBD, HBA.private async handlePredictSolubility(args: any) { if (!args || (!args.chembl_id && !args.smiles)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid solubility prediction arguments'); } try { let molecule; if (args.chembl_id) { const response = await this.apiClient.get(`/molecule/${args.chembl_id}.json`); molecule = response.data; } else { return { content: [ { type: 'text', text: JSON.stringify({ message: 'SMILES-based solubility prediction requires ChEMBL ID', smiles: args.smiles, }, null, 2), }, ], }; } const props = molecule.molecule_properties || {}; // Predict solubility based on molecular properties const logp = props.alogp || 0; const psa = props.psa || 0; const mw = props.full_mwt || props.molecular_weight || 0; const hbd = props.hbd || 0; const hba = props.hba || 0; // Simple solubility prediction model let solubilityClass = 'Moderate'; let permeability = 'Moderate'; if (logp < 0 && psa > 100) { solubilityClass = 'High'; permeability = 'Low'; } else if (logp > 5 || psa < 40) { solubilityClass = 'Low'; permeability = 'High'; } else if (logp > 3 && psa < 70) { solubilityClass = 'Low-Moderate'; permeability = 'High'; } else if (logp < 2 && psa > 80) { solubilityClass = 'Moderate-High'; permeability = 'Low-Moderate'; } const solubilityPrediction = { chembl_id: molecule.molecule_chembl_id, aqueous_solubility: { predicted_class: solubilityClass, logp: logp, psa: psa, factors: { lipophilicity: logp > 3 ? 'High (reduces solubility)' : 'Moderate', polar_surface_area: psa > 100 ? 'High (increases solubility)' : 'Moderate', hydrogen_bonding: `${hbd} donors, ${hba} acceptors`, }, }, permeability: { predicted_class: permeability, assessment: this.assessPermeability(props), }, molecular_properties: { molecular_weight: mw, alogp: logp, psa: psa, hbd: hbd, hba: hba, }, }; return { content: [ { type: 'text', text: JSON.stringify(solubilityPrediction, null, 2), }, ], }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to predict solubility: ${error instanceof Error ? error.message : 'Unknown error'}` ); }
- src/index.ts:661-670 (schema)Input schema definition for the predict_solubility tool, defining optional chembl_id or smiles parameters.name: 'predict_solubility', description: 'Predict aqueous solubility and permeability properties', inputSchema: { type: 'object', properties: { chembl_id: { type: 'string', description: 'ChEMBL compound ID' }, smiles: { type: 'string', description: 'SMILES string (alternative to ChEMBL ID)' }, }, required: [], },
- src/index.ts:791-792 (registration)Registration of the predict_solubility tool handler in the main tool dispatch switch statement.case 'predict_solubility': return await this.handlePredictSolubility(args);
- src/index.ts:1676-1686 (helper)Helper function used by predict_solubility to assess membrane permeability based on PSA and logP.private assessPermeability(props: any): string { const psa = props.psa || 0; const logp = props.alogp || 0; if (psa < 90 && logp > 0 && logp < 5) { return 'Good membrane permeability predicted'; } else if (psa > 140 || logp < -1) { return 'Poor membrane permeability predicted'; } return 'Moderate membrane permeability predicted'; }