Re: [Rdkit-discuss] Question regarding 3D pharmacophores

2017-10-31 Thread Andy Jennings
Greg,

Once again - many thanks.

I admit to making my solution way harder, 'cos I'm an idiot: I was deleting
all conformers but the one I needed. Your solution is much more elegant
(and safer!). This now works flawlessly for me.

Best,
Andy

On Tue, Oct 31, 2017 at 2:06 AM, Greg Landrum 
wrote:

>
>
> On Mon, Oct 30, 2017 at 10:14 PM, Andy Jennings  > wrote:
>
>>
>> Next question on this topic, as I can't find it from digging into various
>> sources.
>>
>> The solution you pointed me to works very well. I'm now expanding it to
>> compare the 'color' between two conformations from different molecules. I
>> cannot, however, see how to do this. Is there an option such as
>> 'confId1/confId2' like the ShapeTanimotoDist routine?
>>
>
> Interesting question. It looks like the answer is currently "no".
> The underlying C++ feature objects do have a setActiveConformer() method
> that would allow you to do this, but it seems like this isn't currently
> available in Python.
>
> It's not hard to fix that (and I will), but that doesn't help you
> immediately. In the short term, you probably need to create single
> conformer molecules for this. Here's a way to do that:
>
>
> In [6]: AllChem.EmbedMultipleConfs(m)
>
> In [7]: nm = Chem.Mol(m)
>
> In [8]: nm.RemoveAllConformers()
>
> In [10]: nm.AddConformer(m.GetConformer(2),assignId=True)
> Out[10]: 0
>
> Best,
> -greg
>
>
>
--
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


Re: [Rdkit-discuss] Question regarding 3D pharmacophores

2017-10-31 Thread Greg Landrum
On Mon, Oct 30, 2017 at 10:14 PM, Andy Jennings 
wrote:

>
> Next question on this topic, as I can't find it from digging into various
> sources.
>
> The solution you pointed me to works very well. I'm now expanding it to
> compare the 'color' between two conformations from different molecules. I
> cannot, however, see how to do this. Is there an option such as
> 'confId1/confId2' like the ShapeTanimotoDist routine?
>

Interesting question. It looks like the answer is currently "no".
The underlying C++ feature objects do have a setActiveConformer() method
that would allow you to do this, but it seems like this isn't currently
available in Python.

It's not hard to fix that (and I will), but that doesn't help you
immediately. In the short term, you probably need to create single
conformer molecules for this. Here's a way to do that:


In [6]: AllChem.EmbedMultipleConfs(m)

In [7]: nm = Chem.Mol(m)

In [8]: nm.RemoveAllConformers()

In [10]: nm.AddConformer(m.GetConformer(2),assignId=True)
Out[10]: 0

Best,
-greg
--
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


Re: [Rdkit-discuss] Question regarding 3D pharmacophores

2017-10-30 Thread Andy Jennings
Hi Greg,

Next question on this topic, as I can't find it from digging into various
sources.

The solution you pointed me to works very well. I'm now expanding it to
compare the 'color' between two conformations from different molecules. I
cannot, however, see how to do this. Is there an option such as
'confId1/confId2' like the ShapeTanimotoDist routine?

Thanks in advance,
Andy

On Fri, Oct 20, 2017 at 5:21 PM, Greg Landrum 
wrote:

> Assuming I'm understanding correctly what you're asking for, the RDKit
> actually has code for doing exactly this. That's the good news. The bad
> news is that there's pretty much no documentation for it.
>
> Since it's kind of interesting code (at least I think so) and it came up
> in an earlier conversation I had this week, I put together a little example:
> https://gist.github.com/greglandrum/e6e6b011648af0484ff91bdfafaa704f
>
> This is using the RDKit's FeatMap functionality. This is described as part
> of the Feature Map Vector paper and in some of the references therein:
> https://link.springer.com/article/10.1007/s10822-006-9085-8
>
> The general idea is to create a feature map from the features on one
> molecule and then score the features from the other molecule against that.
> The scores are normalized by the number of features in the smaller feature
> map (there's likely a smarter way to do this).
>
> I hope this doesn't create more questions than it answers; I will try to
> do a somewhat longer writeup, but I wanted to at least get something
> minimal out there quickly.
>
> -greg
>
>
>
>
> On Fri, Oct 20, 2017 at 4:58 PM, Andy Jennings 
> wrote:
>
>> Hi,
>>
>> I'm curious if anyone has figured out a way to compare two molecules
>> based upon their pharmacophore similarities. Specifically, I want to
>> compare 2 molecules in their _absolute_ locations, and not simply see if
>> they have 2 pharmacophores that match well via a translation/rotation. From
>> what I can see in the RDKit code the current implementation, whilst
>> excellent, is limited to distance matrices and not absolute coordinates.
>>
>> My use-case is where I have aligned 2 molecules in some fashion and then
>> want to compare how similar their electrostatic surfaces/pharmacophores are
>> in that specific relative orientation. Think 'R0CS' color for RDKit, if
>> that helps. I appreciate that thinking about bringing more 3D functionality
>> to a cheminformatics toolkit may be heresy, but I'll run that risk.
>>
>> My current nasty hack is to locate all pharmacophores in query/reference
>> molecules, assign coordinates and orientation to them, and loop over any
>> pharmacophoric patterns that both molecules contain.
>>
>> Thanks in advance,
>> Andy
>>
>> 
>> --
>> 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
>>
>>
>
--
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


Re: [Rdkit-discuss] Question regarding 3D pharmacophores

2017-10-22 Thread Francois BERENGER

On 10/21/2017 01:58 AM, Andy Jennings wrote:

Hi,

I'm curious if anyone has figured out a way to compare two molecules 
based upon their pharmacophore similarities. Specifically, I want to 
compare 2 molecules in their _absolute_ locations, and not simply see if 
they have 2 pharmacophores that match well via a translation/rotation. 
 From what I can see in the RDKit code the current implementation, 
whilst excellent, is limited to distance matrices and not absolute 
coordinates.


My use-case is where I have aligned 2 molecules in some fashion and then 
want to compare how similar their electrostatic surfaces/pharmacophores 
are in that specific relative orientation. Think 'R0CS' color for RDKit, 
if that helps. I appreciate that thinking about bringing more 3D 
functionality to a cheminformatics toolkit may be heresy, but I'll run 
that risk.


There is an open source tool called Pharao.
I guess it can do some scoring of two already placed molecules in 3D in
the pharmacophore features space.

I also want more 3D in rdkit (like surfacing of atoms with controllable
atomic radii); many people work with structural data.

My current nasty hack is to locate all pharmacophores in query/reference 
molecules, assign coordinates and orientation to them, and loop over any 
pharmacophoric patterns that both molecules contain.


Thanks in advance,
Andy


--
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



--
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


Re: [Rdkit-discuss] Question regarding 3D pharmacophores

2017-10-20 Thread Andy Jennings
Greg,

Outstanding - thanks! This looks to be as close to what I wanted as I could
have dared hope. I had no idea where to even begin looking.

Fine work. Very fine.

Best,
Andy

On Fri, Oct 20, 2017 at 5:21 PM, Greg Landrum 
wrote:

> Assuming I'm understanding correctly what you're asking for, the RDKit
> actually has code for doing exactly this. That's the good news. The bad
> news is that there's pretty much no documentation for it.
>
> Since it's kind of interesting code (at least I think so) and it came up
> in an earlier conversation I had this week, I put together a little example:
> https://gist.github.com/greglandrum/e6e6b011648af0484ff91bdfafaa704f
>
> This is using the RDKit's FeatMap functionality. This is described as part
> of the Feature Map Vector paper and in some of the references therein:
> https://link.springer.com/article/10.1007/s10822-006-9085-8
>
> The general idea is to create a feature map from the features on one
> molecule and then score the features from the other molecule against that.
> The scores are normalized by the number of features in the smaller feature
> map (there's likely a smarter way to do this).
>
> I hope this doesn't create more questions than it answers; I will try to
> do a somewhat longer writeup, but I wanted to at least get something
> minimal out there quickly.
>
> -greg
>
>
>
>
> On Fri, Oct 20, 2017 at 4:58 PM, Andy Jennings 
> wrote:
>
>> Hi,
>>
>> I'm curious if anyone has figured out a way to compare two molecules
>> based upon their pharmacophore similarities. Specifically, I want to
>> compare 2 molecules in their _absolute_ locations, and not simply see if
>> they have 2 pharmacophores that match well via a translation/rotation. From
>> what I can see in the RDKit code the current implementation, whilst
>> excellent, is limited to distance matrices and not absolute coordinates.
>>
>> My use-case is where I have aligned 2 molecules in some fashion and then
>> want to compare how similar their electrostatic surfaces/pharmacophores are
>> in that specific relative orientation. Think 'R0CS' color for RDKit, if
>> that helps. I appreciate that thinking about bringing more 3D functionality
>> to a cheminformatics toolkit may be heresy, but I'll run that risk.
>>
>> My current nasty hack is to locate all pharmacophores in query/reference
>> molecules, assign coordinates and orientation to them, and loop over any
>> pharmacophoric patterns that both molecules contain.
>>
>> Thanks in advance,
>> Andy
>>
>> 
>> --
>> 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
>>
>>
>
--
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


Re: [Rdkit-discuss] Question regarding 3D pharmacophores

2017-10-20 Thread Greg Landrum
Assuming I'm understanding correctly what you're asking for, the RDKit
actually has code for doing exactly this. That's the good news. The bad
news is that there's pretty much no documentation for it.

Since it's kind of interesting code (at least I think so) and it came up in
an earlier conversation I had this week, I put together a little example:
https://gist.github.com/greglandrum/e6e6b011648af0484ff91bdfafaa704f

This is using the RDKit's FeatMap functionality. This is described as part
of the Feature Map Vector paper and in some of the references therein:
https://link.springer.com/article/10.1007/s10822-006-9085-8

The general idea is to create a feature map from the features on one
molecule and then score the features from the other molecule against that.
The scores are normalized by the number of features in the smaller feature
map (there's likely a smarter way to do this).

I hope this doesn't create more questions than it answers; I will try to do
a somewhat longer writeup, but I wanted to at least get something minimal
out there quickly.

-greg




On Fri, Oct 20, 2017 at 4:58 PM, Andy Jennings 
wrote:

> Hi,
>
> I'm curious if anyone has figured out a way to compare two molecules based
> upon their pharmacophore similarities. Specifically, I want to compare 2
> molecules in their _absolute_ locations, and not simply see if they have 2
> pharmacophores that match well via a translation/rotation. From what I can
> see in the RDKit code the current implementation, whilst excellent, is
> limited to distance matrices and not absolute coordinates.
>
> My use-case is where I have aligned 2 molecules in some fashion and then
> want to compare how similar their electrostatic surfaces/pharmacophores are
> in that specific relative orientation. Think 'R0CS' color for RDKit, if
> that helps. I appreciate that thinking about bringing more 3D functionality
> to a cheminformatics toolkit may be heresy, but I'll run that risk.
>
> My current nasty hack is to locate all pharmacophores in query/reference
> molecules, assign coordinates and orientation to them, and loop over any
> pharmacophoric patterns that both molecules contain.
>
> Thanks in advance,
> Andy
>
> 
> --
> 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
>
>
--
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