Example #1
0
def run():
  from libtbx.utils import format_cpu_times
  from mmtbx.rotamer import rotamer_eval
  from mmtbx.rotamer import ramachandran_eval

  initial_current_working_directory = os.getcwd()
  rotamer_data_dir = rotamer_eval.find_rotarama_data_dir(optional=True)
  if rotamer_data_dir is None:
    print('  Rebuilding rotarama library skipped. Needs rotamer library.')
    return
  target_db = rotamer_eval.open_rotarama_dlite(
    rotarama_data_dir=rotamer_data_dir)
# rebuild_pickle_files(data_dir=rotamer_data_dir,
#   file_prefix="rota500-",
#   target_db=target_db,
#   amino_acids=rotamer_eval.aminoAcids)
  rebuild_pickle_files(data_dir=rotamer_data_dir,
    file_prefix="rota8000-",
    target_db=target_db,
    amino_acids=rotamer_eval.aminoAcids)
  #
  ramachandran_data_dir = rotamer_eval.find_rotarama_data_dir()
  target_db = rotamer_eval.open_rotarama_dlite(
    rotarama_data_dir=ramachandran_data_dir)
  rebuild_pickle_files(data_dir=rotamer_data_dir,
    file_prefix="rama8000-",
    target_db=target_db,
    amino_acids=ramachandran_eval.aminoAcids_8000)
# rebuild_pickle_files(data_dir=rotamer_data_dir,
#   file_prefix="rama500-",
#   target_db=target_db,
#   amino_acids=ramachandran_eval.aminoAcids)
  os.chdir(initial_current_working_directory)
  print(format_cpu_times())
def run():
  initial_current_working_directory = os.getcwd()
  rotamer_data_dir = rotamer_eval.find_rotarama_data_dir(optional=True)
  if rotamer_data_dir is None:
    print '  Rebuilding rotarama library skipped. Needs rotamer library.'
    return
  target_db = rotamer_eval.open_rotarama_dlite(
    rotarama_data_dir=rotamer_data_dir)
# rebuild_pickle_files(data_dir=rotamer_data_dir,
#   file_prefix="rota500-",
#   target_db=target_db,
#   amino_acids=rotamer_eval.aminoAcids)
  rebuild_pickle_files(data_dir=rotamer_data_dir,
    file_prefix="rota8000-",
    target_db=target_db,
    amino_acids=rotamer_eval.aminoAcids)
  #
  ramachandran_data_dir = rotamer_eval.find_rotarama_data_dir()
  target_db = rotamer_eval.open_rotarama_dlite(
    rotarama_data_dir=ramachandran_data_dir)
  rebuild_pickle_files(data_dir=rotamer_data_dir,
    file_prefix="rama8000-",
    target_db=target_db,
    amino_acids=ramachandran_eval.aminoAcids_8000)
# rebuild_pickle_files(data_dir=rotamer_data_dir,
#   file_prefix="rama500-",
#   target_db=target_db,
#   amino_acids=ramachandran_eval.aminoAcids)
  os.chdir(initial_current_working_directory)
  print format_cpu_times()
 def __init__(self):
   main_aaTables = RamachandranEval.aaTables
   self.aaTables = {}
   for aa,ndt_weakref in main_aaTables.items():
     # convert existing weak references to strong references
     self.aaTables[aa] = ndt_weakref()
   rama_data_dir = find_rotarama_data_dir()
   target_db = open_rotarama_dlite(rotarama_data_dir=rama_data_dir)
   no_update = os.path.exists(os.path.join(rama_data_dir, "NO_UPDATE"))
   for aa, aafile in aminoAcids_8000.items():
     if (self.aaTables.get(aa) is not None): continue
     data_file = "rama8000-"+aafile+".data"
     pickle_file = "rama8000-"+aafile+".pickle"
     pair_info = target_db.pair_info(
       source_path=data_file,
       target_path=pickle_file,
       path_prefix=rama_data_dir)
     if (((pair_info.needs_update) and (not no_update)) or not
         os.path.exists(os.path.join(rama_data_dir, pickle_file)))  :
       raise Sorry(
         "chem_data/rotarama_data/*.pickle files are missing or out of date.\n"
         "  Please run\n"
         "    mmtbx.rebuild_rotarama_cache\n"
         "  to resolve this problem.\n")
     ndt = easy_pickle.load(file_name=os.path.join(
       rama_data_dir, pair_info.target.path))
     self.aaTables[aa] = ndt
     main_aaTables[aa] = weakref.ref(ndt)
 def __init__(self):
     main_aaTables = RamachandranEval.aaTables
     self.aaTables = {}
     for aa, ndt_weakref in main_aaTables.items():
         # convert existing weak references to strong references
         self.aaTables[aa] = ndt_weakref()
     rama_data_dir = find_rotarama_data_dir()
     target_db = open_rotarama_dlite(rotarama_data_dir=rama_data_dir)
     no_update = os.path.exists(os.path.join(rama_data_dir, "NO_UPDATE"))
     for aa, aafile in aminoAcids_8000.items():
         if (self.aaTables.get(aa) is not None): continue
         data_file = "rama8000-" + aafile + ".data"
         pickle_file = "rama8000-" + aafile + ".pickle"
         pair_info = target_db.pair_info(source_path=data_file,
                                         target_path=pickle_file,
                                         path_prefix=rama_data_dir)
         if (((pair_info.needs_update) and (not no_update))
                 or not os.path.exists(
                     os.path.join(rama_data_dir, pickle_file))):
             raise Sorry(
                 "chem_data/rotarama_data/*.pickle files are missing or out of date.\n"
                 "  Please run\n"
                 "    mmtbx.rebuild_rotarama_cache\n"
                 "  to resolve this problem.\n")
         ndt = easy_pickle.load(
             file_name=os.path.join(rama_data_dir, pair_info.target.path))
         self.aaTables[aa] = ndt
         main_aaTables[aa] = weakref.ref(ndt)