Add CLI argument parsing
This commit is contained in:
parent
d3f7677423
commit
02a561b4f6
|
@ -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__":
|
||||
|
|
Loading…
Reference in New Issue