Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the function to output the number of molecules according to vdw contact #169

Closed
qzhu2017 opened this issue Nov 21, 2021 · 2 comments
Closed

Comments

@qzhu2017
Copy link
Collaborator

output

  • the neighboring molecular information
  • the molecular cluster (center, 1st shell, 2nd shell)
@qzhu2017
Copy link
Collaborator Author

qzhu2017 commented Nov 23, 2021

from pyxtal import pyxtal

c = pyxtal(molecular=True)
cif_path = 'pyxtal/database/cifs/'

for name in ["aspirin", "WEXBOS", "MERQIM", "LAGNAL", "YICMOP", "LUFHAW", \
             "coumarin", "HAHCOI", "JAPWIH", "AXOSOW01", "PAHYON01", \
             "xxvi", "resorcinol", 
             ]:
 
    c.from_seed(seed=cif_path+name+".cif", molecules=[name])
    #print(c)
    for f in [1.5]:
        for i in range(len(c.mol_sites)):
            ds, neighs = c.get_neighboring_molecules(i, f)
            print(name, 'site', i, 'factor', f, len(ds), min(ds), max(ds))
                
data = [
        ("DNNAPH.cif", 'C1=CC2=C(C=CC=C2[N+](=O)[O-])C(=C1)[N+](=O)[O-]'),
        ("HCLBNZ.cif", 'C1(=C(C(=C(C(=C1Cl)Cl)Cl)Cl)Cl)Cl'),
        ("ADAMAN08.cif", 'C1C2CC3CC1CC(C2)C3'),
        ("HXMTAM.cif", 'C1N2CN3CN1CN(C2)C3'),
        ("ACETYL02.cif", 'C#C'),
        ("ZZZWOU01.cif", 'C1(=C(C(=C(C(=C1N)N)N)N)N)N'),
        ("HCCYHB.cif", "C1(C(C(C(C(C1Cl)Cl)Cl)Cl)Cl)Cl"),
        ("CONGRS.cif", "C1C2CC3C4C1C5CC(C4)CC3C5C2"),
       ]


cif_path = 'pyxtal/database/packing-analysis/'
for d in data:
    (name, smi) = d
    try:
        c.from_seed(cif_path+name, [smi+'.smi'])
    except:
        c.from_seed(cif_path+name, [smi+'.smi'], add_H=True)
    #print(c)

    for f in [1.5]:
        ds, neighs = c.get_neighboring_molecules(0, f)
        if len(ds) > 0:
            print(name, 'factor', f, len(ds), min(ds), max(ds))

@qzhu2017
Copy link
Collaborator Author

qzhu2017 commented Nov 27, 2021

  • add a show function to visualize the molecular cluster.
  • compute the fingerprint for the molecular cluster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant