Dear colleagues

I want to develop mechanistically interpretable machine learning models
(i.e., using similarity maps) and implement them in web services.

I've already managed to generate a map from a smiles. However, I can not
generate maps for multiple molecules in a data set (CSV ou SDF).
I’m also having some difficulty trying to save the new similarity map
images.

The scripts available in RDKit the tutorial do not provide detailed
information to solve this problem.

Do you have any idea how I can solve this?


# Use the random forest to predict a new molecule (SMILES)
>>> m =
Chem.MolFromSmiles('FC(F)(F)C1=CC=C(OC(CCNC2=CC=CC=C2)C2=CC=CC=C2)C=C1')
>>> fp = np.zeros((1,))
>>> DataStructs.ConvertToNumpyArray(AllChem.GetMorganFingerprintAsBitVect(m,
radius, nBits, useFeatures), fp)
>>> print(rf.predict((fp,)))
>>> print(rf.predict_proba((fp,)))

# Get predicted probability map
>>> def getProba(fp, predictionFunction):
>>> return predictionFunction((fp,))[0][1]
>>> fig, maxweight = SimilarityMaps.GetSimilarityMapForModel(m,
SimilarityMaps.GetMorganFingerprint, lambda x: getProba(x,
rf.predict_proba))

# Open CSV file with multiple molecules
>>> m = pd.read_csv('C:\\Users\\bruno\\Desktop\\maps\\data\\logBB_S.csv',
delimiter=',')
>>> mols = []
>>> y = []
>>> for mol in Chem.SDMolSupplier(fname):
    >>> if mol is not None:
        >>> mols.append(mol)
>>> fps = [AllChem.GetMorganFingerprintAsBitVect(m, radius,
nBits,useFeatures) for m in mols]
>>> def rdkit_np_convert(fp):
   >>> output = []
    >>> for f in fp:
        >>> arr = np.zeros((1,))
        >>> DataStructs.ConvertToNumpyArray(f, arr)
        >>> output.append(arr)
    >>> return np.asarray(output)
>>> x = rdkit_np_convert(fps)
>>> x.shape
>>> print(fp)
>>> print(rf.predict(x))
>>> print(rf.predict_proba((x)))

# Get predicted probability maps for multiple
structures??????????????????????????????


Best regards,

*Prof. Dr. Bruno Junior Neves*
*Laboratório de Quimioinformática*
*Centro Universitário de Anápolis - UniEVANGÉLICA*

* <https://www.researchgate.net/profile/Bruno_Neves4>
<http://hwww.linkedin.com/in/bruno-neves-18498957?trk=nav_responsive_tab_profile>
**
<https://www.facebook.com/bruno.far.ma>
<http://lattes.cnpq.br/7256565904920282>
<http://www.researcherid.com/rid/E-6295-2016>
<https://labmol.farmacia.ufg.br> *
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to