Skip to content

Commit

Permalink
sync with Julien's fix
Browse files Browse the repository at this point in the history
  • Loading branch information
halx committed Dec 21, 2017
1 parent 77be3b3 commit 95332e0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mutate/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""


__revision__ = "$Id$"
__revision__ = "$Id: util.py 654 2017-11-08 12:06:35Z jmichel $"


import sys
Expand Down Expand Up @@ -356,6 +356,7 @@ def mcss(mol2str_1, mol2str_2, maxtime=60, isotope_map=None, selec=''):
logger.write('Applying spatially-closest algorithm (%s, %s matches)\n' %
(len(m1), len(m2) ) )


# FIXME: is it possible that the smaller one has more then one matches
# when uniquify=True?
if len(m1) < len(m2):
Expand Down Expand Up @@ -388,19 +389,18 @@ def mcss(mol2str_1, mol2str_2, maxtime=60, isotope_map=None, selec=''):
pos2 = conf2.GetAtomPosition(idx2)
d2 = (pos1.x - pos2.x)**2 + (pos1.y - pos2.y)**2 +\
(pos1.z - pos2.z)**2
# Ignore small deviations
#if d2 < DEVTHRESHOLD:
# d2 = 0.0
sumd += d2
#print (x,y,sumd)
#print (x,y,sumd,mind)
if sumd < mind:
mind = sumd
minxy = [x,y]
#print (mind, minxy)
if swapped:
mapping = dict(zip(m2[minxy[1]], m1[minxy[0]]))
else:
mapping = dict(zip(m1[minxy[1]], m2[minxy[0]]))
# JM bug 11/17 ?
#mapping = dict(zip(m1[minxy[1]], m2[minxy[0]]))
mapping = dict(zip(m1[minxy[0]], m2[minxy[1]]))
#print (mapping)

#dist_sum = []
#for match1 in m1:
Expand Down

0 comments on commit 95332e0

Please sign in to comment.