def main():
  pdb_inp = pdb.input(lines=pdb_1ehz, source_info='model_1ehz')
  pdb_hierarchy = pdb_inp.construct_hierarchy()
  geometry_restraints_manager = get_geometry_restraints_manager(raw_records=pdb_1ehz)
  pdb_hierarchy.reset_i_seq_if_necessary()
  from mmtbx.conformation_dependent_library import generate_dna_rna_fragments
  for k in range(2,3):
    for j, threes in enumerate(generate_dna_rna_fragments(
      pdb_hierarchy,
      geometry_restraints_manager,
      length=k,
      #verbose=True,
      )):
      print k,j,threes
      print threes.get_base_types()
      print threes.get_ntc_angles()
Esempio n. 2
0
        return get_ca_dihedrals(self)


class FiveProteinResidues(FourProteinResidues):
    def get_cablam_info(self):
        assert 0


if __name__ == "__main__":
    import sys
    from iotbx import pdb
    from test_rdl import get_geometry_restraints_manager
    filename = sys.argv[1]
    pdb_inp = pdb.input(filename)
    pdb_hierarchy = pdb_inp.construct_hierarchy()
    geometry_restraints_manager = get_geometry_restraints_manager(filename)
    pdb_hierarchy.reset_i_seq_if_necessary()
    from mmtbx.conformation_dependent_library import generate_protein_fragments
    for i in range(2, 6):
        for threes in generate_protein_fragments(
                pdb_hierarchy,
                geometry_restraints_manager,
                length=i,
                #verbose=verbose,
        ):
            print threes
            try:
                print '  omega   %5.1f' % threes.get_omega_value()
            except:
                print '  omega is not valid'  # intentional
            print '  omegas  %s' % threes.get_omega_values()
        bond.distance_ideal = averages[key]/averages.n[key]
      elif len(key)==3:
        rkey = (key[2],key[1],key[0])
        averages.n[rkey]=averages.n[key]
    for angle in self.geometry.angle_proxies:
      if angle.i_seqs in averages.n:
        key = angle.i_seqs
        if key not in averages:
          assert 0
        angle.angle_ideal = averages[key]/averages.n[key]

if __name__=="__main__":
  import sys
  from iotbx import pdb
  from test_rdl import get_geometry_restraints_manager
  filename=sys.argv[1]
  pdb_inp = pdb.input(filename)
  pdb_hierarchy = pdb_inp.construct_hierarchy()
  geometry_restraints_manager = get_geometry_restraints_manager(filename)
  pdb_hierarchy.reset_i_seq_if_necessary()
  from mmtbx.conformation_dependent_library import generate_protein_threes
  for threes in generate_protein_threes(pdb_hierarchy,
                                        geometry_restraints_manager,
                                        #verbose=verbose,
                                        ):
    print threes
    print "  cis? %s" % threes.cis_group()
    print "  rama %s" % threes.get_ramalyze_key()
    print '  conf %s' % threes.is_pure_main_conf()
  print "OK"
Esempio n. 4
0
def main():
    pdb_inp = pdb.input(lines=model_1yjp, source_info='model_1yjp')
    pdb_hierarchy = pdb_inp.construct_hierarchy()
    geometry_restraints_manager = get_geometry_restraints_manager(
        raw_records=model_1yjp)
    pdb_hierarchy.reset_i_seq_if_necessary()
    from mmtbx.conformation_dependent_library import generate_protein_fragments
    for k in range(2, 6):
        for j, threes in enumerate(
                generate_protein_fragments(
                    pdb_hierarchy,
                    geometry_restraints_manager,
                    length=k,
                    #verbose=verbose,
                )):
            i = k - 2
            print(i, j, k, threes)
            rc = None
            try:
                rc = threes.get_omega_value()
            except:
                print('  omega is not valid')  # intentional
            if i > 0: assert rc == None
            else:
                print('  omega   %5.1f' % rc)
                assert rc == answers['omegas'][j]
            rc = threes.get_omega_values()
            print('  omegas  %s' % rc)
            assert rc == answers['omegas'][j:j + i + 1], '%s != %s' % (
                rc, answers['omegas'][j:j + i + 1])
            rc = None
            try:
                rc = threes.cis_group()
            except:
                pass  # intentional
            try:
                print("  cis?    %-5s %s" % (rc, threes.cis_group(limit=30)))
            except:
                print('  cis? is not valid')  # intentional
            if i >= 2:
                assert (rc == None or rc == False), '%s!=%s' % (rc, None)
            else:
                assert rc == False
            try:
                print("  trans?  %-5s %s" %
                      (threes.trans_group(), threes.trans_group(limit=30)))
            except:
                print('  tran? is not valid')  # intentional
            print('  cis/trans/twisted? %s' %
                  ' '.join(threes.cis_trans_twisted_list()))
            try:
                print("  rama    %s" % threes.get_ramalyze_key())
            except:
                print('  rama not specified')  # intentional
            print('  conf    %s' % threes.is_pure_main_conf())
            rc = None
            try:
                rc = threes.get_phi_psi_angles()
            except:
                print('  phi/psi not specified')  # intentional
            print('  phi/psi %s' % rc)
            if i < 1: assert rc == None
            else:
                test = answers['phi_psi'][j * 2:(j + i) * 2]
                assert rc == test, '%s!=%s' % (rc, test)
            rc = None
            try:
                rc = threes.get_ca_dihedrals()
            except:
                print('  CA dihedrals not specified')  # intentional
            print('  CA dihedrals %s' % rc)
            if i <= 1: assert rc == None
            else:
                test = answers['calphas'][j:j + i + 1 - 2]
                assert rc == test

        print("OK", i + 2)