diff --git a/src/parser.py b/src/parser.py index c3d96b4..3885be3 100644 --- a/src/parser.py +++ b/src/parser.py @@ -1,3 +1,4 @@ +from argparse import ArgumentParser from glob import glob from typing import List, Union @@ -22,10 +23,18 @@ def save_to_file(filename, adapters) -> None: adapters.to_csv(filename, index=False, header=False, sep="\n") +def parse_arguments(): + parser = ArgumentParser() + parser.add_argument("input", help="directory containing the fastqc reports") + parser.add_argument("output", help="file where to export the sequences") + return parser.parse_args() + + def main(): - file_list = find_html_files("data") + args = parse_arguments() + file_list = find_html_files(args.input) adapters = extract_adapters(file_list) - save_to_file("placeholder.txt", adapters) + save_to_file(args.output, adapters) if __name__ == "__main__":