On Sun, 2007-01-28 at 21:26 +0100, Egon Willighagen wrote:
> On Sunday 28 January 2007, Rajarshi Guha wrote:
> > Add a new constant called SD_TAGS to CDKConstants
> > When reading an SD file, load the tag names and values into a HashMap
> > and add that as the value for the SD_TAGS properties.
>
> The downside of this is that it would place such properties from SD files
> into
> a special situation
I agree - but it is also true, that the SD tag feature is specific to
the SDF format.
> ... it would also require special handling to save them.
Why would this require special handling? To save tags we currently do:
mdlWriter.setSdFields( map );
In this scheme, we could replace setSdFields to:
writeSdFields(boolean willWrite);
and then internally in MDLWriter.writeMolecule:
if (willWrite) {
Map map = container.getProperty(CDKConstants.SD_TAG);
if (map != null) {
// write out the tags
}
}
> Why not simply use IChemObject.getProperties().keys() ?
How would one differentiate between a property that came from the SD
file and one that was, say, added during a calculation (and so might be
temporary and not subsequently written)?
Another thing that has seemed odd to me is that if a molecule has some
properties (say from the SD file that it was written from) I have to
still explicitly set a Map object, whereas it seems more intuitive if
the internal code were able to detect whether there is a set of SD tags
to be written and depending on whether the user wants them to be written
or not, would include them in the output file.
-------------------------------------------------------------------
Rajarshi Guha <[EMAIL PROTECTED]>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
Entropy requires no maintenance.
-- Markoff Chaney
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user