Skip to content

parse_args

Parse the command line arguments.

:param subparser: the subparser object. :type subparser: argparse.ArgumentParser :param script_desc: the description of the script. :type script_desc: str :param common_args: the common arguments. :type common_args: argparse.ArgumentParser :return: the parser. :rtype: argparse.ArgumentParser

Source code in callingcardstools/Analysis/yeast/rank_response/find_min_responsive_main.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def parse_args(
        subparser: argparse.ArgumentParser,
        script_desc: str,
        common_args: argparse.ArgumentParser) -> argparse.ArgumentParser:
    """
    Parse the command line arguments.

    :param subparser: the subparser object.
    :type subparser: argparse.ArgumentParser
    :param script_desc: the description of the script.
    :type script_desc: str
    :param common_args: the common arguments.
    :type common_args: argparse.ArgumentParser
    :return: the parser.
    :rtype: argparse.ArgumentParser
    """

    parser = subparser.add_parser(
        'yeast_min_responsive',
        help=script_desc,
        prog='yeast_min_responsive',
        parents=[common_args]
    )

    parser.set_defaults(func=main)

    parser.add_argument(
        '--data_path_list',
        nargs='+',
        type=list,
        help='A list of paths to expression dataframes',
        required=True
    )
    parser.add_argument(
        '--identifier_col_list',
        nargs='+',
        type=list,
        help='A list of column names for the feature identifier '
        'in each DataFrame',
        required=True
    )
    parser.add_argument(
        '--effect_col_list',
        nargs='+',
        type=list,
        help='A list of column names for the effect in each DataFrame',
        required=True
    )
    parser.add_argument(
        '--effect_thres_list',
        nargs='+',
        type=list,
        help='A list of effect thresholds in each DataFrame. '
        'Enter `None` for no threshold on the effect for the dataframe '
        'at the same index',
        required=True
    )
    parser.add_argument(
        '--pval_col_list',
        nargs='+',
        type=list,
        help='A list of column names for the p-value in each DataFrame',
        required=True
    )
    parser.add_argument(
        '--pval_thres_list',
        nargs='+',
        type=list,
        help='A list of p-value thresholds in each DataFrame. '
        'Enter `None` for no threshold on the pvalue for the dataframe '
        'at the same index',
        required=True
    )

    return subparser