How to use the molgrid.defaultGninaLigandTyper function in molgrid

To help you get started, we’ve selected a few molgrid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gnina / libmolgrid / test / test_typing.py View on Github external
def test_defaultgninatyping():
    m = pybel.readstring('smi','c1ccccc1CCl')
    m.addh()
    t = molgrid.defaultGninaLigandTyper
    assert t.num_types() == 14
    names = list(t.get_type_names())
    assert names[2] == 'AromaticCarbonXSHydrophobe'
    typs = [t.get_atom_type_index(a.OBAtom) for a in m.atoms]
    assert len(typs) == 15
    acnt = 0
    ccnt = 0
    ocnt = 0
    clcnt = 0
    other = 0
    for t,r in typs:
        if t < 0:
            other += 1
            continue
        if names[t] == 'AromaticCarbonXSHydrophobe':
            acnt += 1