Esempio n. 1
0
 def GenerateSubshapeShape(self, cmpd, confId=-1, addSkeleton=True, **kwargs):
   shape = SubshapeObjects.ShapeWithSkeleton()
   shape.grid = Geometry.UniformGrid3D(self.gridDims[0], self.gridDims[1], self.gridDims[2],
                                       self.gridSpacing)
   AllChem.EncodeShape(cmpd, shape.grid, ignoreHs=False, confId=confId)
   if addSkeleton:
     conf = cmpd.GetConformer(confId)
     self.GenerateSubshapeSkeleton(shape, conf, **kwargs)
   return shape
Esempio n. 2
0
  def SampleSubshape(self, subshape1, newSpacing):
    ogrid = subshape1.grid
    rgrid = Geometry.UniformGrid3D(self.gridDims[0], self.gridDims[1], self.gridDims[2], newSpacing)
    for idx in range(rgrid.GetSize()):
      l = rgrid.GetGridPointLoc(idx)
      v = ogrid.GetValPoint(l)
      rgrid.SetVal(idx, v)

    res = SubshapeObjects.ShapeWithSkeleton()
    res.grid = rgrid
    return res