Sometimes chemical structures are not enough to present your data. Instead of adding tables, you can graphically annotate compounds. For example the results of a charge fitting procedure (hence the decimal values for electron charges) can be visualized as follows
Here is how to do it:
- Download the indigo toolkit and its python bindings. You will need at least version 1.1, so for now the packaged version of debian stable is not enough. indigo will be responsible for rendering the structure. However, this toolkit is capable of many other tasks, as well. Having a look at the documentation is worth your time.
- Use openbabel (or something similar) to create a structure in SDF file format.
- Make sure that you have matplotlib installed.
- Call the following python script with three arguments on the command line: The SDF file, the annotation file and a PNG output file. The annotation file should consist of three columns: atom id, atom type and annotated value (i.e. charge).
n_visualize.py C3O-MP2-opt.sdf C3O-MP2.charge C3O-MP2-charge.png
and you will get the image shown above.