User 65339aced8
16-06-2004 08:03:54
Is there a function to calculate Rotatable Bonds?
User 65339aced8
16-06-2004 08:03:54
ChemAxon a3d59b832c
16-06-2004 10:31:40
combipure wrote: |
Is there a function to calculate Rotatable Bounds? |
User d26f9da0bf
25-02-2005 15:49:18
combipure wrote: |
Is there a function to calculate Rotatable Bonds? |
Code: |
static int getRotors(Molecule mol) { int numrotors = 0; for (int i = 0; i<mol.getBondCount(); i++) { MolBond bond = mol.getBond(i); if (bond.getType() == 1 && !mol.isRingBond(i)) { MolAtom atom1 = bond.getAtom1(); MolAtom atom2 = bond.getAtom2(); if (!atom1.isTerminalAtom() && !atom2.isTerminalAtom()) { numrotors ++; } } } return numrotors; } |
ChemAxon d76e6e95eb
25-02-2005 16:33:56
Code: |
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin TopologyAnalyserPlugin plugin = new TopologyAnalyserPlugin(); // set target molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get result int rotatableBondCount = plugin.getRotatableBondCount(); // do something with the results ... |