From 0f064f394beccfb8d691ecacff85ffb49ee1a979 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Wed, 25 Jan 2023 16:46:22 +0300 Subject: init arg parser --- .../correlation/correlation_file_generator.py | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'wqflask') 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) -- cgit v1.2.3