aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyhegp/pyhegp.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pyhegp/pyhegp.py b/pyhegp/pyhegp.py
index 2f0bdb4..2177881 100644
--- a/pyhegp/pyhegp.py
+++ b/pyhegp/pyhegp.py
@@ -93,21 +93,21 @@ def pool(pooled_summary_file, summary_files):
@click.option("--summary", "-s", "summary_file", type=click.File("rb"),
help="Summary statistics file",
required=True)
-@click.option("--key", "-k", "key_path", type=click.Path(),
+@click.option("--key", "-k", "key_file", type=click.File("w"),
help="Output key",
required=True)
-@click.option("--output", "-o", "ciphertext_path", type=click.Path(),
+@click.option("--output", "-o", "ciphertext_file", type=click.File("w"),
default="-",
help="Output ciphertext")
-def encrypt(genotype_file, summary_file, key_path, ciphertext_path):
+def encrypt(genotype_file, summary_file, key_file, ciphertext_file):
genotype = read_genotype(genotype_file)
summary = read_summary(summary_file)
rng = np.random.default_rng()
key = random_key(rng, len(genotype))
encrypted_genotype = hegp_encrypt(genotype, summary.mean,
summary.std, key)
- np.savetxt(key_path, key, delimiter=",", fmt="%f")
- np.savetxt(ciphertext_path, encrypted_genotype, delimiter=",", fmt="%f")
+ np.savetxt(key_file, key, delimiter=",", fmt="%f")
+ np.savetxt(ciphertext_file, encrypted_genotype, delimiter=",", fmt="%f")
if __name__ == "__main__":
main()