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:





[!$([NH]!@C(=O))&!D1&!$(*#*)]-&!@[!$([NH]!@C(=O))&!D1&!$(*#*)]





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





http://www.jchem.com/doc/api/chemaxon/sss/search/MolSearch.html





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:





http://www.chemaxon.com/restricted/jtest/





Use your usual username/password.





Best regards,


Szabolcs

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?


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

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


http://www.chemaxon.com/marvin/chemaxon/marvin/help/calculator-plugins.html#topolanal





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





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 ...