dihedral angles

User 870ab5b546

02-02-2005 17:01:18

Do you have a method for calculating a dihedral angle?

ChemAxon efa1591b5a

03-02-2005 12:54:43

I am afraid not in the public API.





Miklos

User 870ab5b546

03-02-2005 13:02:15

Please put it on your list of enhancement requests. It would not be hard for you to write such a method.

ChemAxon efa1591b5a

03-02-2005 13:11:24

Thank you for the advice, we will certainly make such calculation available soon.





We actually have the method - we need it at various places (e.g. 3d clean, MarvinSpace) - but it is not part of the public API.





What do you think about a GeometryAnalyzer plugin or something like that? - similar to the recently released TopologyAnalyzer? This GeometryAnalyzer could provide services like you asked for: distance, angle, dihedral calculations, diameter, volume etc. Any ideas?








Miklos

User 870ab5b546

03-02-2005 14:09:46

I think such a plug-in would be very useful.





The next step would be to allow the user to manipulate a structure by specifying dihedral angles, bond distances, etc. E.g., if I want eclipsed ethane, and I choose Select Conformer, I get only staggered ethane. I want to be able to specify an H-C-C-H dihedral angle of 0°.

ChemAxon efa1591b5a

03-02-2005 14:20:57

Such functionality (i.e. change of dihedral) will be available in MarvinSpace soon.





Calculator plugins do not allow the manipulation of structures, but as far as I know plugins are being redesigned just now, so maybe it is the right moment to put structure manipulation via plugins on the list of requirements. I pass this on to the developers involved in plugin developments.





Regards,


Miklos

User 870ab5b546

28-03-2005 12:49:44

We are immediately in need of a method for calculating the dihedral angle. We have for now borrowed some code from another source, but it is copyrighted, and we don't know whether the authors will permit us to use the code commercially. Would you be willing to release your code for calculating the dihedral angle to us as part of our general license?

ChemAxon efa1591b5a

29-03-2005 16:14:04

The code 'as is' would be useless for you and others out there as it relies on some internal classes (those were introduced for the sake of compact storage and fast calculation of large amount of 3d data).





What we can and will do is to reimplement all methods required by dihedral angle calculation, but these methods will be based on a much simpler (=canonic) 3d vector representation.





I will upload the source code to the contrib forum area soon and a link will be placed here.





Regards,


Miklos

ChemAxon efa1591b5a

30-03-2005 11:23:48

Please find a sample source code at http://www.chemaxon.hu/forum/viewpost1641.html#1641.





Regards


Miklos

User 20dc561d96

30-03-2005 22:32:56

Thank you!





Nw

User fa1369adab

11-08-2005 03:07:31

Miklos,





Thanks for making Dihedral.java available. It generally works just fine. But often when the dihedral angle is exactly 180 degrees it results in NaN (not a number). I can work around the problem, but it would be better to fix it. To reproduce, build ethane, clean in 3D, and find the dihedral angle H-C-C-H picking two H atoms that are 180 degrees apart.





Raphael

ChemAxon 43e6884a7a

11-08-2005 14:36:51

Thank you for reporting the bug! I'll the code again as soon as it is fixed.





Regards,


Miklos

User 870ab5b546

01-08-2006 13:51:19

Now that you have donated code for determining a dihedral angle, would you be able to donate code for rotating about a bond to make a new dihedral angle?





I might try to write it myself, but I'm afraid my trigonometry skills have rusted away since high school.

ChemAxon efa1591b5a

01-08-2006 22:34:19

Hi Bob,





We will think about it. It is possible that we give away the matrix multiplication based solution, though there is a more sophisticated and more powerful method, based on quaternions, also known.





Best regards,


Miklos





PS. Btw, I'm not sure we fixed the bug in the torsion calculator code. We'll check that.

User 870ab5b546

02-08-2006 05:02:03

OK, I wrote my own using JChem methods. I'll post it in the Contributions and Implementations forums.

User 870ab5b546

03-08-2006 17:53:22

mvargyas wrote:
PS. Btw, I'm not sure we fixed the bug in the torsion calculator code. We'll check that.
It wasn't fixed in our copy, but I added one line to fix it.





However, there's a more serious bug. Your algorithm returns values only between 0 and 180 degrees. Dihedral angles are measured between -180 and 180 degrees (or 0 to 360). The atom2-atom3 vector determines the perspective by which the atom3-atom4 vector is viewed to be clockwise or counterclockwise with respect to the atom2-atom1 vector.





I'll post a solution in the Contributions section.

User 870ab5b546

03-08-2006 19:55:46

Oh, I see you already posted a correction to your code in the Contributions section. Good enough.





-- Bob