Esempio n. 1
0
def atom_to_string(atom: Chem.Atom) -> str:

    return '{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}'.format(
        atom.GetChiralTag(),
        atom.GetDegree(),
        atom.GetExplicitValence(),
        atom.GetFormalCharge(),
        atom.GetHybridization(),
        atom.GetIsAromatic(),
        atom.GetMass(),
        atom.GetNumExplicitHs(),
        atom.GetNumImplicitHs(),
        atom.GetNumRadicalElectrons(),
        atom.GetTotalDegree(),
        atom.GetTotalNumHs(),
        atom.GetTotalValence(),
        atom.IsInRing()
    )
Esempio n. 2
0
def _copy_atom(atom: Chem.Atom) -> Chem.Atom:
    new_atom = Chem.Atom(atom.GetSymbol())
    new_atom.SetFormalCharge(atom.GetFormalCharge())
    new_atom.SetNumRadicalElectrons(atom.GetNumRadicalElectrons())
    return new_atom
def radical(atom: Atom) -> int:
    """Number of radical electrons (int).
    """
    return atom.GetNumRadicalElectrons()