Re: [Open Babel] change charge of a atom in a OBMol

2017-04-27 Thread Noel O'Boyle
Open Babel looks after the hydrogens, but the charges don't change no matter how many bonds you make or break. So you need to increment or decrement the charges yourself via OBAtom::Get/SetFormalCharge. I note that there may be a way to do this automatically with reaction smiles or whatever we cal

[Open Babel] change charge of a atom in a OBMol

2017-04-25 Thread xh s
Hi, I'm just wondering what's the best way to change the charge of certain atom in a OBMol. For example, I want to find a way to represent the reaction [Cl-] + CH3OH ---> [OH-] + CH3Cl. Once I've converted the SMILES [Cl-].CO to a OBMol through OBConversion, what's the best way to transform it to