User 677b9c22ff
15-11-2008 05:04:46
Hi,
there was a post some years ago from Ödön Farkas about the QuatFit
algorithm in the ChemAxon forum. The JAVA code points to package chemaxon.marvin.modelling.linalg;
So I included that and try to use that method, but I am getting stuck at the 3D coordinates.
Should I use the ConformerPlugin? I actually though that the 3D-Generator is useful for that.
Here is the code, which doesn't compile at double rms = myQuatFit.quatfit(A, B, C);
Actually I thought I have to support molecule coordinates. Shouldn't be that difficult, but somehow it is difficult.
Thanks
Tobias
there was a post some years ago from Ödön Farkas about the QuatFit
algorithm in the ChemAxon forum. The JAVA code points to package chemaxon.marvin.modelling.linalg;
So I included that and try to use that method, but I am getting stuck at the 3D coordinates.
Should I use the ConformerPlugin? I actually though that the 3D-Generator is useful for that.
Here is the code, which doesn't compile at double rms = myQuatFit.quatfit(A, B, C);
Actually I thought I have to support molecule coordinates. Shouldn't be that difficult, but somehow it is difficult.
Thanks
Tobias
Code: |
package examples; /* SuperPose Mols with QuatFit V0.9 (Tobias Kind) * * Quatfit example from Ödön Farkas see ml * Download JQuatFit.java from the ChemAxon forum * http://www.chemaxon.com/forum/viewpost7828.htm */ import chemaxon.formats.MolFormatException; import chemaxon.formats.MolImporter; import chemaxon.marvin.calculations.GeometryPlugin; import chemaxon.marvin.modelling.linalg.JQuatFit; import chemaxon.marvin.plugin.PluginException; import chemaxon.struc.Molecule; import chemaxon.util.MolHandler; public class superposemol { public static void generate3D( Molecule mol1 ) { try { // API example Zsolt Mohacsi // create plugin GeometryPlugin plugin = new GeometryPlugin(); // set target molecule plugin.setMolecule(mol1); // set parameters for calculation // * "if2D" - if molecule is in 2D // * "never" - never, always use the input molecule for calculations // * "always" - always calculate with the lowest energy conformer plugin.setCalculateForLEConformer("if2D"); plugin.setCalculateEnergy(false); // sets the energy calculation plugin.setCalculateMoleculeProjections(false); // sets the calculation of molecule projections //timelimit can be set via the conformerplugin if needed (not implemented yet here) // plugin.getLowestEnergyConformer(); // run the calculation plugin.run(); // get results /* double energy = plugin.getDreidingEnergy(); double distance = plugin.getDistance(2,4); double angle = plugin.getAngle(4,2,6); int[] atoms = { 2, 1, 4, 6 }; double dihedral = plugin.getDihedral(atoms); double hindrance = plugin.getStericHindrance(5); // steric hindrance of 5th atom double minimalProjectionArea = plugin.getMinimalProjectionArea(); double maximalProjectionArea = plugin.getMaximalProjectionArea(); double minimalProjectionRadius = plugin.getMinimalProjectionRadius(); double maximalProjectionRadius = plugin.getMaximalProjectionRadius(); */ } catch ( PluginException me ) { me.printStackTrace(); // normally this should be rethrown here } } public static void main(String[] args) throws PluginException { System.out.println("SuperPose Mols with QuatFit V0.09"); try { MolImporter importer = new MolImporter(); Molecule mol1 = importer.importMol("OC[C@@H]1O[C@@H](O[C@]2(CO)O[C@@H](CO)[C@H](O)[C@@H]2O)[C@@H](O)[C@@H](O)[C@H]1O"); Molecule mol2 = importer.importMol("OC[C@@H]1O[C@H](O[C@]2(CO)O[C@H](CO)[C@@H](O)[C@@H]2O)[C@H](O)[C@@H](O)[C@@H]1O"); generate3D(mol1); generate3D(mol2); mol1.getPoints(); mol2.getPoints(); JQuatFit myQuatFit = new JQuatFit(null); // quatfit(double[][], int[][]) // public double quatfit(double[][] fitCoordinates, double[] weightFrom0, int[][] pairs) double rms = myQuatFit.quatfit(A, B, C); System.out.println("RMS of molecules : "+rms); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } |