コード例 #1
0
ファイル: __init__.py プロジェクト: keitaroyam/cctbx_fork
def get_restraint_values(threes, interpolate=False):
  from mmtbx.conformation_dependent_library import utils
  res_type_group = cdl_utils.get_res_type_group(
    threes[1].resname,
    threes[2].resname,
  )
  if res_type_group is None: return None
  if interpolate:
    restraint_values = ["2", -1]
    key = threes.get_cdl_key(exact=interpolate)
    for i in range(2,26):
      grid = utils.get_grid_values(res_type_group, key[0], key[1], column=i)
      index = utils.get_index(*key)
      r = utils.interpolate_2d(grid, index)
      restraint_values.append(r)
  else:
    key = threes.get_cdl_key()
    restraint_values = cdl_database[res_type_group][key]
  return restraint_values
コード例 #2
0
def get_restraint_values(threes, interpolate=False):
  from mmtbx.conformation_dependent_library import utils
  res_type_group = cdl_utils.get_res_type_group(
    threes[1].resname,
    threes[2].resname,
  )
  if res_type_group is None: return None
  if interpolate:
    restraint_values = ["2", -1]
    key = threes.get_cdl_key(exact=interpolate)
    for i in range(2,26):
      grid = utils.get_grid_values(res_type_group, key[0], key[1], column=i)
      index = utils.get_index(*key)
      r = utils.interpolate_2d(grid, index)
      restraint_values.append(r)
  else:
    key = threes.get_cdl_key()
    if key is None: return None
    restraint_values = cdl_database[res_type_group][key]
  return restraint_values
コード例 #3
0
def get_restraint_values(threes,
                         cdl_svl=False,
                         interpolate=False):
  from mmtbx.conformation_dependent_library import utils
  res_type_group = cdl_utils.get_res_type_group(
    threes[1].resname,
    threes[2].resname,
  )
  if res_type_group is None: return None
  #
  if cdl_svl:
    assert not interpolate
    key = '%s/%s' % (['trans', 'cis'][threes.cis_group()],
                     ['trans', 'cis'][threes.cis_group(omega_cdl=True)])
    assert cdl_svl_database.get(key, None)
    current = cdl_svl_database[key]
    restraint_values = current[res_type_group]
    return restraint_values
  #
  if threes.cis_group():
    resnames = threes.get_resnames()
    if resnames[1]=='PRO':
      # cis-PRO
      restraint_values = ['?', 0, 127.0, 2.4] # CNA
      restraint_values += [102.6, 1.1, # NAB
                           112.1, 2.6, # NAC
                           112.0, 2.5, # BAC
                           120.2, 2.4, # ACO
                           117.1, 2.8, # ACN
                           121.1, 1.9, # OCN
                           1.338, 0.019, # CN
                           1.468, 0.017, # NA
                           1.533, 0.018, # AB
                           1.524, 0.020, # AC
                           1.228, 0.020, # CO
      ]
      restraint_values += [120.6, 2.2, # CND
                           111.5, 1.4, # AND
                           103.8, 1.2, # NDG
                           104.0, 1.9, # ABG
                           105.4, 2.3, # BGD
                           1.506, 0.039, # BG
                           1.512, 0.027, # GD
                           1.474, 0.014, # ND
      ]
    else:
      # cis-NonPRO
      restraint_values = ['?', 0, 123.0, 3.0]
    return restraint_values
  #
  if interpolate:
    restraint_values = ["2", -1]
    key = threes.get_cdl_key(exact=interpolate)
    for i in range(2,26):
      grid = utils.get_grid_values(res_type_group, key[0], key[1], column=i)
      index = utils.get_index(*key)
      r = utils.interpolate_2d(grid, index)
      restraint_values.append(r)
  else:
    key = threes.get_cdl_key()
    if key is None: return None
    restraint_values = cdl_database[res_type_group][key]
  return restraint_values