On Tue, 2006-04-25 at 15:46 +0300, Nina Jeliazkova wrote:
> "Noel O'Boyle" <[EMAIL PROTECTED]> wrote:
> 
> > On Mon, 2006-04-24 at 13:49 +0100, Noel O'Boyle wrote:
> > > When I read molecules in from an SD file using IteratingMDLReader,
> > > properties are available in the Molecule's getProperty() method.
> > > 
> > > However, when I write out the molecule, these properties are not written
> > > to the SD file using MDLWriter. In fact, before each molecule is
> > > written, I need to:
> > >  (1) create a HashMap
> > >  (2) fill it with each of the molecule's properties except for Title and
> > > Remark
> > >  (3) pass the HashMap to the MDLWriter's setSdFields() method.
> > > 
> > > Wouldn't it be better if MDLWriter did this automatically? (Or am I
> > > missing something here?)
> > 
> > I see that I am missing that getProperties() returns a HashMap. This
> > does make it simpler, although I am still not sure why the MDLWriter
> > does not pick up on the molecule's properties automatically.
> > 
> 
> Well, you may not want all properties written always (just a guess). 
Fair point, but I would say the opposite is true. You usually want all
of the properties written, but you may want to modify/add a few.

Also, another problem is that the CDK mixes in the 'Title' and 'Remark'
parts of the file into the Properties HashMap along with the 'real'
properties. As a result, you cannot just pass the Properties HashMap to
the MDLWriter - you first need to create a copy of the HashMap and then
remove the Title and Remark (and hope you have no properties called
Title or Remark in the original file...this is an obscure bug waiting to
happen).

> As a suggestion - could this be  implemented as IOSettings option?
I'll leave that to the developers, but I hope someone will consider
these questions, as I think the manipulation of SD fields could be made
more straightforward (?).

Regards,
  Noel



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to