Works for me from Python: >>> import pybel >>> mol = pybel.readstring("smi", "CCCC") >>> mol.make3D() >>> mol.OBMol.GetTorsion(1,2,3,4) -179.9743765482302 >>> mol.OBMol.SetTorsion(1,2,3,4, 22.5*math.pi/180.) >>> mol.OBMol.GetTorsion(1,2,3,4) 22.500000000000004
where SetTorsion is defined in the Python interface as: void SetTorsion(int i, int j, int k, int l, double ang) { self->SetTorsion(self->GetAtom(i), self->GetAtom(j), self->GetAtom(k), self->GetAtom(l), ang); } - Noel On 15 July 2011 21:41, Martin Kamp Jensen <martin.kamp.jen...@gmail.com> wrote: > Hello, > Maybe someone can explain to me how the SetTorsion method [1] of the OBMol > class works? The documentation is "Set the torsion defined by these atoms, > rotating bonded neighbors." It is the latter part about rotating bonded > neighbors I am particularly interested in. My question arises because I have > noticed that if I use the SetTorsion method to change several torsion angles > between bonded atoms in a molecule and then check the torsion angles using > GetTorsion [2] then they are not identical to the values I wanted to assign > (I am aware that GetTorsion returns a value in degrees while SetTorsion > takes a value in radians). Further, it seems to matter in what order I > change the angles. So it seems like changing a specific torsion angle can > lead to other torsion angles changing. Can that be avoided? > [1] http://openbabel.org/api/2.3/classOpenBabel_1_1OBMol.shtml#a501e76993e9deb8ec8ab24c464d4ed3c > [2] http://openbabel.org/api/2.3/classOpenBabel_1_1OBMol.shtml#adfd902d8de9eeb32ea476fe916a329fd > Thanks, > Martin. > ------------------------------------------------------------------------------ > AppSumo Presents a FREE Video for the SourceForge Community by Eric > Ries, the creator of the Lean Startup Methodology on "Lean Startup > Secrets Revealed." This video shows you how to validate your ideas, > optimize your ideas and identify your business strategy. > http://p.sf.net/sfu/appsumosfdev2dev > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > > ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss