Christoph Brockmann schrieb:
> Hi,
>
> I have just discovered that the distances listed in the Asignment
> Dialogue and those shown on the structure are quite wrong (somehow
> proportional to the distance). 10A get 3.something A, 2.06A get 1.1A.
>
> Christoph
>
After thinking a bit about this (my present stage of structure
determination would be much more fun if the function was working
correctly), I found the following:
StructureBasic.py says:
Snip %<
distSum = 0.0
for i in coordList1.keys():
coords1 = coordList1[i]
coords2 = coordList2[i]
for coord1 in coords1:
for coord2 in coords2:
dx = coord1.x - coord2.x
dy = coord1.y - coord2.y
dz = coord1.z - coord2.z
distSum = sqrt((dx*dx) + (dy*dy) + (dz*dz))
n += 1.0
if n > 0.0:
return distSum/n
Snap >%
which should return the average distance off all pairs of coordinates
from coordList1 and coordList2. What it seems to do, however is to
return the distance of the last pair divided by the number of determined
distances. (Simply because the n are summed up " n +=1" but the
Distances are not. I am not a python-expert but I would suggest that simply
distSum += sqrt((dx*dx) + (dy*dy) + (dz*dz))
should do the trick. Otherwise one could store the distance in a
temporary variable and then add it explicitely to the Sum:
dist = sqrt((dx*dx) + (dy*dy) + (dz*dz))
distSum = distSum + dist
Am I getting this right?
Christoph
--
--------------------------------------------------------------------
Christoph Brockmann
Forschungsinstitut fuer Molekulare Pharmakologie (FMP)
Robert Roessle Str. 10
D-13125 BERLIN, Germany
phone: +49-30-94793-223
email: [log in to unmask]
--------------------------------------------------------------------
|