Skip to content

Commit

Permalink
added template code for calling identify interactions function with D…
Browse files Browse the repository at this point in the history
…IALECT w/o implementation yet
  • Loading branch information
ashuaibi7 committed Nov 19, 2024
1 parent e535562 commit 26b993d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dialect/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
generate_bmr_and_counts,
) # TODO: export function from generate.py

from dialect.utils.identify import (
identify_pairwise_interactions,
) # TODO: export function from identify.py

configure_logging()

Expand All @@ -27,6 +30,13 @@ def main():
os.makedirs(args.out, exist_ok=True) # create output directory if nonexistent
generate_bmr_and_counts(maf=args.maf, out=args.out, reference=args.reference)

elif args.command == "identify":
os.makedirs(args.out, exist_ok=True) # create output directory if nonexistent
identify_pairwise_interactions(
maf=args.maf, bmr=args.bmr, out=args.out, k=args.top_k
)
pass


if __name__ == "__main__":
main()
29 changes: 29 additions & 0 deletions src/dialect/utils/identify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import logging

from dialect.utils.helpers import *

# ---------------------------------------------------------------------------- #
# Helper Functions #
# ---------------------------------------------------------------------------- #


# ---------------------------------------------------------------------------- #
# Main Function #
# ---------------------------------------------------------------------------- #
def identify_pairwise_interactions(maf, bmr, out, k):
"""
Main function to identify pairwise interactions between genetic drivers in tumors using DIALECT.
! Not Yet Implemented
@param maf: Path to the input MAF (Mutation Annotation Format) file containing mutation data.
@param bmr: Path to the file with background mutation rate (BMR) distributions.
@param out: Directory where outputs will be saved.
@param k: Top k genes according to count of mutations will be used.
"""
check_file_exists(maf)
check_file_exists(bmr)
if k <= 0:
logging.error("k must be a positive integer")
raise ValueError("k must be a positive integer")
logging.info("Identifying pairwise interactions using DIALECT")
logging.info("Functionality not yet implemented")

0 comments on commit 26b993d

Please sign in to comment.