I hadn't seen that. The 3D functionality is something that it would be very
nice to have available in the notebook, and I think it's only fair to
borrow some ipython ideas back from OpenBabel. ;-)
Steal away :-) The viz runs off of this
repo<https://github.com/patrickfuller/imolecule>,
which is also MIT licensed. Three.js really does handle most of the
complexity, so the code should be followable (look at
imolecule.js<https://github.com/patrickfuller/imolecule/blob/master/imolecule.js>).
You can easily change the aesthetic by swapping out shaders (see line
11<https://github.com/patrickfuller/imolecule/blob/master/imolecule.js#L11>).
Outside of that, there's no real need to rewrite code around bond and atom
drawing - it's pretty boring stuff.
On RDKit's side, you just need to add a _repr_javascript_ to your Python
object, convert your molecule to a JSON representation, and then use some
string formatting to properly place that JSON into the loaded
imolecule.min.js. As an example, here's the openbabel
*repr_javascript*<https://github.com/openbabel/openbabel/blob/master/scripts/python/pybel.py#L411-L460>
.
There's support for some other things in the source (space filling,
wireframe, unit cells, orthographic views). Feel free to fork the repo and
modify as you see fit. And, if you have any questions, don't hesitate to
ask!
Regards,
Pat
On Fri, Feb 7, 2014 at 1:53 AM, Greg Landrum <greg.land...@gmail.com> wrote:
> I mistakenly replied only to Richard.
>
> ---------- Forwarded message ----------
> From: Greg Landrum <greg.land...@gmail.com>
> Date: Fri, Feb 7, 2014 at 4:11 AM
> Subject: Re: [Rdkit-discuss] Cartridge fingerprint customisation & IPython
> integration
> To: Rich Lewis <rl...@cam.ac.uk>
>
>
> Dear Richard,
>
> On Thu, Feb 6, 2014 at 3:09 PM, Rich Lewis <rl...@cam.ac.uk> wrote:
>
>>
>> I'm new here, so to introduce myself, I'm currently a 1st year PhD
>> student under Andreas Bender at the Unilever Centre for Molecular
>> Informatics in Cambridge.
>>
>
> Welcome!
>
>
>> I've got an install of the rdkit head on Mac OS X Mavericks using Eddie
>> Cao's homebrew formula (thanks!), and a functioning install of the
>> PostgreSQL cartridge.
>>
>>
> I was wondering if there is a way to change the default lengths for the
>> fingerprints in the cartridge, short of changing the MORGAN_FP_SIZE
>> constant in adaptor.cpp and recompiling? I have been using 2048 bit Morgan
>> for a project, and would rather keep using them than 512 bit, but would
>> prefer to retain an unmodified install.
>>
>
> There's not currently any way to do this other than editing the constant
> and recompiling. It's a nice idea though.
> I need to investigate a bit more, but I believe that I can add
> configuration variables that control the fingerprint sizes. These can then
> be set at the database level using the "alter database" SQL command.
> Here's the feature request: https://github.com/rdkit/rdkit/issues/216
>
> Also, as I am using the IPython notebook, I wanted to see if anyone was
>> looking into deeper use of the rich display system, for example using
>> JavaScript to render pannable 3D, like OpenBabel has (
>> https://github.com/openbabel/openbabel/pull/30).
>>
>
> I hadn't seen that. The 3D functionality is something that it would be
> very nice to have available in the notebook, and I think it's only fair to
> borrow some ipython ideas back from OpenBabel. ;-)
>
> Looking through the code, it seems they've borrowed some files from the
> three.js examples to get the scenes set up and then the rendering itself is
> being done using three.js itself. Three.js and its examples are MIT
> licensed, so incorporating bits of them into the RDKit would not be a
> problem.
>
> I'll create an entry for this in the issue tracker; I'm not sure if/when I
> will manage to find the time to get around to it, but pull requests are
> always welcome if anyone else wants to take a look:
> https://github.com/rdkit/rdkit/issues/215
>
>
>> Thanks to everyone who has worked on the RDKit, it's a remarkable piece
>> of open source software!
>>
>
> Thanks!
> -greg
>
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss