def _ps2pdf(config, out): ps_filename = config['combined_ps_name'] statuslog.info("Converting to PDF") cmd = ['ps2pdf', ps_filename, '-'] capproc.capturedCall( cmd, stdout=out, logger=log, check=True) statuslog.info("Finished PDF conversion")
def _nprofile(config, out): statuslog.info("Calculating n-profile.") cmd = [BIN, '-b', ''.join(config["nucleotides"]).upper(), config['ddna'], 1, config['length'], config['window_size'], config['step'], config['period']] capproc.capturedCall( cmd, stdout=out, stderr=config['stderr'], logger=logger, check=True)
def _extract(config, out): gbkfile = config['filename'] statuslog.debug( "Extracting genes in %s.", os.path.basename(gbkfile)) cmd = [BIN, gbkfile, config['GeneDescriptorSkip1'], config['GeneDescriptorKey1'], config['GeneDescriptorSkip2'], config['GeneDescriptorKey2']] capproc.capturedCall( cmd, check=True, logger=logger, stdout=out, stderr=sys.stderr)
def _acgt_gamma(config, dtemp): cmd = [BIN, "-q", config["filename"]] if "significance" in config: cmd.append(str(config["significance"])) statuslog.info( "Identifying ORFs with 3-base compositional periodicity " "with significance: %s.", config.get("significance") ) log.debug("Starting prediction program in %s", dtemp) try: capproc.capturedCall( cmd, cwd=dtemp, check=True, env={"BASE_DIR_THRESHOLD_TABLES": DATAPATH}, stderr=sys.stderr, logger=log ) log.debug("Prediction finished successfully") except capproc.CallProcError as cpe: log.error("acgt_gamma exitted with rc: %r", cpe.returncode) raise
def clean_path(path, days): "This function actually runs the find and delete." logger.info("Cleaning older than: %d @ %r", days, path) cmd = ["find", path, "-atime", "+" + str(days), "-delete"] return capproc.capturedCall(cmd, logger=logger, stdin=False, stderr_level=logging.WARNING)