I want to search some crystals that have intermolecular Halogen bond. I didnt find built-in approaches to search intermolecular Halogen bond in python API.

So I used the following codes, but got noting:

def Halogenbond():

    list_Halogenbond = []
    donor_element = ['C', 'c']
    x_element = ['Br', 'I']
    acceptor_element = ['H', 'N', 'O', 'F', 'S', 'Cl']
    VDW_radius = {'n':1.55, 'N':1.55, 'o':1.52, 'O':1.52, 's':1.80, 'S':1.80, 'Cl':1.75, 'Br':1.85,
                              'I':1.98, 'C':1.70, 'H':1.09, 'F':1.47, 'c':1.70}

    for d in donor_element:

        for x in x_element:

            xd = x+d
            for a in acceptor_element:

                bond_search = ccdc.search.SubstructureSearch()
                donor_sub = ccdc.search.SMARTSSubstructure(xd)
                acceptor_sub = ccdc.search.SMARTSSubstructure(a)
                print(xd, a)
                donor_sub_id = bond_search.add_substructure(donor_sub)
                acceptor_sub_id = bond_search.add_substructure(acceptor_sub)
                bond_search.add_distance_constraint('DIST1',
                                                                              donor_sub_id, 0, 
                                                                              acceptor_sub_id, 0,
                                                                              (0.0, VDW_radius[d]+VDW_radius[x]+0.1), 
                                                                              'Intermolecular') 

                bond_search.add_angle_constraint('ANG1', 
                                                                          donor_sub_id, 1,
                                                                          donor_sub_id, 0,
                                                                          acceptor_sub_id, 0,
                                                                          (120.0, 180.0))

                list_Halogenbond.append(bond_search)

    return list_Halogenbond

For example, I search in ISIJEZ01:

list_Halogenbond = Halogenbond()

cry = csd_reader.crystal('ISIJEZ01')
ent = csd_reader.entry('ISIJEZ01')
mol = csd_reader.molecule('ISIJEZ01')

l = []

for i in list_Halogenbond:

    l.extend( i.search(mol))

print(l)

out:

[]

I have searched all crystals in CSD, but the result is nothing

is something wrong with my approach for defining Halogen bond ?

 

    

 

I think you may not be searching for exactly what you want.  You search  successively for HC Br, HC I, NC Br, etc.  The following script is how I would cast your problem:

from ccdc import io, search
csd = io.EntryReader('csd')
crystal = csd.crystal('ISIJEZ01')

poss_donors = ['C', 'c', 'N', 'O']
poss_acceptors = ['Br', 'I']
vdw_radius = {
    'Br' : 1.85,
    'I'  : 1.98,
    'N'  : 1.55,
    'n'  : 1.55,
    'O'  : 1.52,
    'o'  : 1.52,
    'C'  : 1.70,
    'c'  : 1.70,
}



all_hits = []
for d in poss_donors:
    for a in poss_acceptors:
        searcher = search.SubstructureSearch()
        searcher.add_substructure(search.SMARTSSubstructure(d + 'H'))
        searcher.add_substructure(search.SMARTSSubstructure(a))
        searcher.add_distance_constraint('DIST1', (0, 1), (1, 0), (0.0, vdw_radius[a] + vdw_radius[d]), 'intermolecular', vdw_corrected=False)
        searcher.add_angle_constraint('ANG1', (0, 0), (0, 1), (1, 0), (120, 180))
        all_hits.extend(searcher.search(crystal))


print '\n'.join(str(h.match_atoms()) for h in all_hits)


[Atom(C1), Atom(H1), Atom(I1)]
[Atom(C2), Atom(H2), Atom(I1)]
[Atom(C3), Atom(H3), Atom(I1)]
[Atom(C4), Atom(H4), Atom(I1A)]

Note that the distance constraint is between the donated H and the acceptor, and the angle is D-H-A.  This finds four hits as shown above.
You may prefer to use Van der Waals correction on the distance constraint, which will automatically take care of the element types involved in the match:

searcher.add_distance_constraint('DIST1', (0, 1), (1, 0), (-5, 0), 'intermolecular', vdw_corrected=True)

Hope this is helpful, and please continue to ask me anything.

 

Best wishes

Richard

You must be signed in to post in this forum.