Skip to content

Commit

Permalink
fixed single atom molecule issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Wengong Jin committed Aug 1, 2018
1 parent 8f4ee78 commit 2aab08a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jtnn/chemutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def get_clique_mol(mol, atoms):

def tree_decomp(mol):
n_atoms = mol.GetNumAtoms()
if n_atoms == 1:
return [[0]], []

cliques = []
for bond in mol.GetBonds():
a1 = bond.GetBeginAtom().GetIdx()
Expand Down Expand Up @@ -330,6 +333,8 @@ def dfs_assemble(cur_mol, global_amap, fa_amap, cur_node, fa_node):
lg.setLevel(rdkit.RDLogger.CRITICAL)

smiles = ["O=C1[C@@H]2C=C[C@@H](C=CC2)C1(c1ccccc1)c1ccccc1","O=C([O-])CC[C@@]12CCCC[C@]1(O)OC(=O)CC2", "ON=C1C[C@H]2CC3(C[C@@H](C1)c1ccccc12)OCCO3", "C[C@H]1CC(=O)[C@H]2[C@@]3(O)C(=O)c4cccc(O)c4[C@@H]4O[C@@]43[C@@H](O)C[C@]2(O)C1", 'Cc1cc(NC(=O)CSc2nnc3c4ccccc4n(C)c3n2)ccc1Br', 'CC(C)(C)c1ccc(C(=O)N[C@H]2CCN3CCCc4cccc2c43)cc1', "O=c1c2ccc3c(=O)n(-c4nccs4)c(=O)c4ccc(c(=O)n1-c1nccs1)c2c34", "O=C(N1CCc2c(F)ccc(F)c2C1)C1(O)Cc2ccccc2C1"]
mol_tree = MolTree("C")
assert len(mol_tree.nodes) > 0

def tree_test():
for s in sys.stdin:
Expand Down

0 comments on commit 2aab08a

Please sign in to comment.