def from_rdmol(rdmol, assign_descriptor=True):
    """Convert RDMol to molecule"""
    mol = Compound()
    conf = rdmol.GetConformer()
    Chem.Kekulize(rdmol)
    for atom in rdmol.GetAtoms():
        key = atom.GetIdx()
        a = Atom(atom.GetSymbol())
        a.coords = conf.GetAtomPosition(key)
        mol.add_atom(key, a)
    for bond in rdmol.GetBonds():
        u = bond.GetBeginAtomIdx()
        v = bond.GetEndAtomIdx()
        b = Bond()
        b.order = int(bond.GetBondTypeAsDouble())
        mol.add_bond(u, v, b)
    if assign_descriptor:
        molutil.assign_descriptors(mol)
    return mol
Convert RDMol to molecule