INNER CODE UNIT · Python

log_progress

MariaNattestad/assemblytics · assemblytics/cli.py:24

def log_progress(log_file, message):
    with open(log_file, "a") as log:
        log.write(message + "\n")


def fail(log_file, step, message, exit_code=1):
    log_progress(log_file, step)
    sys.exit(exit_code)


def zip_results(output_dir):
    zip_path = os.path.join(output_dir, "assemblytics_results.zip")
    zip_filename = os.path.basename(zip_path)
    with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as archive:
        for filename in os.listdir(output_dir):
            if filename.startswith("assemblytics_") and filename != zip_filename:
                archive.write(os.path.join(output_dir, filename), filename)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…