Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
 def get_GETAWAY(x):
     mol = Chem.MolFromSmiles(x)
     if (mol is None) or (len(mol.GetAtoms()) == 0):
         return [0] * 273
     else:
         mol_3D = Chem.AddHs(mol)
         AllChem.EmbedMolecule(mol_3D)
         AllChem.MMFFOptimizeMolecule(mol_3D)
         return rdMolDescriptors.CalcGETAWAY(mol_3D)
Ejemplo n.º 4
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
Ejemplo n.º 5
0
def getGETAWAY(mol3D):
    dout = {}

    try:
        lgetaway = rdMolDescriptors.CalcGETAWAY(mol3D)
    except:
        lgetaway = []
    if lgetaway != []:
        for i in range(1, len(lgetaway) + 1):
            val = lgetaway[i - 1]
            if math.isnan(val):
                dout["GETAWAY" + str(i)] = 0.0
            elif val == numpy.inf:
                dout["GETAWAY" + str(i)] = "NA"
            else:
                dout["GETAWAY" + str(i)] = round(val, 6)
        return dout
    else:
        for desc in _getaway3D.keys():
            dout[desc] = "NA"
        return dout