import argparse


def add_subparser_args(subparsers: argparse) -> argparse:
    """Add tool-specific arguments for run_go.
    Args:
        subparsers: Parser object before addition of arguments specific to run_go.
    Returns:
        parser: Parser object with additional parameters.
    """

    subparser = subparsers.add_parser("run_go",
                                      description="Run enrichment based on  "
                                                  "GO database.",
                                      help="")

    subparser.add_argument("--input", nargs=None, type=str,
                           dest='input_file', default=None,
                           required=True,
                           help="Choosen from `Differential Expression Gene file generated by Scanpy or Seurat` "
                                "And `One column gene list")
    subparser.add_argument("--prefix", nargs=None, type=str,
                           dest='prefix', default=None,
                           required=True,
                           help="Prefix of output results.")
    subparser.add_argument("--output", nargs=None, type=str,
                           dest='output_dir', default=None,
                           required=True,
                           help="Output file location.")
    subparser.add_argument("--species", nargs=None, type=str,
                           dest='species', default='human',
                           required=True,
                           help="Support human or mouse.")
    subparser.add_argument("--type", nargs=None, type=str,
                           dest='type', default='scanpy_deg',
                           choices=['scanpy_deg', 'seuratv3_deg', 'seuratv4_deg', 'list'],
                           required=True,
                           help="DEG file or Gene list file")
    subparser.add_argument("--updown", nargs=None, type=str,
                           dest='updown', default='both',
                           choices=['up', 'down', 'both'],
                           required=False,
                           help="Use up-regulated gene\down-regulated gene\ both, if DEG provided.")
    subparser.add_argument("--pvalue", nargs=None, type=float,
                           dest='pvalue', default=0.05,
                           required=False,
                           help="Pvalue cutoff for enrichment")
    subparser.add_argument("--qvalue", nargs=None, type=float,
                           dest='qvalue', default=0.2,
                           required=False,
                           help="Qvalue cutoff for enrichment")

    return subparsers
