Hi all,


 
        I tried to calculate other similarity coefficient (Dice, Russell, etc.) 
through babel C ++ API. Firstly, I tried to test the Tanimoto() function 
through C++ API, the main function of program is as follow:
-----------------------------------------------------------------------------
#include <iostream>
#include<openbabel/obconversion.h>
#include<openbabel/mol.h>
#include<openbabel/fingerprint.h>
#include<openbabel/generic.h>
using namespace std;
using namespace OpenBabel;
int main (int argc, char **argv)
{


 double sim_coefficient;
 OBConversion obconversion;
 obconversion.SetInFormat("sdf");
 obconversion.SetOutFormat("sdf");
 OBMol mol,mol2;
 
 ifstream input(argv[1]);


 obconversion.Read(&mol,&input);


 vector<unsigned int> fp1,fp2;
 OBFingerprint *pFP = OBFingerprint::FindFingerprint("FP2");
 
 pFP->GetFingerprint(&mol,fp1);
 


 bool notatend = obconversion.ReadFile(&mol2,argv[2]);
 while (notatend)
 {
  pFP->GetFingerprint(&mol2,fp2);
  sim_coefficient= OBFingerprint::Tanimoto(fp1,fp2);  
  mol2.Clear();
  notatend = obconversion.Read(&mol2);
 }
 input.close();
 return 0;
}
-----------------------------------------------------------------------
But the Tanimoto coefficient obtained by this code is not identical to the 
result using babel program directly. Would you like to give me some help about 
this problem? Thanks in advance.




Best Regards


Duan Baogen






------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to