def _needs_liftover(self, from_assembly, to_assembly, newfile): # Sentinel file encodes sentinel = self._liftover_sentinel(from_assembly, to_assembly, newfile) if not os.path.exists(sentinel): return True elif utils.is_newer(self.processed, newfile): return True return False
def _needs_liftover(self, from_assembly, to_assembly, newfile): """ Checks to see if liftover is needed based on the """ # Sentinel file encodes assembly conversion; sentinel = self._liftover_sentinel(from_assembly, to_assembly, newfile) if not os.path.exists(sentinel): return True elif utils.is_newer(self.processed, newfile): return True return False
def _needs_update(self): """ Decides if we need to update the processed file. """ do_update = False if self._was_lifted_over(): log( "This file appears to have been lifted over from another " "study, in which case we assume it does not need updating", style=Fore.YELLOW ) return False if self._needs_download(): log("{0.original} does not exist; downloading" .format(self, indent=4)) self._download() do_update = True if not os.path.exists(self.processed): log("{0.processed} does not exist".format(self), indent=4) do_update = True # if processed is a link, then check the LINK time if ( os.path.exists(self.processed) and utils.link_is_newer(self.script, self.processed) ): log("{0.script} is newer than {0.processed}, need to re-run" .format(self), indent=4) do_update = True # but for the original data, we want to FOLLOW the link if ( os.path.exists(self.original) and os.path.exists(self.processed) and utils.is_newer(self.original, self.processed) ): log("{0.original} is newer than {0.processed}, need to re-run" .format(self), indent=4) do_update = True if not do_update: log("{0.processed} is up to date" .format(self), indent=4, style=Style.DIM) return do_update
def _needs_update(self): """ Decides if we need to update the processed file. """ do_update = False if self._was_lifted_over(): log( "This file appears to have been lifted over from another " "study, in which case we assume it does not need updating", style=Fore.YELLOW) return False if self._needs_download(): log("{0.original} does not exist; downloading".format(self, indent=4)) self._download() do_update = True if not os.path.exists(self.processed): log("{0.processed} does not exist".format(self), indent=4) do_update = True # if processed is a link, then check the LINK time if (os.path.exists(self.processed) and utils.link_is_newer(self.script, self.processed)): log("{0.script} is newer than {0.processed}, need to re-run". format(self), indent=4) do_update = True # but for the original data, we want to FOLLOW the link if (os.path.exists(self.original) and os.path.exists(self.processed) and utils.is_newer(self.original, self.processed)): log("{0.original} is newer than {0.processed}, need to re-run". format(self), indent=4) do_update = True if not do_update: log("{0.processed} is up to date".format(self), indent=4, style=Style.DIM) return do_update