• RE: Hbond Graph set analysis

     Hi Yizu,

    the API can certainly analyse graph sets from an arbitrary crystal, so I suspect something else is going wrong.  Quite possibly it is that the experimental crystal you are using missing hydrogens or inappropriate bond types.  You can fix this by:

    mol = exp.molecule
    mol.assign_bond_types()
    mol.add_hydrogens()
    cry.molecule = mol
    graph_sets = GSA.search(cry)

    Let me know if this works.  If not, can you post the experimental structure, and I'll see if I can help further.

    Best wishes
    Richard

     

  • RE: Hbond Graph set analysis

    Hi Yizu,

    you can use ccdc.descriptors.CrystalDescriptors.GraphSetSearch:

    https://downloads.ccdc.cam.ac.uk/documentation/API/modules/descriptors_api.html?highlight=graphsets#ccdc.descriptors.CrystalDescriptors.GraphSetSearch

    You can call its search() method with a crystal read in from a CrystalReader.

    Hope this is helpful.

    Best wishes
    Richard

     

  • RE: Find bond distance with crystal structure.

    Hi,

    if you want all the bond lengths within the unit cell, then you can do this by instantiating the crystal's molecule and measuring the the distances between the bonds' atoms.  For example,

    from ccdc import io, descriptors

    csd = io.EntryReader('csd')
    crystal = csd.crystal('AABHTZ')
    mol = crystal.molecule
    for b in mol.bonds:
        print('%s-%s: %.2f' % (b.atoms[0], b.atoms[1], descriptors.MolecularDescriptors.atom_distance(b.atoms[0], b.atoms[1])))

    Please let me know if I have misunderstood your problem.

    Best wishes
    Richard

     

  • RE: Setting Van der Waals Distance

    Hi,

    I'm afraid the API cannot change the Van der Waals radius of elements. 

    You may be able to calculate something approaching a  packing coefficient from the Grid class in utilities, by constructing a grid large enough to contain your crystal, populating it using Grid.set_sphere() then counting the non-zero values with Grid.count_grid().  This would not be a genuine packing coefficient since the Grid class is orhonormal, so you may need to do some normalisation of the resulting coefficient with respect to the unit cell volume and the Grid volume.  If your purpose is to compare packing coeffients of structures this pseudo-packing-coefficient may be useful.

    Best wishes
    Richard

     

  • RE: Altering crystal structures

    Dear Toms,

    the expression 'entry.molecule' will fetch a fresh copy of the molecule from the entry every time which is why you are not seeing any changes to the molecule.  Instead you should do something like:

    crystal = entry.crystal
    original_molecule = crystal.molecule
    new_molecule = molecule.Molecule(original_molecule.identifier)
    for component in original_molecule.components:
        # Do your editing on this component
        new_molecule.add_molecule(component)
    crystal.molecule = new_molecule

    Hope this helps.  If anything is unclear, please get back to me.
    Best wishes
    Richard

  • RE: Setting Van der Waals Distance

    Hi,

    on second thoughts, you could replace those atoms in the crystal with a different atom type whose Van der Waals radius is more suitable.  For example,

    from ccdc import io
    csd = io.EntryReader('csd')
    crystal = csd.crystal('AABHTZ')
    print(crystal.packing_coefficient)

    mol = crystal.molecule
    for a in mol.atoms:
        if a.atomic_symbol == 'Cl':
            a.atomic_symbol = 'U'
    crystal.molecule = mol
    print(crystal.packing_coefficient)

    This increases the packing coefficient from 0.70 to 0.72.

    Would this work in your case?

    Best wishes
    Richard

  • RE: Setting Van der Waals Distance

    Hi,

    I'm afraid this is not possible in the API.

    Best wishes

    Richard

  • RE: how to change HbondCoordination settings?

    Hi,

    the settings for a HBondCoordination calculation contains a configurable HBondCriterion class which can be changed to suit your purpose.

    from ccdc.descriptors import CrystalDescriptors
    hbond_coordination = CrystalDescriptors.HBondCoordination()
    hbond_coordination.settings.hbond_criterion.distance_range = (-5, 0.5)
    hbond_coordination.settings.hbond_criterion.vdw_corrected = True

    Documentation of the HBondCriterion class may be found here:

    https://downloads.ccdc.cam.ac.uk/documentation/API/descriptive_docs/molecule.html#hbond-criterion

    Best wishes
    Richard

  • RE: Detecting rigidity or flexibility of set of molecules

    Hi Tara,

    I'm afraid I don't know of any other way of calculating a rigidity parameter for a molecule.

    Best wishes
    Richard

  • RE: Detecting rigidity or flexibility of set of molecules

    Hi Tara,

    one easy measure would be the proportion of rotatable bonds in the structure:

    from ccdc import io

    csd = io.EntryReader('csd')

    for i, e in enumerate(csd):
        if e.molecule.bonds:
            m = e.molecule
            print(e.identifier, round(len([b for b in m.bonds if b.is_rotatable])/float(len(m.bonds)), 2))
        if i >= 20:
            break

    (u'AABHTZ', 0.22)
    (u'AACANI10', 0.02)
    (u'AACANI11', 0.02)
    (u'AACFAZ', 0.18)
    (u'AACFAZ10', 0.18)
    (u'AACMAL', 0.29)
    (u'AACMHX10', 0.11)
    (u'AACRHA', 0.08)
    (u'AACRHC', 0.14)
    (u'AACRUB', 0.14)
    (u'AACRUB01', 0.14)
    (u'AADAMC', 0.09)
    (u'AADMPY', 0.11)
    (u'AADMPY10', 0.11)
    (u'AADRIB', 0.3)
    (u'AAGAGG10', 0.05)
    (u'AAGGAG10', 0.06)
    (u'AALCFE', 0.2)
    (u'AALPRO', 0.17)
    (u'AAMAND', 0.1)
    (u'AAMTCO', 0.22)

    Would this suit your purpose or would you need something more complicated?

    Best wishes
    Richard