Re: [Rdkit-discuss] descriptors beyond rotatable bond count and possible correlations with entropy

2018-09-01 Thread Brian Cole
Little late to the party, but here is an RDKit implementation of a
contiguous rotatable bond count I wrote awhile ago:
https://gist.github.com/coleb/4737a1dc77b5f5f8a7bbe4b23f39f2c4

Doesn't return the actual bonds like Paolo's does. But it does take into
account amides, triple bonds, and terminal groups.

Happy to submit it as an RDKit pull request at the UGM hack day if there's
interest.

Cheers,
Brian

On Fri, Aug 31, 2018 at 4:17 PM Thomas Evangelidis 
wrote:

> Hi,
>
> I am also very interested in measures of ligand flexibility. There has
> been a post about a new descriptor 3 days ago that might be more
> "descriptive" than the largest number of contiguous rotatable bonds.
>
>
> https://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg08196.html
>
> best,
> Thomas
>
>
> On Tue, 28 Aug 2018 at 02:22, James T. Metz via Rdkit-discuss <
> rdkit-discuss@lists.sourceforge.net> wrote:
>
>> RDkit users,
>>
>> Is there a RDkit descriptor (or code) to determine the largest number
>> of contiguous
>> rotatable bonds in a small molecule?
>>
>> Hmmm... it seems likely that ligand conformational flexibility might
>> be
>> somehow related to the entropy component of ligand binding.  Has anyone
>> made
>> a plot of the experimental TdS term from calorimetry vs. any number of
>> computational measures of ligand flexibility?  Any correlation?
>>
>> Regards,
>> Jim Metz
>>
>>
>>
>>
>> --
>> 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
>>
>
>
> --
>
> ==
>
> Dr Thomas Evangelidis
>
> Research Scientist
>
> IOCB - Institute of Organic Chemistry and Biochemistry of the Czech
> Academy of Sciences 
> Prague, Czech Republic
>   &
> CEITEC - Central European Institute of Technology 
> Brno, Czech Republic
>
> email: teva...@gmail.com
>
> website: https://sites.google.com/site/thomasevangelidishomepage/
>
>
>
> --
> 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] descriptors beyond rotatable bond count and possible correlations with entropy

2018-08-31 Thread Thomas Evangelidis
Hi,

I am also very interested in measures of ligand flexibility. There has been
a post about a new descriptor 3 days ago that might be more "descriptive"
than the largest number of contiguous rotatable bonds.

https://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg08196.html

best,
Thomas


On Tue, 28 Aug 2018 at 02:22, James T. Metz via Rdkit-discuss <
rdkit-discuss@lists.sourceforge.net> wrote:

> RDkit users,
>
> Is there a RDkit descriptor (or code) to determine the largest number
> of contiguous
> rotatable bonds in a small molecule?
>
> Hmmm... it seems likely that ligand conformational flexibility might be
> somehow related to the entropy component of ligand binding.  Has anyone
> made
> a plot of the experimental TdS term from calorimetry vs. any number of
> computational measures of ligand flexibility?  Any correlation?
>
> Regards,
> Jim Metz
>
>
>
>
> --
> 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
>


-- 

==

Dr Thomas Evangelidis

Research Scientist

IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy
of Sciences 
Prague, Czech Republic
  &
CEITEC - Central European Institute of Technology 
Brno, Czech Republic

email: teva...@gmail.com

website: https://sites.google.com/site/thomasevangelidishomepage/
--
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] descriptors beyond rotatable bond count and possible correlations with entropy

2018-08-31 Thread Paolo Tosco
Hi Jim,

I have updated the gist to fix the bug that Andrew pointed out (thanks!). 
That’s what happens when you write code while still in bed because you can’t 
sleep  :-/

Cheers,
p.

> On 31 Aug 2018, at 16:56, James T. Metz  wrote:
> 
> Paolo,
> 
> Thank you for writing the PYTHON/RDkit/Jupyter code.  I was able to run 
> your
> code in Jupyter and obtain a contiguous rotatable bond count of 3 for the 
> example molecule that you provided.  Thanks again, much appreciated.
> 
> Regards,
> Jim Metz
> 
> James T. Metz, Ph.D.
> President, Metz Research LLC
> 422 Cross Road
> Gurnee, IL  60031
> (262) 581 - 2794
> jamestm...@aol.com
> www.metzresearch.com
> 
> 
> 
> -Original Message-
> From: Paolo Tosco 
> To: James T. Metz ; rdkit-discuss 
> 
> Sent: Fri, Aug 31, 2018 12:41 am
> Subject: Re: [Rdkit-discuss] descriptors beyond rotatable bond count and 
> possible correlations with entropy
> 
> Dear Jim,
> this gist should do what you need:
> https://gist.github.com/ptosco/baf6168c48c4271bf3c096d53adaaf82
> Cheers,
> p.
> 
> On 28/08/2018 01:21, James T. Metz via Rdkit-discuss wrote:
> RDkit users,
> 
> Is there a RDkit descriptor (or code) to determine the largest number of 
> contiguous 
> rotatable bonds in a small molecule?
> 
> Hmmm... it seems likely that ligand conformational flexibility might be
> somehow related to the entropy component of ligand binding.  Has anyone made
> a plot of the experimental TdS term from calorimetry vs. any number of 
> computational measures of ligand flexibility?  Any correlation?
> 
> Regards,
> Jim Metz
> 
> 
> 
> 
> 
> --
> 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] descriptors beyond rotatable bond count and possible correlations with entropy

2018-08-31 Thread Andrew Dalke
On Aug 31, 2018, at 07:41, Paolo Tosco  wrote:
> this gist should do what you need:

Unless I misinterpreted what Jim is looking for, I don't think that returns the 
contiguous rotatable bonds in a small molecule.

In the following there are only two rotatable bonds:

>>> mol = Chem.MolFromSmiles("NCC1CCC1C(=O)O")
>>> mol.GetSubstructMatches(RotatableBondSmarts)
((1, 2), (5, 6))

The code from the gist identifies three bonds:

>>> find_bond_groups(mol)
((, , ),)
>>> [(b.GetBeginAtomIdx(), b.GetEndAtomIdx()) for b in _[0]]
[(5, 2), (5, 6), (1, 2)]

In this case, (2,5) is part of a ring, and not rotatable.

I think the problem is that:

   nbrs = [nbr.GetIdx() for nbr in a.GetNeighbors() if (
  (nbr.GetIdx() in rot_atom_set_tmp) and (not (nbr.GetIdx() in 
connected_atom_set)))]

finds that both atoms of the bond are in connected bond groups, while the bond 
itself is not part of the match.

I have put an alternative implementation of this function at the bottom of this 
email. For my test case it returns:

>>> find_bond_groups2(mol)
((,), (,))
>>> [[(b.GetBeginAtomIdx(), b.GetEndAtomIdx()) for b in x] for x in _]
[[(5, 6)], [(1, 2)]]

Cheers,

Andrew
da...@dalkescientific.com


from collections import defaultdict
def find_bond_groups_dalke(mol):
rot_atom_pairs = mol.GetSubstructMatches(RotatableBondSmarts)

bond_groups = defaultdict(set)
for (left, right) in rot_atom_pairs:
# Ensure they are in order (I'm not sure if this is required)
if right < left:
left, right = right, left
pair = (left, right)
# Add the pair to the group associated with the left atom
bond_groups[left].add(pair)
# Merge the left atom group with the right atom group
bond_groups[left].update(bond_groups[right])
bond_groups[right] = bond_groups[left]

# Get just the unique bond groups, in order from largest to smallest
unique_bond_groups = set(frozenset(v) for v in bond_groups.values())
sorted_bond_groups = sorted(unique_bond_groups, reverse=True, key=len)

# Return as bond objects, to match Paolo's code
return tuple(
tuple(mol.GetBondBetweenAtoms(left, right) for (left, right) in 
bond_group)
for bond_group in sorted_bond_groups)


--
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] descriptors beyond rotatable bond count and possible correlations with entropy

2018-08-30 Thread Paolo Tosco

Dear Jim,

this gist should do what you need:

https://gist.github.com/ptosco/baf6168c48c4271bf3c096d53adaaf82

Cheers,
p.


On 28/08/2018 01:21, James T. Metz via Rdkit-discuss wrote:

RDkit users,

    Is there a RDkit descriptor (or code) to determine the largest 
number of contiguous

rotatable bonds in a small molecule?

    Hmmm... it seems likely that ligand conformational flexibility 
might be
somehow related to the entropy component of ligand binding.  Has 
anyone made

a plot of the experimental TdS term from calorimetry vs. any number of
computational measures of ligand flexibility?  Any correlation?

    Regards,
    Jim Metz





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


[Rdkit-discuss] descriptors beyond rotatable bond count and possible correlations with entropy

2018-08-27 Thread James T. Metz via Rdkit-discuss

RDkit users,


Is there a RDkit descriptor (or code) to determine the largest number of 
contiguous 
rotatable bonds in a small molecule?


Hmmm... it seems likely that ligand conformational flexibility might be
somehow related to the entropy component of ligand binding.  Has anyone made
a plot of the experimental TdS term from calorimetry vs. any number of 
computational measures of ligand flexibility?  Any correlation?


Regards,
Jim Metz






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