Bug/feature of findContacts

Lutz.Ehrlich@EMBL-Heidelberg.de Lutz.Ehrlich@EMBL-Heidelberg.de
Thu, 6 Aug 1998 15:51:47 +0200 (MDT)


Hi there,


I just found a bug/feature of the MolecularSurface module which leads to
strange behaviour in the Collection.findContacts method. If you read in two
collections from separate PDB files , each atom will get an index according
to the position in the PDB. The problem arises if you use
Universe.addObject to combine these objects as you might get the same index
for two different atoms. Which gives _really_ strange results if you want
to compute the contacts between those two collections. Active renumbering
of atoms is done in the Universe.configuration method. 

So here's a patch for MolecularSurface.py which solves the problem


------------------------------ begin patch

*** MolecularSurface.py	Thu Aug  6 15:08:27 1998
--- MolecularSurface.py~	Thu Apr 30 17:19:40 1998
*************** Collection.GroupOfAtoms.surfaceAtoms = s
*** 61,67 ****
  # Determination of contacts between two groups of atoms
  #
  def findContacts(self, other, contact_factor = 1., cutoff= 0.):
-     configurationArray = self.universe().configuration().array
      atoms1 = self.atomList()
      atoms2 = other.atomList()
      index1 = map( lambda x: x.index, atoms1)
--- 61,66 ----
*************** def findContacts(self, other, contact_fa
*** 68,74 ****
      radius1 = map( lambda x, c=cutoff: x.vdW_radius+0.5*c, atoms1)
      index2 = map( lambda x: x.index, atoms2)
      radius2 = map( lambda x, c=cutoff: x.vdW_radius+0.5*c, atoms2)
!     contacts = _surface.getContacts(configurationArray,
  				    contact_factor, radius1, index1,
  				    radius2, index2)
      contact_pairs = []
--- 67,73 ----
      radius1 = map( lambda x, c=cutoff: x.vdW_radius+0.5*c, atoms1)
      index2 = map( lambda x: x.index, atoms2)
      radius2 = map( lambda x, c=cutoff: x.vdW_radius+0.5*c, atoms2)
!     contacts = _surface.getContacts(self.universe().configuration().array,
  				    contact_factor, radius1, index1,
  				    radius2, index2)
      contact_pairs = []


------------------------------ end patch

Anyway, I think that this is really undesired behaviour. IMHO, the
renumbering should be done as soon as an object is added to the respective
universe... What do you think? Konrad, what's your opinion here? I think we
should put this in the manual at least.

Cheers,	
	Lutz

______________________________________________________________________

Lutz Ehrlich		email:	lutz.ehrlich@embl-heidelberg.de
EMBL			web  :  http://www.embl-heidelberg.de/~ehrlich
Meyerhofstr. 1		
D-69012 Heidelberg	phone: +49-6221-387-140
Germany			fax  : +49-6221-387-517