Dear RDkitters,

I'm trying to use Python's multiprocessing module in conjunction with
RDKit.

It should be applied in 2 cases:
(1) fingerprint calculation
&
(2) Picking Diverse Molecules



(1)
"
from multiprocessing import Pool
p4 = Pool(processes=4)
def fps_calc(m):
        fps = [GetMorganFingerprint(x,3) for x in m]
        return fps
fps =  p4.map(fps_calc,ms)
"
==>
"TypeError: 'Mol' object is not iterable"

(2)
"
from multiprocessing import Pool
p4 = Pool(processes=4)
def distij(i,j,fps=fps):
        return 1-DataStructs.DiceSimilarity(fps[i],fps[j])

def DivSelection(distij,nfps,quantity_train):
        picker = MaxMinPicker()
        picked_indices = picker.LazyPick(distij,nfps,quantity_train)
        return picked_indices
"
pickIndices = p4.map(DivSelection, ???)



In the first case, I do not get the point what is going wrong. With the
following conformer generation snippet, multiprocessing works perfect:
"
from multiprocessing import Pool
def generateconformations(m):
  m = Chem.AddHs(m)
  ids=AllChem.EmbedMultipleConfs(m,numConfs=10)
  for id in ids:
    AllChem.UFFOptimizeMolecule(m,confId=id)
  return m
p4 = Pool(processes=4)
ms = [x for x in Chem.SDMolSupplier('blockbusters.sdf')]
cms4=p4.map(generateconformations,ms)
"

In the second case, I'm not sure how to properly pass the variables.



Cheers & Thanks,
Paul

This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended recipient,
you must not copy this message or attachment or disclose the contents to
any other person. If you have received this transmission in error, please
notify the sender immediately and delete the message and any attachment
from your system. Merck KGaA, Darmstadt, Germany and any of its
subsidiaries do not accept liability for any omissions or errors in this
message which may arise as a result of E-Mail-transmission or for damages
resulting from any unauthorized changes of the content of this message and
any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its
subsidiaries do not guarantee that this message is free of viruses and does
not accept liability for any damages caused by any virus transmitted
therewith.

Click http://disclaimer.merck.de to access the German, French, Spanish and
Portuguese versions of this disclaimer.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to