Platform wheels for RDKit - a comprehensive cheminformatics and machine-learning library with Python bindings
89
Build a molecular similarity search tool that can find structurally similar molecules from a dataset based on their chemical fingerprints. The tool should accept a query molecule and return the most similar molecules ranked by similarity score.
Your implementation should:
Given a query molecule "CCO" (ethanol) and a dataset containing ["CCCO", "CC", "c1ccccc1"], when searching with threshold 0.3:
@test
Given a query molecule "CC(=O)O" (acetic acid), a target list containing similar molecules, and custom parameters (radius=3, nbits=1024):
@test
Given a query molecule "CCO", a target list ["c1ccccc1", "c1ccc2ccccc2c1"], and threshold=0.8:
@test
@generates
def find_similar_molecules(
query_smiles: str,
target_smiles_list: list[str],
threshold: float = 0.5,
radius: int = 2,
nbits: int = 2048
) -> list[dict]:
"""
Find molecules similar to the query molecule.
Args:
query_smiles: SMILES string of the query molecule
target_smiles_list: List of SMILES strings to search
threshold: Minimum similarity score (0-1) to include in results
radius: Fingerprint radius parameter (default: 2)
nbits: Fingerprint bit length (default: 2048)
Returns:
List of dicts with keys 'smiles' and 'similarity', sorted by similarity descending
"""
passProvides cheminformatics functionality for molecular fingerprint generation and similarity calculations.
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