Beispiel #1
0
 def match(self, nodes1, nodes2, polys, verbose):
     nodes1 = nodes1.split(',')
     nodes2 = nodes2.split(',')
     # build match matrix for nodes
     #  and lists of matching indices
     rmsdSelection1 = []
     rmsdSelection2 = []
     if verbose:
         print " Setting initial nodes..."
     for i in range(0, len(nodes1)):
         index1 = self._net1.getNodeIndex(nodes1[i])
         index2 = self._net2.getNodeIndex(nodes2[i])
         rmsdSelection1.append(index1)
         rmsdSelection2.append(index2)
         if verbose:
             print str(index1) + " " + str(index2)
     # build rmsd matrices
     if verbose:
         print " Computing projection..."
     rmsdNodePositions1 = self._net1.getNodePositionList()
     rmsdNodePositions2 = self._net2.getNodePositionList()
     rmsdNodePositions2.extend(polys.getPositionList())
     projection = rmsd.superpose(rmsdNodePositions1, rmsdNodePositions2,
                                 rmsdSelection1, rmsdSelection2)
     # we now have new coordinates for the second node set in projection
     #  transfer to net
     if verbose:
         print " Applying projection..."
     index = 0
     for i, n in enumerate(self._net2._nodes):
         self._net2._node2x[n] = projection[i][0]
         self._net2._node2y[n] = projection[i][1]
         index = index + 1
     for poly in polys._polys:
         for i in range(0, len(poly["shape"])):
             poly["shape"][i][0] = projection[i][0]
             poly["shape"][i][1] = projection[i][1]
             index = index + 1
Beispiel #2
0
 def match(self, nodes1, nodes2, polys, verbose):
     nodes1 = nodes1.split(',')
     nodes2 = nodes2.split(',')
     # build match matrix for nodes
     #  and lists of matching indices
     rmsdSelection1 = []
     rmsdSelection2 = []
     if verbose:
         print(" Setting initial nodes...")
     for i in range(0, len(nodes1)):
         index1 = self._net1.getNodeIndex(nodes1[i])
         index2 = self._net2.getNodeIndex(nodes2[i])
         rmsdSelection1.append(index1)
         rmsdSelection2.append(index2)
         if verbose:
             print(str(index1) + " " + str(index2))
     # build rmsd matrices
     if verbose:
         print(" Computing projection...")
     rmsdNodePositions1 = self._net1.getNodePositionList()
     rmsdNodePositions2 = self._net2.getNodePositionList()
     rmsdNodePositions2.extend(polys.getPositionList())
     projection = rmsd.superpose(
         rmsdNodePositions1, rmsdNodePositions2, rmsdSelection1, rmsdSelection2)
     # we now have new coordinates for the second node set in projection
     #  transfer to net
     if verbose:
         print(" Applying projection...")
     index = 0
     for i, n in enumerate(self._net2._nodes):
         self._net2._node2x[n] = projection[i][0]
         self._net2._node2y[n] = projection[i][1]
         index = index + 1
     for poly in polys._polys:
         for i in range(0, len(poly["shape"])):
             poly["shape"][i][0] = projection[i][0]
             poly["shape"][i][1] = projection[i][1]
             index = index + 1