Hi,
I just ran into a nice little puzzle with Coot, which turned out
to be due the locale settings. PDB files were not being loaded
correctly on a system where the locale setting had been changed
from "en_US" to "nl_BE" (Belgian settings). This has the effect
of changing the decimal separator from a period to a comma, which
in turn causes Coot/MMDB to truncate all floating point numbers
at the period. It does make for a very interesting visual effect:
all atoms are placed on a regularly spaced 3D grid with
1 Angstrom intervals. (If you want to see it for yourself,
try something like 'LC_NUMERIC="nl_BE" coot --pdb file.pdb'
in bash.)
Anyway, we solved the problem locally by setting the locale (or
at least the LC_NUMERIC setting) back to "en_US", "C", or "POSIX".
Perhaps such a setting could be added to the Coot startup script,
to make the reading of PDB files more robust against local machine
configurations. Alternatively, this C code could be added to
the Coot startup code:
#include <locale.h>
...
setlocale(LC_NUMERIC, "POSIX");
I do not think there is anything else in Coot that would benefit
from following locale settings. There seems little point in
displaying floating point numbers with commas instead of periods
in a scientific application, and it does not use dates, times
or monetary quantitities. (Maybe we could a system that keeps
track of how much the structure you are working on has cost
you so far ;-) ).
The most granular solution would be for MMDB to set the locale
to "C" or "POSIX" whenever it uses strtod() calls (mainly in
mmdb_util.cpp) to convert strings to floating point numbers.
This would allow Coot to use locale settings (if this were ever
to become necessary) without changing the PDB reading behaviour.
It also appears that some Windows systems are affected by this,
but in that case I guess the behaviour is determined by the
country settings in the Control Panel. I will investigate
further.
Cheers,
--
Lieven Buts
Ultrastructure Laboratory
Vrije Universiteit Brussel
|