Example #1
0
def create_description(index, atom, radius):

  return altloc.Description(
    data = sphere(
      centre = atom.xyz,
      radius = radius,
      index = index,
      ),
    coordinates = atom.xyz,
    altid = altloc.altid_for( atom = atom ),
    )
Example #2
0
File: asa.py Project: dials/cctbx
def create_description(index, atom, radius):

  return altloc.Description(
    data = sphere(
      centre = atom.xyz,
      radius = radius,
      index = index,
      ),
    coordinates = atom.xyz,
    altid = altloc.altid_for( atom = atom ),
    )
Example #3
0
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 ) )
  ]

DESCRIPTIONS = [
  altloc.Description(
    data = s,
    coordinates = s.centre,
    altid = altloc.altid_for( atom = atom ),
    )
    for ( s, atom ) in zip( SPHERES, ATOMS )
  ]

class TestSphere(unittest.TestCase):

  def test_creation(self):

    s1 = asa.sphere( centre = ( 0, 0, 0 ), radius = 3, index = 1 )
    s2 = asa.sphere( centre = ( 0, 0, 0 ), radius = 3, index = 2 )

    self.assertTrue( s1.index != s2.index )


  def test_low(self):
Example #4
0
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))
]

DESCRIPTIONS = [
    altloc.Description(
        data=s,
        coordinates=s.centre,
        altid=altloc.altid_for(atom=atom),
    ) for (s, atom) in zip(SPHERES, ATOMS)
]


class TestSphere(unittest.TestCase):
    def test_creation(self):

        s1 = asa.sphere(centre=(0, 0, 0), radius=3, index=1)
        s2 = asa.sphere(centre=(0, 0, 0), radius=3, index=2)

        self.assertTrue(s1.index != s2.index)

    def test_low(self):

        self.assertIterablesAlmostEqual(