From 572dd0ffb8397b7338926b38c132522eb50830e3 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 17 Jul 2025 19:36:04 +0100 Subject: Add cat subcommand. * pyhegp/pyhegp.py (cat): New function. --- pyhegp/pyhegp.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyhegp/pyhegp.py b/pyhegp/pyhegp.py index aa4b3fe..a35cfcb 100644 --- a/pyhegp/pyhegp.py +++ b/pyhegp/pyhegp.py @@ -109,5 +109,17 @@ def encrypt(genotype_file, summary_file, key_file, ciphertext_file): np.savetxt(key_file, key, delimiter=",", fmt="%f") np.savetxt(ciphertext_file, encrypted_genotype, delimiter=",", fmt="%f") +@main.command() +@click.option("--output", "-o", "output_file", + type=click.File("wb"), + default="-", + help="output file") +@click.argument("ciphertext-files", type=click.File("rb"), nargs=-1) +def cat(output_file, ciphertext_files): + np.savetxt(output_file, + np.vstack([read_genotype(file) for file in ciphertext_files]), + delimiter=",", + fmt="%f") + if __name__ == "__main__": main() -- cgit v1.2.3