def scene_obsolete(src, lis_type, pdbid): if src.lower() == 'pdb': in_path = pdb_path(pdbid) elif src.lower() == 'redo': in_path = final_path(pdbid) else: raise Exception("no such structure type: %s" % src) sce_path = os.path.join(scene_path(src, lis_type, pdbid), "%s_%s.sce" % (pdbid, lis_names[lis_type])) return os.path.isfile(sce_path) and not os.path.isfile(in_path)
def run(self): if self._src.lower() == 'pdb': struct_path = pdb_path(self._pdbid) elif self._src.lower() == 'redo': struct_path = final_path(self._pdbid) else: raise Exception("unknown structure type %s" % self._src) in_path = wilist_data_path(self._src, self._lis_type, self._pdbid) root_dir = os.path.join(settings["DATADIR"], "wi-lists/%s" % self._src) if os.path.isfile(in_path): os.environ["SCENES_SETTINGS"] = scene_settings log_command(_log, 'scene', "%s %d %s %s %s %s %s" % (script, os.getpid(), struct_path, self._pdbid, self._src.upper(), commands[self._lis_type], in_path), cwd=root_dir)
print("\tmodification time:", s_mtime(path)) print("\tup to date:", yesno(hssp_uptodate(pdbid))) print("\tobsolete:", yesno(hssp_obsolete(pdbid))) else: print("\t<absent>") print("structure factors:") path = structurefactors_path(pdbid) print("\tpath:", path) if os.path.isfile(path): print("\tmodification time:", s_mtime(path)) else: print("\t<absent>") print("pdbredo:") path = final_path(pdbid) print("\tpath:", path) if os.path.isfile(path): print("\tmodification time:", s_mtime(final_path(pdbid))) print("\tup to date:", yesno(pdbredo_uptodate(pdbid))) print("\tobsolete:", yesno(pdbredo_obsolete(pdbid))) else: print("\t<absent>") print("pdbreport:") path = pdbreport_path(pdbid) print("\tpath:", path) if os.path.isfile(path): print("\tmodification time:", s_mtime(pdbreport_path(pdbid))) print("\tup to date:", yesno(pdbreport_uptodate(pdbid))) print("\tobsolete:", yesno(pdbreport_obsolete(pdbid)))
def dsspredo_uptodate(pdbid): in_path = final_path(pdbid) out_path = dsspredo_path(pdbid) return os.path.isfile(out_path) and (not os.path.isfile(in_path) or \ os.path.getmtime(out_path) >= os.path.getmtime(in_path))
def dsspredo_obsolete(pdbid): out_path = dsspredo_path(pdbid) in_path = final_path(pdbid) return os.path.isfile(out_path) and not os.path.isfile(in_path)
def run(self): in_path = final_path(self._pdbid) out_path = dsspredo_path(self._pdbid) if os.path.isfile(in_path): log_command(_log, 'dssp', "%s %s %s" % (MKDSSP, in_path, out_path))