Exemple #1
0
def run(filename):
    print filename
    if 0:
        print "RDL"
        for aa in sorted(rdl_database):
            print "  %s" % aa
            for key, value in rdl_database[aa].items():
                print "    %s" % key
                for names, values in rdl_database[aa][key].items():
                    print "      %s : %s" % (names, values)
        assert 0
    #
    if filename == "3sgs.pdb":
        from libtbx import easy_run
        f = file("mse.pdb", "wb")
        f.write(pdbs["mse.pdb"])
        f.close()
        f = file("met.pdb", "wb")
        f.write(pdbs["met.pdb"])
        f.close()
        cmd = "phenix.pdb_interpretation rdl=True write_geo=1 mse.pdb"
        print cmd
        easy_run.call(cmd)
        cmd = "phenix.pdb_interpretation rdl=True write_geo=1 met.pdb"
        print cmd
        easy_run.call(cmd)
    #
    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()
    rdl.update_restraints(
        pdb_hierarchy,
        geometry_restraints_manager,
        assert_rotamer_found=True,
        verbose=True,
    )
    print "OK"

    mmtbx_dir = libtbx.env.dist_path("mmtbx")
    props = os.path.join(mmtbx_dir, "rotamer", "rotamer_names.props")
    f = file(props, "rb")
    props = f.readlines()
    f.close()
    for prop in props:
        print prop
        key = prop.split("=")[0]
        residue, rotamer_name = key.split()
        residue = residue.upper()
        if residue in ["MSE"]: continue
        assert residue in rdl_database
        assert rotamer_name in rdl_database[residue]
Exemple #2
0
def run(filename):
  print filename
  if 0:
    print "RDL"
    for aa in sorted(rdl_database):
      print "  %s" % aa
      for key, value in rdl_database[aa].items():
        print "    %s" % key
        for names, values in rdl_database[aa][key].items():
          print "      %s : %s" % (names, values)
    assert 0
  #
  if filename=="3sgs.pdb":
    from libtbx import easy_run
    f=file("mse.pdb", "wb")
    f.write(pdbs["mse.pdb"])
    f.close()
    f=file("met.pdb", "wb")
    f.write(pdbs["met.pdb"])
    f.close()
    cmd="phenix.pdb_interpretation rdl=True write_geo=1 mse.pdb"
    print cmd
    easy_run.call(cmd)
    cmd="phenix.pdb_interpretation rdl=True write_geo=1 met.pdb"
    print cmd
    easy_run.call(cmd)
  #
  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()
  rdl.update_restraints(pdb_hierarchy,
                        geometry_restraints_manager,
                        assert_rotamer_found=True,
                        verbose=True,
    )
  print "OK"


  mmtbx_dir = libtbx.env.dist_path("mmtbx")
  props = os.path.join(mmtbx_dir,"rotamer","rotamer_names.props")
  f=file(props, "rb")
  props = f.readlines()
  f.close()
  for prop in props:
    print prop
    key = prop.split("=")[0]
    residue, rotamer_name = key.split()
    residue = residue.upper()
    if residue in ["MSE"]: continue
    assert residue in rdl_database
    assert rotamer_name in rdl_database[residue]
 def updaterdl(self, prefix):
     if self.restraints_manager is None: return
     from mmtbx.conformation_dependent_library import rotamers
     from mmtbx.refinement import print_statistics
     print_statistics.make_header(prefix, out=self.log)
     self.rdl_proxies = None  #rotamers.setup_restraints(result)
     rc = rotamers.update_restraints(
         self.pdb_hierarchy,
         self.restraints_manager.geometry,
         current_geometry=self.pdb_hierarchy.extract_xray_structure(),
         rdl_proxies=self.rdl_proxies,
         log=self.log,
         verbose=False,
     )
     print >> self.log, "=" * 79
     return rc
 def updaterdl(self, prefix):
   if self.restraints_manager is None: return
   from mmtbx.conformation_dependent_library import rotamers
   from mmtbx.refinement import print_statistics
   print_statistics.make_header(prefix, out=self.log)
   self.rdl_proxies = None #rotamers.setup_restraints(result)
   rc = rotamers.update_restraints(
     self.pdb_hierarchy,
     self.restraints_manager.geometry,
     current_geometry=self.pdb_hierarchy.extract_xray_structure(),
     rdl_proxies=self.rdl_proxies,
     log=self.log,
     verbose=False,
     )
   print >> self.log, "="*79
   return rc