Skip to content

main

Call peaks for the given Calling Cards data.

:param args: the command line arguments. :type args: Namespace

Source code in callingcardstools/PeakCalling/yeast/call_peaks.py
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
def main(args: argparse.Namespace) -> None:
    """
    Call peaks for the given Calling Cards data.

    :param args: the command line arguments.
    :type args: Namespace
    """
    check_files = [
        args.experiment_data_path,
        args.promoter_data_path,
        args.background_data_path,
        args.chrmap_data_path,
    ]
    for file in check_files:
        if not os.path.isfile(file):
            raise FileNotFoundError("The following path " f"does not exist: {file}")

    result_df = call_peaks(
        args.experiment_data_path,
        args.experiment_orig_chr_convention,
        args.promoter_data_path,
        args.promoter_orig_chr_convention,
        args.background_data_path,
        args.background_orig_chr_convention,
        args.chrmap_data_path,
        args.unified_chr_convention,
        args.deduplicate_experiment,
    )

    result_df.to_csv(
        args.output_path,
        compression="gzip" if args.compress_output else None,
        index=False,
    )