コード例 #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
ファイル: test3D_old.py プロジェクト: Kaziaa/rdkit-1
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
ファイル: test3D.py プロジェクト: jones-gareth/rdkit
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_RDF(x, from_smiles):
     if from_smiles:
         mol = Chem.MolFromSmiles(x)
     else:
         mol = x
     if (mol is None) or (len(mol.GetAtoms()) == 0):
         return [0] * 210
     else:
         mol_3D = Chem.AddHs(mol)
         AllChem.EmbedMolecule(mol_3D)
         AllChem.MMFFOptimizeMolecule(mol_3D)
         return rdMolDescriptors.CalcRDF(mol_3D)
コード例 #5
0
def getRDF(mol3D):
    dout = {}
    try:
        lrdf = rdMolDescriptors.CalcRDF(mol3D)
    except:
        lrdf = []

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

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