On Thu, Dec 15, 2011 at 2:04 PM, Craig A. James <cja...@emolecules.com> wrote: > This may sound hokey, but if you want to "roll your own," storing canonical > SMILES with X/Y/Z coordinates is very easy to do, and very easy to parse. > It's also very compact and compresses about 10- or 20-to-1 with gzip. > > You can store multiple conformers by just appending them to the line with a > tab separator. > > The code is almost there already. > > echo "CCO" | babel --gen2D -i smi -o can -xx > > prints out the X/Y coordinates in canonical order. The code to do this is > about 15 lines of C++ in smilesformat.cpp (look for IsOption("x")). You can > copy the code and just add the Z coordinate and it would do what you want. > > Parsing is pretty simple too because the coordinates are in the same order as > the atoms. If you're interested, I can send you a function that parses a > string of X/Y coordinates into an OBMol object - it's about 50 lines of C++ > code and includes a certain amount of error checking. Again, all you'd have > to change is to add the Z coordinate. > > Like I said, it's a bit hokey and certainly not a supported format, but it's > very effective.
This sounds promising, I'll try it out. > (I wonder ... would "SMILES-with-coordinates" be an interesting addition to > the SMILES parser? The code is all written.) Something like this would be very useful -- a compact, straightforward, and complete description. I like it. Thanks, Dave ------------------------------------------------------------------------------ 10 Tips for Better Server Consolidation Server virtualization is being driven by many needs. But none more important than the need to reduce IT complexity while improving strategic productivity. Learn More! http://www.accelacomm.com/jaw/sdnl/114/51507609/ _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel