From 84d736187c301332a72296caeb2bc68f1a3c4284 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 15 Jan 2024 06:08:46 +0300 Subject: Initialise `install_phenos` script. --- scripts/rqtl2/install_phenos.py | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 scripts/rqtl2/install_phenos.py diff --git a/scripts/rqtl2/install_phenos.py b/scripts/rqtl2/install_phenos.py new file mode 100644 index 0000000..b532dad --- /dev/null +++ b/scripts/rqtl2/install_phenos.py @@ -0,0 +1,57 @@ +"""Load pheno from R/qtl2 bundle into the database.""" +import sys +import logging +# import traceback +from pathlib import Path + +import MySQLdb as mdb + +from scripts.rqtl2.entry import build_main +from scripts.cli_parser import init_cli_parser +from scripts.rqtl2.cli_parser import add_common_arguments + +stderr_handler = logging.StreamHandler(stream=sys.stderr) +logger = logging.getLogger("install_phenos") +logger.addHandler(stderr_handler) + +def install_pheno_files(_dbconn: mdb.Connection, + _speciesid: int, + _populationid: int, + _platformid: int, + _studyid: int, + _datasetid: int, + _rqtl2bundle: Path) -> int: + """Load data in `pheno` files and other related files into the database.""" + logger.debug("WE ARE HERE!!!") + return 5 + +if __name__ == "__main__": + + def cli_args(): + """Process command-line arguments for install_genotypes""" + parser = init_cli_parser( + "install_genotypes", + "Parse genotypes from R/qtl2 bundle into the database.") + + parser.add_argument( + "platformid", + help="The platform from which the data was generated.") + parser.add_argument("studyid", + help="The study to which the data belongs.") + + parser = add_common_arguments(parser) + + return parser.parse_args() + + main = build_main( + cli_args, + lambda dbconn, args: install_pheno_files(dbconn, + args.speciesid, + args.populationid, + args.platformid, + args.studyid, + args.datasetid, + args.rqtl2bundle), + logger, + "DEBUG") + sys.exit(main()) -- cgit v1.2.3