-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SMILES naming fix and associated tests (#236)
* Add tests and SMILES naming fix * Cleanup
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2024 Chai Discovery, Inc. | ||
# Licensed under the Apache License, Version 2.0. | ||
# See the LICENSE file for details. | ||
|
||
from chai_lab.data.sources.rdkit import RefConformerGenerator | ||
|
||
|
||
def test_ref_conformer_from_smiles(): | ||
"""Test ref conformer generation from SMILES.""" | ||
smiles = "Cc1cc2nc3c(=O)[nH]c(=O)nc-3n(C[C@H](O)[C@H](O)[C@H](O)CO)c2cc1C" | ||
rcg = RefConformerGenerator() | ||
|
||
conformer = rcg.generate(smiles) | ||
|
||
assert len(set(conformer.atom_names)) == conformer.num_atoms | ||
|
||
|
||
def test_ref_conformer_glycan_ccd(): | ||
"""Ref conformer from CCD code for a sugar ring.""" | ||
rcg = RefConformerGenerator() | ||
conformer = rcg.get("MAN") | ||
assert conformer is not None | ||
|
||
assert len(set(conformer.atom_names)) == conformer.num_atoms |