I use SD files with new lines in the properties quite frequently (inherited 
from Pipeline Pilot's merge function) and I've never had a problem reading 
them. I've attached an SD file that works fine for me.

In [2]: suppl = Chem.SDMolSupplier('/Volumes/nfirth/tempf.sdf')

In [3]: m = suppl[0]

In [4]: t = m.GetProp('genNum')

In [5]: print t
1
2
3
4

In [6]: print t.split('\n')
['1', '2', '3', '4']


So I guess the problem is in the writer?

Best,
Nick

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company 
Limited by Guarantee, Registered in England under Company No. 534147 with its 
Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the 
message is received by anyone other than the addressee, please return the 
message to the sender by replying to it and then delete the message from your 
computer and network.

Attachment: tempf.sdf
Description: tempf.sdf

Nicholas C. Firth | PhD Student | Cancer Therapeutics
The Institute of Cancer Research | 15 Cotswold Road | Belmont | Sutton | Surrey | SM2 5NG

T 020 8722 4033 | E nicholas.fi...@icr.ac.uk | W www.icr.ac.uk | Twitter @ICRnews

Facebook www.facebook.com/theinstituteofcancerresearch

Making the discoveries that defeat cancer



On 29 Apr 2015, at 11:27, Tuomo Kalliokoski <tkall...@live.com> wrote:

Hello Riccardo,

That sounds very reasonable solution to the issue. 

[I replied to rdkit-discuss to bring this thread on the list back again]

Best regards,
Tuomo


From: riccardo.viane...@gmail.com
Date: Wed, 29 Apr 2015 12:08:48 +0200
Subject: Re: [Rdkit-discuss] SDF tags and "->"
To: tkall...@live.com

Hi Tuomo,

yes, I agree the behavior seems a bit inconsistent. I suppose that if the correctness of the parser is confirmed, then a change could be suggested for the writer, consisting in raising an error if blank lines are present inside the data item.

[but once again, I didn't notice the defailt reply-to settings of rdkit-discuss and accidentally brought the thread off-list, sorry.]

Regards,
Riccardo



On Wed, Apr 29, 2015 at 11:46 AM, Tuomo Kalliokoski <tkall...@live.com> wrote:

Hello Riccardo,

Thanks for the swift reply! Indeed, it is the extra line-feed, not the "->". It was just around the same line where I had the issue, so it got me confused. 
I suppose the current functionality of RDKit, irrespective to the SDF file format specifications, is a bit odd: SDWriter produces file that SDMolSupplier can't handle.

Best regards,
Tuomo


From: riccardo.viane...@gmail.com
Date: Wed, 29 Apr 2015 11:33:14 +0200
Subject: Re: [Rdkit-discuss] SDF tags and "->"
To: tkall...@live.com


Hi Tuomo,

On Wed, Apr 29, 2015 at 10:47 AM, Tuomo Kalliokoski <tkall...@live.com> wrote:
I have got a bunch of SDF-files with molecules and some long descriptions in SDF-tags on them that include stuff like "->" inside. 
These files have been produced by ChemAxon's software and are handled fine by their software.
Such files can be written out also from RDKit 2014_09_02, but they fail when you try to read them in. 

 I suspect the parse error could be independent from the "->", but due to the blank line ("\n\n") that appears inside the "TESTFIELD" data:


  mol.SetProp("TESTFIELD","This should not work -> Let's see\n\nI guess this is not visible\n")

and that is interpreted as the data item terminator. Iirc this interpretation is compliant with the specifications for the SDF file format, but I could be mistaken.
 
Best regards,
Riccardo


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to