Skip to content

Commit

Permalink
update smiles strings (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiederm authored Jun 8, 2024
1 parent 2d727b1 commit be538dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions guardowl/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rdkit.Chem import AllChem


def generate_molecule_from_smiles(smiles: str) -> Optional[Chem.Mol]:
def generate_molecule_from_smiles(smiles: str) -> Chem.Mol:
"""
Generates an RDKit molecule instance from a SMILES string with added hydrogens and a generated 3D conformer.
Expand All @@ -24,12 +24,12 @@ def generate_molecule_from_smiles(smiles: str) -> Optional[Chem.Mol]:
molecule = Chem.MolFromSmiles(smiles)
if molecule is None:
log.error(f"Failed to generate molecule from SMILES: {smiles}")
return None
raise RuntimeError(f"Failed to generate molecule from SMILES: {smiles}")

molecule = Chem.AddHs(molecule)
if AllChem.EmbedMolecule(molecule) == -1:
log.error(f"Failed to generate 3D conformer for molecule: {smiles}")
return None
raise RuntimeError(f"Failed to generate 3D conformer for molecule: {smiles}")

return molecule

Expand Down
7 changes: 4 additions & 3 deletions scripts/test_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ tests:
- protocol: "small_molecule_test"
smiles:
[
r"CCOc1ccc2nc(/N=C\c3ccccc3O)sc2c1",
r"Cn1cc(Cl)c(/C=N/O)n1",
r"S=c1cc(-c2ccc(Cl)cc2)ss1",
'CCOc1ccc2nc(/N=C\c3ccccc3O)sc2c1',
'Cn1cc(Cl)c(/C=N/O)n1',
'S=c1cc(-c2ccc(Cl)cc2)ss1',
]
names: ["mol1", "mol2", "mol3"]
temperature: [300, 400, 500]
nr_of_simulation_steps: 500

Expand Down

0 comments on commit be538dc

Please sign in to comment.