Dear all,

Indeed, as Riccardo mentions, according to the specifications in CTfile.pdf a property should be truncated after the first blank line. This is also what other SDF parsers I have tried actually do. What I noticed is that other SDF parsers are tolerant of spurious lines not starting with a ">", either blank or containing characters. Currently the RDKit isn't on read, while it is on write. I think the easiest solution is to make the SDF parser more tolerant in such cases, printing a warning rather than throwing an exception. I have just submitted a pull request about it - feel free to ignore it if you do not agree with me!

Cheers,
Paolo

On 04/29/15 11:27, Tuomo Kalliokoski 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 <mailto: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 <mailto:riccardo.viane...@gmail.com>
    Date: Wed, 29 Apr 2015 11:33:14 +0200
    Subject: Re: [Rdkit-discuss] SDF tags and "->"
    To: tkall...@live.com <mailto:tkall...@live.com>


    Hi Tuomo,

    On Wed, Apr 29, 2015 at 10:47 AM, Tuomo Kalliokoski
    <tkall...@live.com <mailto: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