I have looked at the OBConformer code and asked myself that same question.  I
modified it a bit to generate multiple conformations, and then I had to use
code segments from OBFit to align the conformers and create an RMSD distance
matrix between all the elements so as to neglect similar conformations.  
As far as I can tell, using a weighted rotor search calculates the energy
for the scorings but doesn't do minimization.  Therefore it says to minimize
before, and probably after if maybe not that many conformers are sampled. 
Because it generates random rotors, and then scores each one as to how well
it fits the Boltzmann distribution at room temperature, I don't think it is
any different if one were to just run the weighted rotor search more times
and maybe with less sampling.  If someone could give their two cents as to
what they think about this, I would be appreciative.  Such as comparing this
approach to changing only one rotor or torsion and optimizing it that way
iteratively as in Monte Carlo, or even with using different temperatures as
in Simulated Annealing.  

The code below is just a slight modification of OBConformer, but instead of
outputting just one low energy conformer, it just puts the coordinates in
the conformer container, as a mol can have any number of conformers
associated with it.  To print them out, you can see some of the sample code
on the other OBtools using a simple for loop over all the conformers.

OBRotorList rl;
 OBRotamerList rotamers;
 
 OBRandom rand;
 rand.TimeSeed();
 rl.Setup(mol);

      cerr << " Number of rotatable bonds: " << rl.Size() << endl;

      // indexed from 1, rotorKey[0] = 0
      vector<int> rotorKey(rl.Size() + 1, 0);

      // each entry represents the configuration of a rotor
      
      OBRotorIterator ri;
        rotamers.SetBaseCoordinateSets(mol);
        rotamers.Setup(mol,rl);
        for (int j = 0; j< 10; ++j){//Whatever number of conformers you want
      OBRotor *rotor = rl.BeginRotor(ri);
        for(int i = 1; i < rl.Size() + 1; ++i, rotor = rl.NextRotor(ri))
           rotorKey[i] = rand.NextInt() % rotor ->GetResolution().size();
      
      
      rotamers.AddRotamer(rotorKey);
        }
       
    rotamers.ExpandConformerList(mol, mol.GetConformers());
        
        for (int i = 0; i< mol.NumConformers(); i++){
            mol.SetConformer(i);
            pFF->ConjugateGradients(200);
            pFF->SteepestDescent(3000);
            pFF->WeightedRotorSearch(40, 20);//this will take awhile

             pFF->SteepestDescent(200); 
     
     

                 pFF->SetCoordinates(mol);
     
         }//end for  
 
-- 
View this message in context: 
http://n4.nabble.com/Re-OpenBabel-scripting-OBConformer-question-tp1478666p1555370.html
Sent from the openbabel-discuss mailing list archive at Nabble.com.

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to