Exemple #1
0
def exercise_basic():
    t = ramachandran.load_tables()["ala"]
    assert approx_equal(t.get_score(0.0, 0.0), -26.16, eps=0.01)
    assert approx_equal(t.get_score(-60, 120), 10.41, eps=0.01)
    assert approx_equal(t.get_score(90, 90), -7.43, eps=0.01)
    assert approx_equal(t.get_energy(0.0, 0.0), 53.81, eps=0.01)
    assert approx_equal(t.get_energy(-60, 120), 17.24, eps=0.01)
    e1 = t.get_energy(-85.0, 85.0)
    e2 = t.get_energy(-85.000001, 85.000001)
    assert approx_equal(e1, e2, eps=0.000001)
    assert approx_equal(t.get_energy(-85.0, 86.0), 21.3345, eps=0.001)
    assert approx_equal(t.get_energy(-86.0, 85.0), 21.389, eps=0.001)
    ext = bp.import_ext("mmtbx_ramachandran_restraints_ext")
    proxies = ext.shared_phi_psi_proxy()
    proxies.append(
        ext.phi_psi_proxy(i_seqs=[0, 1, 2, 3, 4],
                          residue_type="general",
                          weight=1))
    proxies.append(
        ext.phi_psi_proxy(i_seqs=[4, 5, 6, 7, 8],
                          residue_type="pre-proline",
                          weight=1))
    proxies.append(
        ext.phi_psi_proxy(i_seqs=[8, 9, 10, 11, 12],
                          residue_type="general",
                          weight=1))
    selected = proxies.proxy_select(n_seq=13, iselection=flex.size_t(range(9)))
    assert (selected.size() == 2)
    assert list(selected[0].get_i_seqs()) == [0, 1, 2, 3, 4]
    assert selected[0].residue_type == "general"
    assert list(selected[1].get_i_seqs()) == [4, 5, 6, 7, 8]
    assert selected[1].residue_type == "pre-proline"
def exercise_basic () :
  t = ramachandran.load_tables()["ala"]
  assert approx_equal(t.get_score(0.0,0.0), -26.16, eps=0.01)
  assert approx_equal(t.get_score(-60,120), 10.41, eps=0.01)
  assert approx_equal(t.get_score(90,90), -7.43, eps=0.01)
  assert approx_equal(t.get_energy(0.0,0.0), 53.81, eps=0.01)
  assert approx_equal(t.get_energy(-60,120), 17.24, eps=0.01)
  e1 = t.get_energy(-85.0, 85.0)
  e2 = t.get_energy(-85.000001, 85.000001)
  assert approx_equal(e1, e2, eps=0.000001)
  assert approx_equal(t.get_energy(-85.0, 86.0), 21.3345, eps=0.001)
  assert approx_equal(t.get_energy(-86.0, 85.0), 21.389, eps=0.001)
  ext = boost.python.import_ext("mmtbx_ramachandran_restraints_ext")
  proxies = ext.shared_phi_psi_proxy()
  proxies.append(
    ext.phi_psi_proxy(
      i_seqs=[0,1,2,3,4],
      residue_name="ALA",
      residue_type="general"))
  proxies.append(
    ext.phi_psi_proxy(
      i_seqs=[4,5,6,7,8],
      residue_name="ALA",
      residue_type="pre-proline"))
  proxies.append(
    ext.phi_psi_proxy(
      i_seqs=[8,9,10,11,12],
      residue_name="ALA",
      residue_type="general"))
  selected = proxies.proxy_select(n_seq=13,
    iselection=flex.size_t(range(9)))
  assert (selected.size() == 2)
  assert list(selected[0].get_i_seqs()) == [0,1,2,3,4]
  assert selected[0].residue_name == "ALA"
  assert selected[0].residue_type == "general"
  assert list(selected[1].get_i_seqs()) == [4,5,6,7,8]
  assert selected[1].residue_name == "ALA"
  assert selected[1].residue_type == "pre-proline"