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?

>> m = Chem.MolFromSmiles( 'C' )
>>mnew = Chem.AddHs(m, explicitOnly=True)
>>for a in mnew.GetAtoms():
    print a.GetIdx(), a.GetSymbol(), a.GetNumExplicitHs()

[out] 0 C 0

>> for a in mnew.GetAtoms():
    print a.GetIdx(), a.GetSymbol(), a.GetNumImplicitHs()

[out] 0 C 4

Thanks

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


On Sun, Mar 17, 2013 at 11:46 PM, Greg Landrum <[email protected]>wrote:

> Hi,
>
> On Fri, Mar 15, 2013 at 3:56 PM, Syeda Sabrina <[email protected]>
> wrote:
> > I was trying to how understand how the AddHs ()works and how I can relate
> > its output with the GetNumExplicitHs() to see how many explicit hydrogens
> > were added. But It seems like AddHs does not work correctly. Below is the
> > code that I used.
>
> I think the code in your example shows the RDKit behaving as it is supposed
> to. The difference between "implicit" and "explicit" Hs is one that
> never should have been exposed in the API and that I am (slowly) in
> the process of removing. There's a post explaining this, or at least
> trying to, here:
> http://www.mail-archive.com/[email protected]/msg00077.html
>
> Does this help?
>
> Best,
> -greg
>
> >
> > m = Chem.MolFromSmiles('C')
> >
> > for a in m.GetAtoms():
> >     print a.GetIdx(), a.GetNumImplicitHs()
> >
> > 0 4
> >
> > mnew = Chem.AddHs(m)
> >
> > for a in mnew.GetAtoms():
> >     print a.GetIdx(), a.GetNumImplicitHs()
> >
> > 0 0
> > 1 0
> > 2 0
> > 3 0
> > 4 0
> >
> > for a in mnew.GetAtoms():
> >     print a.GetIdx(), a.GetSymbol(), a.GetNumExplicitHs()
> >
> > 0 C 0
> > 1 H 0
> > 2 H 0
> > 3 H 0
> > 4 H 0
> >
> > mnew = Chem.AddHs(m, explicitOnly=True)
> >
> > for a in mnew.GetAtoms():
> >     print a.GetIdx(), a.GetSymbol(), a.GetNumExplicitHs()
> >
> > 0 C 0
> >
> > for a in mnew.GetAtoms():
> >     print a.GetIdx(), a.GetSymbol(), a.GetNumImplicitHs()
> >
> > 0 C 4
> >
> > mnew = Chem.AddHs(m, explicitOnly=False)
> >
> > for a in mnew.GetAtoms():
> >     print a.GetIdx(), a.GetSymbol(), a.GetNumImplicitHs()
> >
> > 0 C 0
> > 1 H 0
> > 2 H 0
> > 3 H 0
> > 4 H 0
> >
> > for a in mnew.GetAtoms():
> >     print a.GetIdx(), a.GetSymbol(), a.GetNumExplicitHs()
> >
> > 0 C 0
> > 1 H 0
> > 2 H 0
> > 3 H 0
> > 4 H 0
> >
> > Is it possible to fix?
> >
> > Thanks!
> > Syeda Sabrina
> > Graduate Assistant
> > 25, Fenske Laboratory
> > Department of Chemical Engineering, Penn State University
> > University Park, PA
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
> >
>
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to