Dear all,
I have just seen something strange. I have a piece of C++ code (at the end
of the email) which displays the atom types of a molecule. Depending on the
format of the input file, some types are different:
* with ./Typing.exe 10gs_ligand.sdf, the 4th atom is of type "o" (which is
the good type)
* with ./Typing.exe 10gs_ligand.xyz, the 4th atom is of type "os"
The file 10gs_ligand.sdf is the ligand coming from the PDB ID 10GS, and I
converted it in .xyz with "obabel 10gs_ligand.sdf -O 10gs_ligand.xyz". (I
don't know if the list accepts joined files so I am not sending it, but I
can share it with whoever is interested). I have compiled the code with the
2.3.2 version and with the development version 2.3.90 and the same answers
are found.
2 weeks ago David van der Spoel told me on this list that the atomtyping
with GAFF is not entirely correct. However, I am not sure this is related
to it. It seems to me that it is more related on how sdf or xyz files are
read in OBMol objects.
What do you think?
Nicolas
************************
#include <openbabel/mol.h>
#include <openbabel/obconversion.h>
#include <openbabel/forcefield.h>
#include <openbabel/atom.h>
using namespace std;
int main(int nbarg, char * argv[])
{
// Read input and create an obMol
string molecule = argv[1] ;
OpenBabel::OBConversion obConversion ;
OpenBabel::OBFormat *format =
obConversion.FormatFromExt(molecule.c_str()) ;
obConversion.SetInFormat(format) ;
OpenBabel::OBMol obMol ;
obConversion.ReadFile(&obMol, molecule.c_str()) ;
// Define the forcefield
string forceFieldName="GAFF";
OpenBabel::OBForceField
*forceField=OpenBabel::OBForceField::FindForceField(forceFieldName);
if (!forceField) {
cout << "ERROR: Could not find forcefield " <<
forceFieldName << "." << endl;
}
forceField->SetLogFile(&cout);
forceField->SetLogLevel(OBFF_LOGLVL_NONE);
// Setup the forcefield
if (!forceField->Setup(obMol)) {
cout << "ERROR: Could not setup force field." << endl;
}
forceField->GetAtomTypes(obMol);
// Display the atom types
for(int i=1; i<=obMol.NumAtoms(); i++) {
OpenBabel::OBAtom *atom ;
atom = obMol.GetAtom(i) ;
OpenBabel::OBPairData *type = (OpenBabel::OBPairData*)
atom->GetData("FFAtomType");
cout << "atomType = " << type->GetValue() << endl;
}
return 0;
}
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss