示例#1
0
文件: asa.py 项目: dials/cctbx
def calculate(
  atoms,
  calculation = simple_surface_calculation,
  indexer_selector = get_optimal_indexer_for,
  probe = 1.4,
  precision = 960,
  ):

  from cctbx.eltbx import van_der_waals_radii
  radius_for = van_der_waals_radii.vdw.table

  descriptions = [
    create_description(
      index = i,
      atom = a,
      radius = radius_for[ a.element.strip().capitalize() ] + probe,
      )
    for ( i, a ) in enumerate( atoms )
    ]

  indexer = indexer_selector( descriptions = descriptions )

  from mmtbx.geometry import sphere_surface_sampling
  sampling = sphere_surface_sampling.golden_spiral( count = precision )

  values = [
    calculation( indexer = indexer, sampling = sampling, description = d )
    for d in descriptions
    ]

  return AccessibleSurfaceAreas(
    values = values,
    unit = sampling.unit_area,
    )
示例#2
0
def calculate(
  atoms,
  calculation = simple_surface_calculation,
  indexer_selector = get_optimal_indexer_for,
  probe = 1.4,
  precision = 960,
  ):

  from cctbx.eltbx import van_der_waals_radii
  radius_for = van_der_waals_radii.vdw.table

  descriptions = [
    create_description(
      index = i,
      atom = a,
      radius = radius_for[ a.element.strip().capitalize() ] + probe,
      )
    for ( i, a ) in enumerate( atoms )
    ]

  indexer = indexer_selector( descriptions = descriptions )

  from mmtbx.geometry import sphere_surface_sampling
  sampling = sphere_surface_sampling.golden_spiral( count = precision )

  values = [
    calculation( indexer = indexer, sampling = sampling, description = d )
    for d in descriptions
    ]

  return AccessibleSurfaceAreas(
    values = values,
    unit = sampling.unit_area,
    )
示例#3
0
    def get_transformed_points(self):

        from mmtbx.geometry import sphere_surface_sampling
        sampling = sphere_surface_sampling.golden_spiral(count=5)
        return (list(sampling.points),
                asa.accessibility.transform(
                    range=sampling.points,
                    transformation=self.transformation,
                ))
示例#4
0
  def get_transformed_points(self):

    from mmtbx.geometry import sphere_surface_sampling
    sampling = sphere_surface_sampling.golden_spiral( count = 5 )
    return (
      list( sampling.points ),
      asa.accessibility.transform(
        range = sampling.points,
        transformation = self.transformation,
        )
      )
示例#5
0
    def setUp(self):

        self.sampling = sphere_surface_sampling.golden_spiral(count=5)
        self.count = 5
        self.points = [
            (0.5999999999999999, -0.8, 0.0),
            (-0.6758097397797129, -0.39999999999999997, 0.6190970809322855),
            (0.08742572471695988, 5.551115123125783e-17, -0.9961710408648278),
            (0.5576434272376701, 0.4000000000000002, 0.7273471028736039),
            (-0.590828091189257, 0.8, -0.10450917022758696)
        ]
  def setUp(self):

    self.sampling = sphere_surface_sampling.golden_spiral( count = 5 )
    self.count = 5
    self.points = [
      ( 0.5999999999999999, -0.8, 0.0 ),
      ( -0.6758097397797129, -0.39999999999999997, 0.6190970809322855 ),
      ( 0.08742572471695988, 5.551115123125783e-17, -0.9961710408648278 ),
      ( 0.5576434272376701, 0.4000000000000002, 0.7273471028736039 ),
      ( -0.590828091189257, 0.8, -0.10450917022758696 )
      ]
示例#7
0
  def test_range(self):

    from mmtbx.geometry import sphere_surface_sampling
    sampling = sphere_surface_sampling.golden_spiral( count = 960 )
    transformed = asa.accessibility.transform(
      range = sampling.points,
      transformation = self.transformation,
      )
    self.assertEqual( len( sampling.points ), len( transformed ) )

    for ( o, t ) in zip( sampling.points, transformed ):
      self.assertIterablesAlmostEqual( t, self.transform( site = o ), 7 )
示例#8
0
    def test_range(self):

        from mmtbx.geometry import sphere_surface_sampling
        sampling = sphere_surface_sampling.golden_spiral(count=960)
        transformed = asa.accessibility.transform(
            range=sampling.points,
            transformation=self.transformation,
        )
        self.assertEqual(len(sampling.points), len(transformed))

        for (o, t) in zip(sampling.points, transformed):
            self.assertIterablesAlmostEqual(t, self.transform(site=o), 7)
示例#9
0
import os.path
import unittest

SOLVENT_RADIUS = 1.4

PDB = os.path.join(
  libtbx.env.under_dist( "mmtbx", "geometry" ),
  "tests",
  "1ahq_trunc.pdb"
  )
ROOT = iotbx.pdb.input( PDB ).construct_hierarchy()
ATOMS = ROOT.atoms()

from mmtbx.geometry import sphere_surface_sampling
SAMPLING_POINTS = sphere_surface_sampling.golden_spiral( count = 960 )

from cctbx.eltbx import van_der_waals_radii
TABLE = van_der_waals_radii.vdw.table

PROBE = 1.4

RADII = [
  TABLE[ atom.determine_chemical_element_simple().strip().capitalize() ]
  for atom in ATOMS
  ]
SPHERES = [
  asa.sphere( centre = atom.xyz, radius = radius + PROBE, index = index )
  for ( index, ( atom, radius ) ) in enumerate( zip( ATOMS, RADII ) )
  ]
示例#10
0
import iotbx.pdb
import libtbx.load_env

import os.path
import unittest

SOLVENT_RADIUS = 1.4

PDB = os.path.join(libtbx.env.under_dist("mmtbx", "geometry"), "tests",
                   "1ahq_trunc.pdb")
ROOT = iotbx.pdb.input(PDB).construct_hierarchy(sort_atoms=False)
ATOMS = ROOT.atoms()

from mmtbx.geometry import sphere_surface_sampling

SAMPLING_POINTS = sphere_surface_sampling.golden_spiral(count=960)

from cctbx.eltbx import van_der_waals_radii

TABLE = van_der_waals_radii.vdw.table

PROBE = 1.4

RADII = [
    TABLE[atom.determine_chemical_element_simple().strip().capitalize()]
    for atom in ATOMS
]
SPHERES = [
    asa.sphere(centre=atom.xyz, radius=radius + PROBE, index=index)
    for (index, (atom, radius)) in enumerate(zip(ATOMS, RADII))
]