def generate_argparser():
    parser = argparse.ArgumentParser(
        prog="quartet_sampling.py",
        description=__doc__,
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        epilog=LICENSE)
    parser.add_argument("--tree", type=open, nargs=1, required=True,
                        # Prev -t
                        help=("The input tree in Newick "
                              "(parenthetical) format."))
    parser.add_argument("--align", "--alignment", type=open, nargs=1,
                        # Prev -a
                        required=True, dest="align",
                        help=("Alignment file in \"relaxed phylip\" format, "
                              "as used by RAxML."))
    parser.add_argument("--reps", "--number-of-reps", type=int, nargs=1,
                        # Prev -N
                        required=True, default=100, dest="reps",
                        help=("The number of replicate quartet topology "
                              "searches to be performed at each node."))
    parser.add_argument("--threads", "--number-of-threads", type=int, nargs=1,
                        # Prev -T
                        required=True, default=1, dest="threads",
                        help=("The number of parallel threads to be used "
                              "by Python for quartet topology searches."))
    parser.add_argument("--lnlike", "--lnlike-thresh", type=float, nargs=1,
                        # Prev -L
                        default=2.0, dest="lnlike",
                        help=("The lnlike threshhold that is the minimum "
                              "value by which the log-likelihood value "
                              "of the best-likelihood tree must be "
                              "higher than the second-best-likelihood tree "
                              "for the replicate to register as the "
                              "best-likelihood topology rather than "
                              "'uncertain'. If set to zero, this turns off "
                              "likelihood evaluation mode and invokes tree "
                              "inference mode where a tree is simply inferred "
                              "from the alignment without considering "
                              "likelihood (QI values are N/A in this case)."))
    parser.add_argument("--result-prefix", type=str, nargs=1,
                        # Prev -r
                        help="A prefix to put on the result files.")
    parser.add_argument("--data-type", choices=('nuc', 'amino', 'cat'),
                        # Prev -d
                        default=["nuc"], nargs=1,
                        help=("(nuc)leotide, (amino) acid, "
                              "or (cat)egorical data"))
    parser.add_argument("--min-overlap", type=int,
                        # Prev -O
                        help=("The minimum sites required to be sampled for "
                              "all taxa in a given quartet."))
    parser.add_argument("--results-dir", type=os.path.abspath, nargs=1,
                        # Prev -o
                        help=("A directory to which output files will "
                              "be saved. If not supplied, the current working "
                              "directory will be used. (default is current "
                              "folder)."))
    parser.add_argument("--verbout", action="store_true",
                        # Prev -V
                        help=("Provide output of the frequencies of each "
                              "topology and QC."))
    parser.add_argument("--partitions", type=os.path.abspath, nargs=1,
                        # Prev -q
                        help=("Partitions file in RAxML format. If omitted "
                              "then the entire alignment will be treated "
                              "as one partition for all quartet replicate "
                              "topology searches."))
    parser.add_argument("--genetrees", type=os.path.abspath, nargs=1,
                        # Prev -g
                        help=("Use partitions file (RAxML format) to divide "
                              "the alignment into separate gene tree regions. "
                              "Gene alignments will be sampled random for the "
                              "quartet topology searches."))
    parser.add_argument("--temp-dir", type=os.path.abspath, nargs=1,
                        # Prev -e
                        help=("A directory to which temporary files will be "
                              "saved. If not supplied, 'QuartetSampling' "
                              "will be created in the current "
                              "working directory. "
                              "When specifying a custom temporary output "
                              "the characters 'QuartetSampling' must appear "
                              "in the directory name to prevent accidental "
                              "file deletion. (default='./QuartetSampling'"))
    parser.add_argument("--retain-temp", action="store_true",
                        help=("Do not remove temporary files"))
    parser.add_argument("--clade", type=str,
                        # Prev: -C
                        help=("Conduct analysis on specific clade identified "
                              "by CSV taxon list"))
    parser.add_argument("--start-node-number", type=int, nargs=1,
                        # Prev -s
                        help=("An integer denoting the node to which to start "
                              "from. Nodes will be read from topologically "
                              "identical (and isomorphic!) input trees in "
                              "deterministic order, so this argument may be  "
                              "used to restart at an intermediate position "
                              "(in case the previous run was canceled before "
                              "completion, for example)."))
    parser.add_argument("--stop-node-number", type=int, nargs=1,
                        # Prev -p
                        help=("An integer denoting the node at which to stop. "
                              "Will include nodes with indices <= the stop "
                              "node number. This argument may be used to "
                              "limit the length of a given run in case only "
                              "a certain part of the tree is of interest. "
                              "Nodes will be read from topologically "
                              "identical (and isomorphic!) input trees "
                              "in deterministic order."))
    parser.add_argument("--engine", nargs=1, default=('raxml-ng',),
                        choices=('raxml-ng', 'raxml', 'paup', 'iqtree'),
                        help=("Name of the program to use to infer trees or"
                              " evaluate tree model likelihoods."))
    parser.add_argument("--engine-exec", nargs=1,
                        help=("Full file path of the tree inference or"
                              " likelihood evaluation engine."))
    parser.add_argument("--engine-model", nargs=1,
                        help=("Advanced: specify a custom model name "
                              "for the tree engine"))
    # parser.add_argument("--raxml-model", nargs=1,
    #                    help=("Advanced: specify a custom RAxML model name "
    #                          "for the raxml '-m' parameter"))
    # parser.add_argument("-X", "--raxml-executable", nargs=1,
    #                    help=("The name (or absolute path) of the raxml "
    #                          "executable to be used for calculating "
    #                          "likelihoods on quartet topologies."
    #                          "(default='raxml')"))
    # parser.add_argument("--raxml-model", nargs=1,
    #                    help=("Advanced: specify a custom RAxML model name "
    #                          "for the raxml '-m' parameter"))
    # parser.add_argument("-P", "--paup", action="store_true",
    #                    help="Use PAUP instead of RAxML.")
    # parser.add_argument("--paup-executable", nargs=1, default=["paup"],
    #                    help=("The name or path of the PAUP executable to "
    #                          "be used for calculated quartets."))
    parser.add_argument("--ignore-errors", action="store_true",
                        help=("Ignore RAxML and PAUP erroneous runs"))
    parser.add_argument("--low-mem", action="store_true",
                        help=("Do not store large alignment in memory "
                              "for whole-alignment (non-genetree) mode"))
    parser.add_argument('--max-random-sample-proportion', type=float,
                        help=("The proportion of possible replicates explored "
                              "unsuccessfully by the random generation "
                              "procedure before it gives up. Because this "
                              "generates random replicates, it takes "
                              "progressively longer as it proceeds. To avoid "
                              "long runtimes, the recommended range is < 0.5 "
                              "(which is the default)."))
    parser.add_argument("--calc-qdstats", action="store_true",
                        help=("EXPERIMENTAL: Calculates Chi-square test "
                              "for QD tree frequencies. Use only "
                              " if Scipy is available. "
                              "Will increase running time."))
    parser.add_argument("--verbose", action="store_true",
                        help="Provide more verbose output if specified.")
    parser.add_argument('--version', action='version',
                        version='%(prog)s version 1.3.1.b')
    return parser