zaixizhang / MGSSL

Official implementation of NeurIPS'21 paper"Motif-based Graph Self-Supervised Learning for Molecular Property Prediction"
Apache License 2.0
107 stars 15 forks source link

Questions about motifs #1

Closed toooooodo closed 1 year ago

toooooodo commented 2 years ago

Hi, I wonder if there are ovelapping atoms between motifs in one molecule? I run the following script

from moltree import MolTree
smiles = "O=C1[C@@H]2C=C[C@@H](C=CC2)C1(c1ccccc1)c1ccccc1"
mol = MolTree(smiles)
atom_count = 0
for c in mol.nodes:
    atom_count += c.mol.GetNumAtoms()
    print(c.mol.GetNumAtoms())
    print(c.clique)
print(f"atoms in original mol: {mol.mol.GetNumAtoms()}, atoms in motifs: {atom_count}")

And the output is:

2
[0, 1]
2
[9, 10]
2
[9, 16]
9
[1, 2, 3, 4, 5, 6, 7, 8, 9]
6
[11, 12, 13, 14, 15, 10]
6
[17, 18, 19, 20, 21, 16]
1
[9]
atoms in original mol: 22, atoms in motifs: 28
zaixizhang commented 1 year ago

Hi, thanks for your interest in our work! Yes, there may be overlapping atoms between motifs in one molecule.