Ejemplo n.º 1
0
def _CDPLconfigForConformation(
        mol
):  # TODO is this the right way to handle ligands for conf. generation?
    '''
    PRIVAT METHOD
    configures a CDPL BasicMolecule for conformation generation. \n
    Input: \n
    mol (CDPL BasicMolecule): a CDPL BasicMolecule \n
    Return: \n
    (CDPL BasicMolecule): the configured input BasicMolecule
     '''
    Chem.perceiveComponents(mol, False)
    Chem.perceiveSSSR(mol, False)
    Chem.setRingFlags(mol, False)
    Chem.calcImplicitHydrogenCounts(mol, False)
    Chem.perceiveHybridizationStates(mol, False)
    Chem.setAromaticityFlags(mol, False)
    Chem.calcCIPPriorities(mol, False)
    Chem.calcAtomCIPConfigurations(mol, False)
    Chem.calcBondCIPConfigurations(mol, False)
    Chem.calcAtomStereoDescriptors(mol, False)
    Chem.calcBondStereoDescriptors(mol, False)
    Chem.calcTopologicalDistanceMatrix(mol, False)

    Chem.generate2DCoordinates(mol, False)
    Chem.generateBond2DStereoFlags(mol, True)
def calculate_molecule_hashcode(mol, stereo=True):
    Chem.makeHydrogenDeplete(mol)
    Chem.calcImplicitHydrogenCounts(mol, True)
    if stereo:
        Chem.calcAtomStereoDescriptors(mol, True)
        Chem.calcBondStereoDescriptors(mol, True)
        Chem.calcCIPPriorities(mol, True)
        Chem.calcAtomCIPConfigurations(mol, True)
        Chem.calcBondCIPConfigurations(mol, True)
        return Chem.calcHashCode(mol)
    else:
        return Chem.calcHashCode(mol,
                                 atom_flags=Chem.AtomPropertyFlag.TYPE
                                 | Chem.AtomPropertyFlag.H_COUNT
                                 | Chem.AtomPropertyFlag.FORMAL_CHARGE
                                 | Chem.AtomPropertyFlag.AROMATICITY,
                                 bond_flags=Chem.BondPropertyFlag.ORDER
                                 | Chem.BondPropertyFlag.TOPOLOGY
                                 | Chem.BondPropertyFlag.AROMATICITY)