Dear all,
I observed an erroneus parsing of /pqr/ files by openbabel.
Even while reading files created by openbabel itself, atom charges are lost.

I am not a C programmer, but I think the problem is in the file:

src/formats/pqrformat.cpp

at the functions /parseAtomCharge/ (line 186) and /parseAtomRadius/ (line
206)

the atom line should be:
Field name, atom number, atom name, residue name, residue number, x, y, z,
charge, radius, *element*
  // OR
Field, atom number, atom name, chain id, residue number, X, Y, Z, chg, rad,
* element*

The element field is actually expected in the function /parseAtomRecord/

so I think that at line 198-201:

    if (vs.size() == *10*)
      return atof(vs[8].c_str());
    else if (vs.size() == *11*)
      return atof(vs[9].c_str());

should be:

    if (vs.size() == *11*)
      return atof(vs[8].c_str());
    else if (vs.size() == *12*)
      return atof(vs[9].c_str());

similar fix should be applied at /line 213 and 215/.

I would be very glad if you could confirm this bug and in case fix it.

Thank you in advance,
Luigi




--
View this message in context: 
http://forums.openbabel.org/PQR-reading-file-tp4659049.html
Sent from the openbabel-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to