diff options
author | Alexander_Kabui | 2023-01-25 16:46:22 +0300 |
---|---|---|
committer | Alexander_Kabui | 2023-01-25 16:46:22 +0300 |
commit | 0f064f394beccfb8d691ecacff85ffb49ee1a979 (patch) | |
tree | ced08043134e687ba852366330b94960161424b2 | |
parent | 05a90c4f9476d4e6a7a29a2da203499cbe408df9 (diff) | |
download | genenetwork2-0f064f394beccfb8d691ecacff85ffb49ee1a979.tar.gz |
init arg parser
-rw-r--r-- | wqflask/wqflask/correlation/correlation_file_generator.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/wqflask/wqflask/correlation/correlation_file_generator.py b/wqflask/wqflask/correlation/correlation_file_generator.py index f207f2c6..c54f42b0 100644 --- a/wqflask/wqflask/correlation/correlation_file_generator.py +++ b/wqflask/wqflask/correlation/correlation_file_generator.py @@ -4,6 +4,7 @@ import os import csv import lmdb import os +import argparse import functools import tempfile @@ -189,3 +190,47 @@ def read_dataset(file_path, db_name): if (cols and results): return (bytes_to_array(cols),bytes_to_array(results)) +def generate_one(args,parser): + # we require the dataset name + try: + pass + except Exception as e: + raise e + +def generate_all(args, parser): + # db_connection + try: + return fetch_probeset_data(database_connector(args.database) ) + except Exception as error: + raise error + +parser = argparse.ArgumentParser(prog="text_file generator") +parser.add_argument( + "-a", + "--all", + dest="accumulate", + action="store_const", + const=generate_all, + help="generate all textfiles.", +) + + +parser.add_argument( + "-o", + "--one", + action = "store_const", + const = generate_one, + help = "generate spefic textfile" + ) + +parser.add_argument( + "-d", + "--database", + metavar="DB", + type=str, + default="db_webqtl_s", + help="Use database (default db_webqtl_s)", +) + +args = parser.parse_args() +args.accumulate(args, parser) |