[MMTK] Re: Conjugate gradient minimization in 2.2b6

Konrad Hinsen hinsen@cnrs-orleans.fr
Mon, 20 Aug 2001 12:29:33 +0200

> I am running MMTK on a PC with Redhat 7.1. The versions are Python-1.5.2
> and Numeric-17.3.0.

That should work fine - but let's test it. My test was with
Python-2.1.1 and Numeric 20.1, also under RedHat 7.1.

> I ran your script on my outfile "gly_allCH3.nc" and it only printed "0"
> which of course explains what I had observed.

Strange.  Could you do the following test: after setting the "fixed"

       print universe.getAtomBooleanArray('fixed').array.typecode()

That should print "l", and the minimization code assumes that
this array is of type "l" without checking. There is a slight
possibility that a different NumPy version creates an array of
different type.

While you are at it, you can also do

   print universe.getAtomBooleanArray('fixed').sumOverParticles()

which should print "4".

> There's one thing I don't understand, namely how the atoms are numbered.

That's a somewhat difficult topic... There is no relation at all
between the atom numbers (which you can obtain as atom.index in
Python) and the order of atom lists. In fact, the order of the atom
lists might change every time they are recreated, although usually it

When creating a universe from a PDB file, the atom indices are
equal to the PDB atom number (-1) if the following three conditions
are fulfilled:

1) All atoms in the PDB file are contained in the universe.
2) No atoms were added to the universe (e.g. missing hydrogen atoms).
3) The atoms in the PDB file are numbered consecutively.

In your case, the last condition is not fulfilled because of the TER
lines, which have their own numbers; I think they shouldn't according
to the PDB standard, but I am not sure.

Konrad Hinsen                            | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais