On 26/06/2012 14:24, Noel O'Boyle wrote:
On 26 June 2012 14:06, Chris Morley <c.mor...@gaseq.co.uk> wrote:
On 25/06/2012 15:44, Noel O'Boyle wrote:
I'd like to swap PNG and PNG2 for 2.3.2. What do you think? PNG2 has
multimolecule support and is probably what most people are looking
for. It would be nice to integrate the two of them, but that's a bit
tricky.
Isn't the following what you really want:
when writing to pngformat
output an image with any number of molecules (with automatic number of rows
and columns if not specified, as in svgformat).
embed the molecules in the image, if requested.
if there was an input png file, embed all the molecules in that.
when reading from pngformat
extract any embedded molecules
the user not to be exposed to png2format. It's only there for a conditional
build based on the presence of cairo.
Yes - that's right.
We are fairly close to this, but maybe you have found it difficult to
implement?
That's basically it.
I haven't tried but I suspect it should be possible.
WriteChemObject in pngformat would usually call WriteChemObject in
png2format where the rows and column stuff is. Do you think this would work?
Well, I hope so, but I'd appreciate if you could have a go at it as
I'm afraid of messing up the current PNG format's functionality. I am
short of time too (I basically have this week, plus whatever time I
can squeeze in next week while at the EBI) - and hence the lazy
proposal for just swapping PNG and PNG2.
With regard to hiding PNG2 from the user, I guess that we should
replace its documentation string with something like "For internal
use", and instead put all of its documentation into PNG.
I've reorganized PNG and PNG2 as above. The ID of PNG2 is now _png2 and
the underscore hides it from listings. The data embedding and extracting
still works without Cairo being present. The attached txt (bat is
illegal) file shows the various operations. I haven't done much checking
when called from the API, but doubt that has changed much and you will
revamp the use from Python.
Chris
OC(=O)CCCCN 56
O=C(CCC(=O)O)CN 137
OC(=O)CCC[N+](C)(C)C 134
OCC Ethanol
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo Testing PNG/PNG2 formats
@prompt $g
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo Write a single molecule to a png file
obabel -:"CCO ethanol" -O ethanol.png
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo Write multiple molecules to a png file
obabel 4in.smi -O 4mols.png
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo Write multiple molecules in a single row and embed as sdf
obabel 4in.smi -O 4mols.png -xr1 -xw800 -xh200 -xO sdf --gen2D
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo Read back the embedded data from a png file (Cairo not needed)
obabel 4mols.png -ocml
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo Embed a structure data in an existing png file (Cairo not needed)
obabel ethanol.png -:CCO -O ethanolEmbed.png -xO molfile
@echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel