On Wed, Oct 18, 2017 at 10:12 AM, mark <em...@ej73.com> wrote:

> Thanks Greg - it's nice of you to even be willing to support the old
> drawing methods in terms of documenting them.
> I did have a search for Cairo docs but my quick goog ran aground.  I had
> been expecting to roll something to process obabel svg output, I thought
> I'd get more of the control done from the source conversion of InchI to SVG
> and that's still the case - I'll look further into the rdkit code. Could I
> ask:
> 1) Which of MolDraw2DSVG and MolDraw2DCairo is best (hopefully not too
> contentious a question).
>

I think you want an SVG, so that would be the one to use. The Cairo one
produces a PNG.


>  My requirement is to ideally:
> a. Take InchI string
>

As long as you aware that InChIs are not a good way to transfer chemical
information this is fine.
You may be able to create beautiful chemistry drawings, but the chemistry
itself is going to be horrible a lot of the time. InChI just wasn't
designed to be an interchange format.


> b. Render as a set of SVGs optimised for current iPhone, iPad and latest
> Android screen resolutions
> - transparent bg
> - all white bonds and atom text in sans bold
>

I assume you mean black bonds? The atom text thing you can do via string
manipulation.


> - ensure all non-carbon atoms' text identifiers are perfectly positioned
> in the mol render (think max-posh latest mobile rendering)
>

That's going to be tough to do; it's a hard problem. Concrete suggestions
as to how to improve the existing code are, of course, very welcome.


> + this is so that as technology advances, each device equivalent will get
> a higher res-still, but as SVG, the nearest image to fit will scale OK
> (probably until I end up using iPad-optimised images for iPhones...) with
> no worries about antialiasing artefacts, bond lines perfectly meeting each
> end it was originally rendered to, as the svg is scaled to fit a new,
> slightly larger resolution
> + I've given up the notion of being able to rotate a molecule after
> rendering and have the text remain the right way up - unless you know of a
> way (not googled this yet)
>

Nope, you want to rotate it first. There is RDKit code to do this.


> c. Use a self-rolled post-pro script to edit the svg into the required
> state (such as bold text etc) as needed
> d. Use python where possible
>
> 2) You mention using c++ classes, and although I can programme c++ my
> knowledge is 20 years old; I can programme c and python more easily, so are
> you suggesting I need to actually write this in c++?
>

Nope. The "C++ rendering code" is all exposed to Python, so you can work
purely in Python. I just use that phrase to contrast it with the old, pure
python, rendering code.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to