Пример #1
0
def Get3dDescriptor(molObject):
    """
	Get all 3D descriptor
	Args:

	Returns:
		List
	Raise:
		Exceptions
	"""
    value_list = []
    value_list.append(Descriptors3D.Asphericity(molObject))
    value_list.append(Descriptors3D.Eccentricity(molObject))
    value_list.append(Descriptors3D.InertialShapeFactor(molObject))
    value_list.append(Descriptors3D.NPR1(molObject))
    value_list.append(Descriptors3D.NPR2(molObject))
    value_list.append(Descriptors3D.PMI1(molObject))
    value_list.append(Descriptors3D.PMI2(molObject))
    value_list.append(Descriptors3D.PMI3(molObject))
    value_list.append(
        Descriptors3D.RadiusOfGyration(molObject))  # Radius of gyration
    value_list.append(
        Descriptors3D.SpherocityIndex(molObject))  # Spherocity Index
    value_list.append(rdMolDescriptors.CalcPBF(
        molObject))  # Returns the PBF (plane of best fit) descriptor
    value_list += rdMolDescriptors.CalcAUTOCORR3D(molObject)
    value_list += rdMolDescriptors.CalcRDF(molObject)
    value_list += rdMolDescriptors.CalcMORSE(molObject)
    value_list += rdMolDescriptors.CalcWHIM(molObject)
    value_list += rdMolDescriptors.CalcGETAWAY(molObject)

    return value_list
Пример #2
0
def get3D(m,is3d):
	if not is3d:
		m = Chem.AddHs(m)
		AllChem.EmbedMolecule(m)
		AllChem.MMFFOptimizeMolecule(m)
	r= rdMD.CalcAUTOCORR3D(m)+rdMD.CalcRDF(m)+rdMD.CalcMORSE(m)+rdMD.CalcWHIM(m)+rdMD.CalcGETAWAY(m)
	return r
Пример #3
0
def get3D(m,is3d):
    if not is3d:
        m = Chem.AddHs(m)
        # define the new code from RDKit Molecule 3D ETKDG.
        ps = AllChem.ETKDG()
        ps.randomSeed = 0xf00d
        AllChem.EmbedMolecule(m,ps)
    r= rdMD.CalcAUTOCORR3D(m)+rdMD.CalcRDF(m)+rdMD.CalcMORSE(m)+rdMD.CalcWHIM(m)+rdMD.CalcGETAWAY(m, precision=0.001)
    return r
Пример #4
0
 def get_MORSE(x, from_smiles):
     if from_smiles:
         mol = Chem.MolFromSmiles(x)
     else:
         mol = x
     if (mol is None) or (len(mol.GetAtoms()) == 0):
         return [0] * 224
     else:
         mol_3D = Chem.AddHs(mol)
         AllChem.EmbedMolecule(mol_3D)
         AllChem.MMFFOptimizeMolecule(mol_3D)
         return rdMolDescriptors.CalcMORSE(mol_3D)
Пример #5
0
def getAUTOCORR(mol3D):
    dout = {}
    try: lautocorr3D = rdMolDescriptors.CalcMORSE(mol3D)
    except: lautocorr3D = []

    if lautocorr3D != []:
        for i in range(1, len(lautocorr3D) + 1):
            val = lautocorr3D[i - 1]
            if math.isnan(val) == True:
                dout["AUTOCORR3D" + str(i)] = "NA"
            else:
                dout["AUTOCORR3D" + str(i)] = round(val, 6)
        return dout
    else:
        for desc in _autocorr3D.keys():
            dout[desc] = "NA"
        return dout
Пример #6
0
def getMORSE(mol3D):
    dout = {}
    try: lmorse = rdMolDescriptors.CalcMORSE(mol3D)
    except: lmorse = []

    if lmorse != []:
        for i in range(1, len(lmorse) + 1):
            val = lmorse[i - 1]
            if math.isnan(val) == True:
                dout["MORSE" + str(i)] = "NA"
            else:
                dout["MORSE" + str(i)] = round(val, 6)

        return dout
    else:
        for desc in _morse3D.keys():
            dout[desc] = "NA"
        return dout