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/chipexo_promoter_sig.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
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(
        'chipexo_promoter_sig',
        help=script_desc,
        prog='chipexo_promoter_sig',
        parents=[common_args]
    )

    parser.set_defaults(func=main)

    parser.add_argument(
        '--chipexo_data_path',
        help='Path to the chipexo data file.',
        required=True
    )
    parser.add_argument(
        '--chipexo_orig_chr_convention',
        help='Chromosome convention of the chipexo data file.',
        required=True
    )
    parser.add_argument(
        '--promoter_data_path',
        help='Path to the promoter data file.',
        required=True
    )
    parser.add_argument(
        '--promoter_orig_chr_convention',
        help='Chromosome convention of the promoter data file.',
        required=True
    )
    parser.add_argument(
        '--chrmap_data_path',
        help='Path to the chromosome map file.',
        required=True
    )
    parser.add_argument(
        '--unified_chr_convention',
        help='Chromosome convention to convert to.',
        required=True
    )
    parser.add_argument(
        '--output_file',
        default="chipexo_promoter_sig.csv",
        help='Path to the output file.'
    )
    parser.add_argument(
        '--compress',
        action='store_true',
        help='Set this flag to gzip the output file.'
    )

    return subparser