diff options
author | Arun Isaac | 2025-07-17 19:36:04 +0100 |
---|---|---|
committer | Arun Isaac | 2025-07-17 20:51:54 +0100 |
commit | 572dd0ffb8397b7338926b38c132522eb50830e3 (patch) | |
tree | 1ae6321f5b8d5ab8d46e8a82ad1ec138d75e0c35 | |
parent | 2dc78933903baa9acc200a40f1795be320d1c297 (diff) | |
download | pyhegp-572dd0ffb8397b7338926b38c132522eb50830e3.tar.gz pyhegp-572dd0ffb8397b7338926b38c132522eb50830e3.tar.lz pyhegp-572dd0ffb8397b7338926b38c132522eb50830e3.zip |
Add cat subcommand.
* pyhegp/pyhegp.py (cat): New function.
-rw-r--r-- | pyhegp/pyhegp.py | 12 |
1 files changed, 12 insertions, 0 deletions
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() |