Rotatable Bonds

User 65339aced8

16-06-2004 08:03:54

Is there a function to calculate Rotatable Bonds?

ChemAxon a3d59b832c

16-06-2004 10:31:40

combipure wrote:
Is there a function to calculate Rotatable Bounds?
Unfortunately, there is no such API function. However, you can use the following smarts query to match rotatable bonds:


I recommend to use MolSearch and its findAll() method. It will match the two ends of rotatable bonds.

For an example of the usage of MolSearch, see

Please note that the above smarts query uses smarts features not available in our latest release (2.2.1.) yet. You have to use our pre-release, which is available from here:

Use your usual username/password.

Best regards,


User d26f9da0bf

25-02-2005 15:49:18

combipure wrote:
Is there a function to calculate Rotatable Bonds?
How about the following code to figure it out?


  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

We built a new plugin called TopologyAnalyser (currently free), which has a function calculating the number of rotatable bonds.

API usage example (as an alternative, you can also use the TopologyAnalyser class directly):

    // read input molecule

    MolImporter mi = new MolImporter("test.mol");

    Molecule mol =;


    // create plugin

    TopologyAnalyserPlugin plugin = new TopologyAnalyserPlugin();

    // set target molecule


    // run the calculation;

    // get result

    int rotatableBondCount = plugin.getRotatableBondCount();

    // do something with the results ...