Skip to content

Commit

Permalink
feat: add parse option (#10)
Browse files Browse the repository at this point in the history
* refactor: remove unneeded logic

This isn't required as the value is already true or false

* feat: add parsable option
  • Loading branch information
sof202 authored Dec 12, 2024
1 parent 6609e41 commit d415c46
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions Python_Scripts/peak_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,30 @@ def main(args: argparse.Namespace) -> None:
reference_labelled_peaks,
args.cutoff
)
if args.unmerged:
metric = calculate_metric(
reference_labelled_peaks,
pseudopeaks,
include_merged_peaks=False
)
metric = calculate_metric(
reference_labelled_peaks,
pseudopeaks,
include_merged_peaks=(not args.unmerged)
)
if args.parsable:
print(metric)
else:
metric = calculate_metric(
reference_labelled_peaks,
pseudopeaks,
include_merged_peaks=True
)
print(f"The metric for these datasets over the range {start} to {end} ",
f"for chromosome {chromosome} is: {metric}.")
print("The metric for these datasets over the range ",
f"{start} to {end} for chromosome {chromosome} is: {metric}.")


if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="PeakCompare",
description="Determine how likely a peak is to be in two datasets."
)
parser.add_argument(
"-p",
"--parsable",
action="store_true",
help=("Set this if you want the output of the script to be computer ",
"parsable (and not human readable).")
)
parser.add_argument(
"--unmerged",
action="store_true",
Expand Down

0 comments on commit d415c46

Please sign in to comment.