I've already mentioned using Open Babel for depicting with SVG
. That's a handy way to view a large set of molecules; you can zoom in and out and so forth. Let's look at some more of the features, as I've just been adding them to PNG depiction from SVG.
Let's start with the following basic depiction. Note that information on the SVG output options (e.g. -xC) is available in the docs
or via "obabel -H svg", and that you can use the mouse to zoom in, etc.
obabel dataset.sdf -O output1.svg -xC
With some magic, we can convert carboxylic acid groups (and anything else listed in the user-editable superatom.txt
) into COOH in the depiction. Let's add thick lines too:
obabel dataset.sdf -O output2.svg -xC --genalias -xA -xt
We can also do some fun stuff with descriptors (see "obabel -L descriptors" for a list). Let's sort by molecular weight and replace the title with the molecular formula and molecular weight:
obabel dataset.sdf -O output3.svg -xC --sort MW --title "" --append "formula MW"
You might have noticed that all of the molecules have a substructure in common. Let's highlight some of this in green, and get rid of the other colours:
obabel dataset.sdf -O output4.svg -xC -xu -s "[#6]~2~[#6]NCCN=C~2 green"
And finally, if the molecules are related, it can be useful to align the depictions using a substructure in order to identify similarities and differences (this has been improved in the development version):
obabel dataset.sdf -O output5.svg -xC -xu -s "[#6]~2~[#6]NCCN=C~2 green" --align
What other depiction features would you find useful?