import sys,gzip,os
from rdkit import Chem
from rdkit.Chem import Descriptors
from rdkit.ML.Descriptors import MoleculeDescriptors
inF = sys.argv[1]
if inF.endswith(".sdf.gz") or inF.endswith(".sd.gz"):
cpds = [x for x in Chem.ForwardSDMolSupplier(gzip.open(sys.argv[1]))
if x is not None]
else:
cpds = [x for x in Chem.SDMolSupplier(inF) if x is not None]
outF = inF+".descr.sdf"
cpds_out = Chem.SDWriter(outF)
nms=[x[0] for x in Descriptors._descList]
for dedede in nms:
print dedede
#nms.remove('MolecularFormula')
calc = MoleculeDescriptors.MolecularDescriptorCalculator(nms)
for i in range(len(cpds)):
print i
descrs = calc.CalcDescriptors(cpds[i])
for x in range(len(descrs)):
cpds[i].SetProp(str(nms[x]),str(descrs[x]))
cpds_out.write(cpds[i])
cpds_out.close()
f_in = open(outF, 'rb')
file_name_gz = outF+".sdf.gz"
f_out = gzip.open(file_name_gz, 'wb')
f_out.writelines(f_in)
os.remove(outF)
From: Greg Landrum <[email protected]>
To: "[email protected]" <[email protected]>
Cc: "[email protected]"
<[email protected]>
Date: 24.04.2013 17:46
Subject: Re: [Rdkit-discuss] any experience "boost::bad_any_cast"
Hrm, that's odd. Are you calling SetProp at any point on molecules that
are being written to that file?
Any chance you can send a script that shows the problem? It would be
great to get this fixed before the release later this week.
On Wednesday, April 24, 2013, wrote:
Dear Greg,
thanks a lot for the build!
Unfortunately, the same error appears.
Strangely enough, the SD export works fine with our Linux installation.
Cheers & Thanks,
Paul
> https://rdkit.googlecode.com/files/RDKit_2013_03_1beta2.win32.py27.zip
>
> On Tue, Apr 23, 2013 at 10:44 AM, Greg Landrum <[email protected]>
wrote:
> > ok, I'll do a build either this evening or tomorrow a.m.
> >
> > On Tue, Apr 23, 2013 at 6:58 AM, <[email protected]>
wrote:
> >> Yes, I would love to try out the windows build.
> >>
> >> Thank you so much!
> >>
> >>
> >> paul
> >>
> >>
> >>> >
> >>> > For the new beta, there is currently no compiled win32bit version
> >>> > available, or am I wrong?
> >>> >
> >>>
> >>> You're correct. I didn't do a windows binary. If you'd like to test
it
> >>> let me know; I can do a build and upload it.
> >>>
> >>> -greg
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://www.merckgroup.com/disclaimer to access the German, French,
Spanish and Portuguese versions of this disclaimer.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring
service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
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://www.merckgroup.com/disclaimer to access the German, French,
Spanish and Portuguese versions of this disclaimer.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss