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?
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°.
mvargyas
Joined: 21 May 2004
Posts: 800
ChemAxon personnel
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.
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?
mvargyas
Joined: 21 May 2004
Posts: 800
ChemAxon personnel
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
mvargyas
Joined: 21 May 2004
Posts: 800
ChemAxon personnel
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
Ferenc
Joined: 21 May 2004
Posts: 833
ChemAxon personnel
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.
mvargyas
Joined: 21 May 2004
Posts: 800
ChemAxon personnel
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.
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.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum