def atom_featurizer(atom):
    """ Return an integer hash representing the atom type
    """

    return str((atom.GetSymbol(), atom.GetNumRadicalElectrons(),
                atom.GetFormalCharge(), atom.GetChiralTag(),
                atom.GetIsAromatic(), nfp.get_ring_size(atom, max_size=6),
                atom.GetDegree(), atom.GetTotalNumHs(includeNeighbors=True)))
示例#2
0
def atom_featurizer(atom):
    """ Return an string representing the atom type
    """

    # 10 params
    return str((atom.GetSymbol(), atom.GetAtomicNum(), atom.GetFormalCharge(),
                atom.GetIsAromatic(), nfp.get_ring_size(atom, max_size=6),
                atom.GetDegree(), atom.GetTotalNumHs(includeNeighbors=True),
                atom.GetNumRadicalElectrons(), atom.GetMass(),
                Chem.GetPeriodicTable().GetRvdw(atom.GetAtomicNum())))
示例#3
0
def atom_featurizer(atom):
    """ Return an string representing the atom type
    """

    return str((
        atom.GetSymbol(),
        atom.GetIsAromatic(),
        nfp.get_ring_size(atom, max_size=6),
        atom.GetDegree(),
        atom.GetTotalNumHs(includeNeighbors=True)
    ))
def bond_featurizer(bond, flipped=False):

    if not flipped:
        atoms = "{}-{}".format(*tuple((bond.GetBeginAtom().GetSymbol(),
                                       bond.GetEndAtom().GetSymbol())))
    else:
        atoms = "{}-{}".format(*tuple((bond.GetEndAtom().GetSymbol(),
                                       bond.GetBeginAtom().GetSymbol())))

    btype = str(bond.GetBondType())
    ring = 'R{}'.format(nfp.get_ring_size(
        bond, max_size=6)) if bond.IsInRing() else ''

    return " ".join([atoms, btype, ring]).strip()
示例#5
0
def bond_featurizer(bond, flipped=False):
    """ Get a similar classification of the bond type.
    Flipped indicates which 'direction' the bond edge is pointing. """
    
    if not flipped:
        atoms = "{}-{}".format(
            *tuple((bond.GetBeginAtom().GetSymbol(),
                    bond.GetEndAtom().GetSymbol())))
    else:
        atoms = "{}-{}".format(
            *tuple((bond.GetEndAtom().GetSymbol(),
                    bond.GetBeginAtom().GetSymbol())))
    
    btype = str(bond.GetBondType())
    ring = 'R{}'.format(nfp.get_ring_size(bond, max_size=6)) if bond.IsInRing() else ''
    
    return " ".join([atoms, btype, ring]).strip()