Hi Greg, Thanks for your reply. The code used to generate these fragments is part of a much larger set of code, so I have been putting together a shorter version to recreate the problem for you. Strangely, now that I have isolated the code, I don't get the same problem and the hydrogen is removed!
I think I will carry on playing around with this before I send you anything to look at, I don't want to waste your time, hopefully I've got it fixed now. Thanks for your help, Sarah On 30 May 2012, at 15:49, Greg Landrum wrote: > Hi Sarah > > On Wed, May 30, 2012 at 12:45 PM, Sarah Langdon <sarah.lang...@icr.ac.uk> > wrote: >> >> I am trying to remove hydrogens from a molecule using RemoveHs, but the >> function isn't behaving as I expect. >> >> I am using it as part of some code that removes ring systems from a molecule >> and replaces them with a dummy atom, here are the SMILES for an example >> molecule and the 3 subsequent molecules as rings are removed >> >> 1 - O=C1NC(=O)N(C2CC3CCC2(CS(=O)(=O)N2CCC4(C5=CC=CC=C5CC4)CC2)C3(C)C)C1=O >> 2 - c1ccc2c(c1)CCC21CCN(SCC23C([*])([*])C(CC2)CC3N2C(=[*])NC(=[*])C2=[*])CC1 >> 3 - [*]=C1NC(=[*])N(C2CC3CCC2([*])C3([*])[*])C1=[*] >> 4 - [*]C1([*])C2C[CH]C1([*])CC2 >> >> On each of these I have used RemoveHs, but for some reason, in molecule 4, >> one of the carbons of the norbornane system is defined explicitly as CH. >> Does anyone have any idea why this is, or know how I can remove the >> hydrogen? Perhaps the hydrogen is added when I use MolToSmiles? > > RemoveHs() removes explicit hydrogens from the molecule graph (i.e. Hs > that are actually present as atoms). Here's an example: > In [2]: m = Chem.MolFromSmiles('[H]OC([H])(Cl)F',sanitize=False) > > In [3]: Chem.MolToSmiles(m) > Out[3]: '[H]OC(F)(Cl)[H]' > > In [4]: nohm=Chem.RemoveHs(m) > > In [5]: Chem.MolToSmiles(nohm) > Out[5]: 'OC(F)Cl' > > > H's that are written inside of square brackets with another atom, like > in your norbornane example, are usually there because the C is a > stereocenter. Since this one is *not* a stereocenter, something odd is > going on. Can you send the code that was used to generate these > molecular fragments so that I can try and figure out what's going on? > > -greg The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss