Platform wheels for RDKit - a comprehensive cheminformatics and machine-learning library with Python bindings
89
Build a tool that analyzes chemical compounds by breaking them down into meaningful structural fragments and provides insights about their composition.
Your tool should:
Your program should provide:
Input: CCO (ethanol)
Expected behavior: Should successfully fragment the molecule and return a list of fragments
@test
Input: CC(C)Cc1ccc(cc1)C(C)C(O)=O (ibuprofen)
Expected behavior: Should fragment into multiple chemically sensible fragments
@test
Input: INVALID (invalid SMILES string)
Expected behavior: Should handle the error gracefully and return an appropriate message
@test
@generates
def fragment_molecule(smiles: str) -> dict:
"""
Fragments a molecule into chemically meaningful pieces.
Args:
smiles: A SMILES string representing the molecule
Returns:
A dictionary containing:
- 'fragments': list of unique fragment SMILES strings (empty list if error)
- 'count': total number of unique fragments (0 if error)
- 'error': error message string if input is invalid, None otherwise
"""
passProvides cheminformatics capabilities for molecular analysis and fragmentation.
Install with Tessl CLI
npx tessl i tessl/pypi-rdkitevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10