Platform wheels for RDKit - a comprehensive cheminformatics and machine-learning library with Python bindings
89
Build a molecular weight analysis tool that processes chemical structures and calculates their molecular weights.
Your tool should provide functionality to:
Your tool should accept:
For individual molecules, return:
For batch processing, return structured data containing:
CN1C=NC2=C1C(=O)N(C(=O)N2C)C) and verify it returns approximately 194.19 g/mol @test@generates
def calculate_molecular_weight(smiles: str) -> float:
"""
Calculate the standard molecular weight of a molecule from its SMILES string.
Args:
smiles: SMILES string representing the molecule
Returns:
Standard molecular weight in g/mol
Raises:
ValueError: If the SMILES string is invalid
"""
pass
def calculate_exact_molecular_weight(smiles: str) -> float:
"""
Calculate the exact molecular weight of a molecule from its SMILES string.
Args:
smiles: SMILES string representing the molecule
Returns:
Exact molecular weight in g/mol
Raises:
ValueError: If the SMILES string is invalid
"""
pass
def analyze_molecules(smiles_list: list[str]) -> list[dict]:
"""
Analyze multiple molecules and return their molecular weight information.
Args:
smiles_list: List of SMILES strings
Returns:
List of dictionaries containing:
- 'smiles': the SMILES string
- 'molecular_weight': standard molecular weight
- 'exact_molecular_weight': exact molecular weight
"""
pass
def filter_by_weight(smiles_list: list[str], min_weight: float, max_weight: float) -> list[str]:
"""
Filter molecules by molecular weight range.
Args:
smiles_list: List of SMILES strings
min_weight: Minimum molecular weight threshold (g/mol)
max_weight: Maximum molecular weight threshold (g/mol)
Returns:
List of SMILES strings for molecules within the weight range
"""
passProvides cheminformatics capabilities for molecular analysis.
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