Beispiel #1
0
    def inaccessible_particles(self, radius):
        """
        Gives the number of loci/particles that are accessible to an object
        (i.e. a protein) of a given size.

        :param radius: radius of the object that we want to fit in the model

        :returns: a list of numbers, each being the ID of a particles that would
           never be reached by the given object

        TODO: remove this function

        """
        inaccessibles = []
        sphere = generate_sphere_points(100)
        for i in range(len(self)):
            impossibles = 0
            for xxx, yyy, zzz in sphere:
                thing = (xxx * radius + self['x'][i],
                         yyy * radius + self['y'][i],
                         zzz * radius + self['z'][i])
                # print form % (k+len(self), thing['x'], thing['y'], thing['z'],
                # 0, 0, 0, k+len(self)),
                for j in range(len(self)):
                    if i == j:
                        continue
                    # print self._square_distance_to(j, thing), radius
                    if self._square_distance_to(j, thing) < radius**2:
                        # print i, j
                        impossibles += 1
                        break
            if impossibles == 100:
                inaccessibles.append(i + 1)
        return inaccessibles
Beispiel #2
0
    def inaccessible_particles(self, radius):
        """
        Gives the number of loci/particles that are accessible to an object
        (i.e. a protein) of a given size.

        :param radius: radius of the object that we want to fit in the model

        :returns: a list of numbers, each being the ID of a particles that would
           never be reached by the given object

        TODO: remove this function

        """
        inaccessibles = []
        sphere = generate_sphere_points(100)
        for i in xrange(len(self)):
            impossibles = 0
            for xxx, yyy, zzz in sphere:
                thing = (xxx * radius + self['x'][i],
                         yyy * radius + self['y'][i],
                         zzz * radius + self['z'][i])
                # print form % (k+len(self), thing['x'], thing['y'], thing['z'],
                # 0, 0, 0, k+len(self)),
                for j in xrange(len(self)):
                    if i == j:
                        continue
                    # print self._square_distance_to(j, thing), radius
                    if self._square_distance_to(j, thing) < radius**2:
                        # print i, j
                        impossibles += 1
                        break
            if impossibles == 100:
                inaccessibles.append(i + 1)
        return inaccessibles