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/PeakCalling/yeast/call_peaks.py
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
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_call_peaks",
        help=script_desc,
        prog="yeast_call_peaks",
        parents=[common_args],
    )

    parser.set_defaults(func=main)

    parser.add_argument(
        "--experiment_data_path",
        type=str,
        help="path to the experiment data file.",
        required=True,
    )
    parser.add_argument(
        "--experiment_orig_chr_convention",
        type=str,
        help="the chromosome naming convention used in the experiment data " "file.",
        required=True,
    )
    parser.add_argument(
        "--promoter_data_path",
        type=str,
        help="path to the promoter data file.",
        required=True,
    )
    parser.add_argument(
        "--promoter_orig_chr_convention",
        type=str,
        help="the chromosome naming convention used in the promoter data " "file.",
        required=True,
    )
    parser.add_argument(
        "--background_data_path",
        type=str,
        help="path to the background data file.",
        required=True,
    )
    parser.add_argument(
        "--background_orig_chr_convention",
        type=str,
        help="the chromosome naming convention used in the background data " "file.",
        required=True,
    )
    parser.add_argument(
        "--chrmap_data_path",
        type=str,
        help="path to the chromosome map file. this must include the data "
        "files' current naming conventions, the desired naming, and a column "
        "`type` that indicates whether the chromosome is 'genomic' or "
        "something else, eg 'mitochondrial' or 'plasmid'.",
        required=True,
    )
    parser.add_argument(
        "--unified_chr_convention",
        type=str,
        help="the chromosome naming convention to use in the output " "DataFrame.",
        required=False,
        default="ucsc",
    )
    parser.add_argument(
        "--deduplicate_experiment",
        action="store_true",
        help="set this flag to deduplicate the experiment data based on `chr`, "
        "`start` and `end` such that if an insertion is found at the same "
        "coordinate on different strands, only one of those records will be "
        "retained.",
    )
    parser.add_argument(
        "--output_path",
        default="sig_results.csv",
        type=str,
        help="path to the output file.",
    )
    parser.add_argument(
        "--pseudocount",
        type=float,
        help="pseudocount to use when calculating Calling Cards metrics.",
        required=False,
        default=0.2,
    )
    parser.add_argument(
        "--compress_output",
        action="store_true",
        help="set this flag to gzip the output csv file.",
    )

    return subparser