import argparse import sys HELPER_TEXT =""" .___ ___. __ ___ .______ _______ .______ | \/ | | |/ / | _ \ | \ | _ \ | \ / | | ' / | |_) | | .--. || |_) | | |\/| | | < | _ < | | | || / | | | | | . \ | |_) | | '--' || |\ \----. |__| |__| |__|\__\ |______/ |_______/ | _| `._____| _______________________________________________________________________________ Pierre-Edouard GUERIN, Laetitia MATHON, Virginie MARQUES, Stephanie MANEL CNRS, EPHE, Sorbonne University, Montpellier, France version 0.1 "" March 2021 Usage: > python3 mkbdr [options] For help: > python3 mkbdr --help """ def parse_args(usage=HELPER_TEXT): parser = argparse.ArgumentParser(description='mkbdr - to build a custom metabarcoding reference database.') subprasers = parser.add_subparsers(dest='command') validate = subprasers.add_parser('validate', help='check format and taxonomy') validate.add_argument("-f","--fasta", type=str, help='path of the barcodes sequences FASTA file', required=True) validate.add_argument("-c","--curate", type=str, help='path of the taxonomy curation CSV file. Header must be current_name;ncbi_name;genus;family. A curation CSV file can be generated with the command curegen', required=False, default="NA") validate.add_argument("-n","--ncbi_taxdump", type=str, help='path of NCBI taxdump.tar.gz file', required=False, default="NA") validate.add_argument("-o","--output_prefix", type=str, help='prefix of the output FASTA such as [PREFIX].fasta') curegen = subprasers.add_parser('curegen', help='try to correct wrong taxonomy') curegen.add_argument("-f","--fasta", type=str, help='path of the barcodes sequences FASTA file', required=True) curegen.add_argument("-n","--ncbi_taxdump", type=str, help='path of NCBI taxdump.tar.gz file', required=False, default="NA") curegen.add_argument("-o","--output_prefix", type=str, help='prefix of the output curated taxonomy CSV such as [PREFIX].csv') args = parser.parse_args() if args.command not in ['validate', 'curegen']: print(usage) sys.exit(0) return args