Skip to content

Commit

Permalink
modified calls to pass in threshold to generate script and use argume…
Browse files Browse the repository at this point in the history
…nt parser default
  • Loading branch information
ashuaibi7 committed Jan 20, 2025
1 parent 195d400 commit 5cba9c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/dialect/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def main():

if args.command == "generate":
os.makedirs(args.out, exist_ok=True)
generate_bmr_and_counts(maf=args.maf, out=args.out, reference=args.reference)
generate_bmr_and_counts(
maf=args.maf,
out=args.out,
reference=args.reference,
threshold=args.threshold,
)

elif args.command == "identify":
os.makedirs(args.out, exist_ok=True)
Expand Down Expand Up @@ -80,7 +85,9 @@ def main():
out=args.out,
)
else: # args.type == "pair"
logging.info("Evaluating methods on simulated data for a pair of genes")
logging.info(
"Evaluating methods on simulated data for a pair of genes"
)
raise NotImplementedError
# TODO: add method for matrix

Expand Down
11 changes: 8 additions & 3 deletions src/dialect/utils/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def convert_maf_to_CBaSE_input_file(maf, out):
return out_fn


def generate_bmr_using_CBaSE(maf, out, reference, threshold="1e-100"):
def generate_bmr_using_CBaSE(maf, out, reference, threshold):
"""
Generates background mutation rate (BMR) distributions and count matrix using the CBaSE method.
Expand Down Expand Up @@ -184,7 +184,12 @@ def generate_bmr_files_from_CBaSE_output(out):
# ---------------------------------------------------------------------------- #


def generate_bmr_and_counts(maf, out, reference):
def generate_bmr_and_counts(
maf,
out,
reference,
threshold,
):
"""
Main function to generate background mutation rate (BMR) distributions and a count matrix.
Expand All @@ -195,7 +200,7 @@ def generate_bmr_and_counts(maf, out, reference):
"""
logging.info(f"Generating BMR and count matrix for MAF file: {maf}")
check_file_exists(maf)
generate_bmr_using_CBaSE(maf, out, reference)
generate_bmr_using_CBaSE(maf, out, reference, threshold)
generate_bmr_files_from_CBaSE_output(out)
generate_counts_from_CBaSE_output(out)
logging.info("BMR and count matrix generation completed successfully.")

0 comments on commit 5cba9c0

Please sign in to comment.