QSAR

Importando los paquetes necesarios de RDKit


In [1]:
%matplotlib inline
from rdkit import Chem
from rdkit import DataStructs
from rdkit.Chem.Fingerprints import FingerprintMols
from rdkit.Chem.AtomPairs import Pairs
from rdkit.Chem.Draw import SimilarityMaps

Cargando las moléculas a RDKit


In [2]:
moleculas = []
nombres = ["omeprazole.mol", "lansoprazole.mol", "pantoprazole.mol", "rabeprazole.mol", "esomeprazole.mol"]
for i in nombres:
    moleculas.append(Chem.MolFromMolFile("GitHub/TQCA/Data/" + i))

Generando las huellas digitales


In [3]:
fingerprints = [FingerprintMols.FingerprintMol(x) for x in moleculas]

Matriz de similaridad entre las moléculas


In [4]:
for j in xrange(5):
    print
    for k in xrange(5):
        print str(DataStructs.FingerprintSimilarity(fingerprints[j], fingerprints[k])*100)[:5], "\t",


100.0 	79.43 	68.65 	80.06 	100.0 	
79.43 	100.0 	61.20 	92.82 	79.43 	
68.65 	61.20 	100.0 	60.40 	68.65 	
80.06 	92.82 	60.40 	100.0 	80.06 	
100.0 	79.43 	68.65 	80.06 	100.0 	

Visualizando similitudes entre dos moléculas en particular (Con algoritmo de Morgan)


In [5]:
fp = SimilarityMaps.GetAPFingerprint(moleculas[3], fpType='normal')
fp = SimilarityMaps.GetTTFingerprint(moleculas[3], fpType='normal')
fp = SimilarityMaps.GetMorganFingerprint(moleculas[3], fpType='bv')
fig, maxweight = SimilarityMaps.GetSimilarityMapForFingerprint(moleculas[1], moleculas[3], SimilarityMaps.GetMorganFingerprint)


Visualizando similitudes entre dos moléculas en particular (Con métrica de Tanimoto)


In [6]:
fig, maxweight = SimilarityMaps.GetSimilarityMapForFingerprint(moleculas[1], moleculas[3], lambda m,idx: SimilarityMaps.GetMorganFingerprint(m, atomId=idx, radius=1, fpType='count'), metric=DataStructs.TanimotoSimilarity)



In [6]: