From bcc4f4b4d4df25c0f060642181ace41416ddf659 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 5 Jul 2021 03:49:14 +0200 Subject: [PATCH] Parse data and label files from CLI arguments --- src/main.py | 27 +++++++++++++++++++++++++++ src/model.py | 4 ---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 src/main.py diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..1015d87 --- /dev/null +++ b/src/main.py @@ -0,0 +1,27 @@ +from argparse import ArgumentParser +from time import time + +from model import run + + +def parse_arguments(): + parser = ArgumentParser() + parser.add_argument( + "data_file", help="FASTQ file containing the sequences with errors" + ) + parser.add_argument( + "label_file", help="FASTQ file containing the sequences without errors" + ) + return parser.parse_args() + + +def main(): + args = parse_arguments() + start_time = time() + run(data_file=args.data_file, label_file=args.label_file) + end_time = time() + print(f"Elapsed time: {end_time - start_time}") + + +if __name__ == "__main__": + main() diff --git a/src/model.py b/src/model.py index 58bd4b9..97ba5ef 100644 --- a/src/model.py +++ b/src/model.py @@ -75,7 +75,3 @@ def run(data_file, label_file, seed_value=42) -> None: model.fit(train_data, epochs=hyperparams.epochs, validation_data=eval_data) print("Training complete. Obtaining the model's metrics...") show_metrics(model, eval_data, test_data) - - -if __name__ == "__main__": - run(data_file="data/curesim-HVR.fastq", label_file="data/HVR.fastq")