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
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))
In [3]:
fingerprints = [FingerprintMols.FingerprintMol(x) for x in moleculas]
In [4]:
for j in xrange(5):
print
for k in xrange(5):
print str(DataStructs.FingerprintSimilarity(fingerprints[j], fingerprints[k])*100)[:5], "\t",
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)
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]: