Re: [Rdkit-discuss] MMFF94 symbolic atom types

2021-10-24 Thread Hiemer, Stefan

Hi Paolo,

thanks for your help! I'll have a look at SMARTS.

Regards
Stefan


Am 2021-10-24 22:26, schrieb Paolo Tosco:

Hi Stefan,

The RDKit MMFF94 code assigns one of the 99 atom types, which is what 
is

required to assign correct force field parameters to each atom.
If you need the specific atom sub-type you will need to use SMARTS 
patterns

or similar to identify the specific sub-environment of a certain MMFF94
atom type.

Alternatively, you may use a piece of software that I wrote ~10 years
ago:that assigns numeric sub-types, that you may then relate to the
respective symbolic atom type:

http://sdf2xyz2sdf.sourceforge.net/

Hope this helps, cheers
p.



On Fri, Oct 22, 2021 at 7:22 PM Hiemer, Stefan  
wrote:



Dear Omar,

I already know this thread. The problem is, that I do not know, how to
come from the GetMMFFAtomType returned unsigned integer to the string
representation. The unsigned integer code is not unique to a specific
symbolic atom type. Look for example at entry 2-4 of this file
https://github.com/openbabel/openbabel/blob/master/data/mmffdef.par:

C=C 22210VINYLIC
*  CSP222210GENERIC CSP2
*  CGD 22210GUANIDINE CARBON

There you have the same numerical MMFF type (second column) for three
different symbolic atom types. So my question is: Since the numerical
MMFF is not unique to the symbolic atom type how can I get the 
symbolic

ones from rdkit? I need the symbolic types in order as the before
mentioned MC code takes them as input.

Regards
Stefan



Am 2021-10-22 06:40, schrieb Omar H94:
> Dear stefan,
>
> I had a similar issue, and based on answer by Paolo Tosco, you can find
> MMFF Symbols/Definitions here :
> https://github.com/openbabel/openbabel/blob/master/data/mmffdef.par
> The thread: https://sourceforge.net/p/rdkit/mailman/message/36949170/
>
> I hope this helps,
> Omar.
>
> On Fri, Oct 22, 2021 at 7:12 AM Hiemer, Stefan 
> wrote:
>
>> Hello everyone,
>>
>> I need to find the symbolic atom types of the Merck force field in
>> order
>> to create inputs for a Monte Carlo code
>> (http://towhee.sourceforge.net/)
>> as indicated in this example
>> (
>>
https://sourceforge.net/p/towhee/code/HEAD/tree/Examples/Isobaric_Isothermal_Ensemble/MMFF94_Ethyleneoxide/towhee_input
).
>>
>> As far as I can see, rdkit currently only provides the numerical MMFF
>> atom type via GetMMFFAtomType for each atom. Is there a convenient way
>> to get the symbolic ones (as the MC code requires them)?
>>
>> Thanks and Regards
>> Stefan
>>
>>
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] MMFF94 symbolic atom types

2021-10-24 Thread Paolo Tosco
Hi Stefan,

The RDKit MMFF94 code assigns one of the 99 atom types, which is what is
required to assign correct force field parameters to each atom.
If you need the specific atom sub-type you will need to use SMARTS patterns
or similar to identify the specific sub-environment of a certain MMFF94
atom type.

Alternatively, you may use a piece of software that I wrote ~10 years
ago:that assigns numeric sub-types, that you may then relate to the
respective symbolic atom type:

http://sdf2xyz2sdf.sourceforge.net/

Hope this helps, cheers
p.



On Fri, Oct 22, 2021 at 7:22 PM Hiemer, Stefan  wrote:

> Dear Omar,
>
> I already know this thread. The problem is, that I do not know, how to
> come from the GetMMFFAtomType returned unsigned integer to the string
> representation. The unsigned integer code is not unique to a specific
> symbolic atom type. Look for example at entry 2-4 of this file
> https://github.com/openbabel/openbabel/blob/master/data/mmffdef.par:
>
> C=C 22210VINYLIC
> *  CSP222210GENERIC CSP2
> *  CGD 22210GUANIDINE CARBON
>
> There you have the same numerical MMFF type (second column) for three
> different symbolic atom types. So my question is: Since the numerical
> MMFF is not unique to the symbolic atom type how can I get the symbolic
> ones from rdkit? I need the symbolic types in order as the before
> mentioned MC code takes them as input.
>
> Regards
> Stefan
>
>
>
> Am 2021-10-22 06:40, schrieb Omar H94:
> > Dear stefan,
> >
> > I had a similar issue, and based on answer by Paolo Tosco, you can find
> > MMFF Symbols/Definitions here :
> > https://github.com/openbabel/openbabel/blob/master/data/mmffdef.par
> > The thread: https://sourceforge.net/p/rdkit/mailman/message/36949170/
> >
> > I hope this helps,
> > Omar.
> >
> > On Fri, Oct 22, 2021 at 7:12 AM Hiemer, Stefan 
> > wrote:
> >
> >> Hello everyone,
> >>
> >> I need to find the symbolic atom types of the Merck force field in
> >> order
> >> to create inputs for a Monte Carlo code
> >> (http://towhee.sourceforge.net/)
> >> as indicated in this example
> >> (
> >>
> https://sourceforge.net/p/towhee/code/HEAD/tree/Examples/Isobaric_Isothermal_Ensemble/MMFF94_Ethyleneoxide/towhee_input
> ).
> >>
> >> As far as I can see, rdkit currently only provides the numerical MMFF
> >> atom type via GetMMFFAtomType for each atom. Is there a convenient way
> >> to get the symbolic ones (as the MC code requires them)?
> >>
> >> Thanks and Regards
> >> Stefan
> >>
> >>
> >> ___
> >> Rdkit-discuss mailing list
> >> Rdkit-discuss@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
> >>
>
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Removing Hs bonded to sp3 carbons

2021-10-24 Thread Paolo Tosco
Hi Alfredo,

if that's really what you want to do, the following Python function should
help:

from rdkit import Chem

bilastine =
Chem.AddHs(Chem.MolFromSmiles("O=C(O)C(c1ccc(cc1)CCN4CCC(c2nc3c3n2CCOCC)CC4)(C)C"))
bilastine
[image: image.png]
def removeHsBondedToSp3Carbon(mol):
bonds = []
atoms = []
for b in mol.GetBonds():
ba = b.GetBeginAtom()
ea = b.GetEndAtom()
for a in (ba, ea):
oa = b.GetOtherAtom(a)
if (a.GetAtomicNum() == 1 and oa.GetAtomicNum() == 6 and
oa.GetHybridization() == Chem.HybridizationType.SP3):
bonds.append(b.GetIdx())
atoms.append(a.GetIdx())
break
if bonds:
mol = Chem.RWMol(mol)
for bi in sorted(bonds, reverse=True):
b = mol.GetBondWithIdx(bi)
mol.RemoveBond(b.GetBeginAtomIdx(), b.GetEndAtomIdx())
for ai in sorted(atoms, reverse=True):
mol.RemoveAtom(ai)
return mol.GetMol()

bilastine_no_h = removeHsBondedToSp3Carbon(bilastine)
bilastine_no_h
[image: image.png]

Cheers,
p.

On Tue, Oct 19, 2021 at 8:08 PM Alfredo Quevedo 
wrote:

> Dear all,
>
> I am trying to figure out if there is a way to remove all hydrogens bond
> to sp3 carbons in my molecule?
>
> thanks in advance for the help,
>
> kind regards
>
> Alfredo
>
>
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss