I meant to say probably current version of the RunReactants messes up with
the implicit Hs in some cases.

I am not sure though. This is a guess and trying to see how it deals with
the problematic cases if I replace those implicit Hs with some other
similar atom.

Sorry for the confusion!

Thanks
Sabrina

*Syeda Sabrina*
*Graduate Assistant*
*25, Fenske Laboratory*
*Department of Chemical Engineering, Penn State University*
*University Park, PA*
*
*


On Tue, Mar 19, 2013 at 11:23 PM, Syeda Sabrina <sus364...@gmail.com> wrote:

> Hello Greg,
>
> Thanks for your input. Well, basically the current version of
> RunReactants() deals with the implicit Hs in some cases, so I was trying to
> make some new function for my code that will replace the implicit Hs by
> some other similar atom (e.g. At) and then once I am done with the
> RunReactants then by some other function similar to RemoveHs it will remove
> those atoms again but not disrupting the stereo information of the
> molecule.
>
> For doing this I started with learning all possible features that the
> AddHs. provides now which I can possibly use for my new function ( say
> AddAts & RemoveAts).
>
> It will be definitely great if the explicit Hs and implicit Hs are changed
> soon in the Rdkit.
>
> Thanks again!
>
> Sabrina
>
> *Syeda Sabrina*
> *Graduate Assistant*
> *25, Fenske Laboratory*
> *Department of Chemical Engineering, Penn State University*
> *University Park, PA*
> *
> *
>
>
> On Tue, Mar 19, 2013 at 11:04 PM, Greg Landrum <greg.land...@gmail.com>wrote:
>
>> On Mon, Mar 18, 2013 at 2:36 PM, Syeda Sabrina <sus364...@gmail.com>
>> wrote:
>> > Hi Greg,
>> >
>> > If this is working as it is supposed to be then I don't understand why
>> even
>> > if  I add only explicit Hydrogens to a molecule and check the number
>> the of
>> > explicit Hydrogens attached to it later why it returns zero and in case
>> of
>> > implicit hydrogen it is returning the other one?
>> >
>>
>> Ok, let's start with what you have:
>> In [12]: m = Chem.MolFromSmiles('C')
>> In [13]: mnew = Chem.AddHs(m,explicitOnly=True)
>> In [14]: m.GetNumAtoms()
>> Out[14]: 1
>> In [15]: mnew.GetNumAtoms()
>> Out[15]: 1
>> In [16]: m = Chem.MolFromSmiles('C')
>> In [17]: m.GetNumAtoms()
>> Out[17]: 1
>> In [18]: mnew = Chem.AddHs(m,explicitOnly=True)
>> In [19]: mnew.GetNumAtoms()
>> Out[19]: 1
>> In [20]: mnew = Chem.AddHs(m)
>> In [21]: mnew.GetNumAtoms()
>> Out[21]: 5
>>
>> The behavior around lines 20 and 21, which is the default, is I think
>> what you want.
>>
>> In order to have the "explicitOnly" flag do anything, you have to have
>> some explicit Hs in your molecule:
>>
>> In [22]: m2 = Chem.MolFromSmiles('[CH4]')
>> In [23]: m2.GetNumAtoms()
>> Out[23]: 1
>> In [24]: mnew2 = Chem.AddHs(m2,explicitOnly=True)
>> In [25]: mnew2.GetNumAtoms()
>> Out[25]: 5
>>
>> As I said in the earlier post I linked to, this behavior is correct
>> (in the sense the code is doing what it was designed to do), but it
>> doesn't really make sense. The distinction the RDKit currently makes
>> between explicit and implicit Hs is somewhat silly and should be
>> changed. I'm doing this, but it will take a while.
>>
>> In the meantime, there's probably no reason for you to be providing
>> the "explicitOnly" argument to addHs. What were you trying to
>> accomplish?
>>
>>
>> -greg
>>
>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to