Ask the bond whether it's an amide, using "b.IsAmide()". See the docs at http://openbabel.org/api/2.3/classOpenBabel_1_1OBBond.shtml#a86eb2acbb9c5811e645df18b8b0bacf7
I think that the reason it's regarded as rotatable is that trans amide bonds do exist, even in peptides. - Noel On 14 March 2013 09:12, annndrey <gontc...@gmail.com> wrote: > Hi. I'm trying to use Openbabel to detect rotatable bonds in a small > molecule. > > Here is the code: > > pdb="myfile.pdb" > eltab = openbabel.OBElementTable() > mol = openbabel.OBMol() > obConversion = openbabel.OBConversion() > obConversion.SetInFormat("sdf") > obConversion.ReadFile(mol, pdb) > for i in xrange(mol.NumBonds()): > b = mol.GetBond(i) > st = eltab.GetSymbol(b.GetBeginAtom().GetAtomicNum()) > en = eltab.GetSymbol(b.GetEndAtom().GetAtomicNum()) > if b.IsRotor(): > print st, b.GetBeginAtomIdx(), "rot", en, b.GetEndAtomIdx() > > As I can see, it treat as a rotatable bond only single bonds. But I know > that in my molecule there are some peptide bonds that could not be treated > as rotatable. How can I make this script to exclude peptide bonds from be > treated as rotatable? > Thanks in advance, > > > > -- > View this message in context: > http://forums.openbabel.org/Openbabel-rotation-bonds-search-tp4656052.html > Sent from the General discussion mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > 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 > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-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 _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss