On Wed, Jul 20, 2011 at 3:00 PM, Noel O'Boyle <baoille...@gmail.com> wrote:

> 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
>

My issue is actually that by changing one angle, other angles (of bonded
neighbors) would be changed as well. Then there could be a situation where
you change two different angle, and then the changes neutralize each other.
I was going to show it, but the code below results in something else than
yours even though I thought it should be the same... hmm.

OBConversion c = new OBConversion();
>  c.SetInFormat("smi");
>  OBMol m = new OBMol();
>  c.ReadString(m, "CCCC");
>  System.out.println(m.GetTorsion(1, 2, 3, 4));
>  m.SetTorsion(m.GetAtom(1), m.GetAtom(2), m.GetAtom(3), m.GetAtom(4),
>  22.5*Math.PI/180);
>  System.out.println(m.GetTorsion(1, 2, 3, 4));


Output:

180.0
> 180.0



> 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
> >
> >
>
------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to