Skip to content

Commit

Permalink
added log statements to specify to user exact simulation parameters a…
Browse files Browse the repository at this point in the history
…nd location of output files
  • Loading branch information
ashuaibi7 committed Jan 12, 2025
1 parent 0535a98 commit 818b18b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dialect/utils/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ def create_single_gene_simulation(
bmr_dict = load_bmr_pmfs(bmr_pmfs)
os.makedirs(out, exist_ok=True)

logging.info(
f"Simulating {num_simulations} single gene somatic mutations with "
f"{num_samples} samples and driver mutation rate pi={pi}"
)
simulated_genes = []
for _ in range(num_simulations):
simulated_gene = simulate_single_gene_somatic_mutations(
Expand All @@ -267,6 +271,9 @@ def create_single_gene_simulation(

counts_array = np.array(simulated_genes)
np.save(os.path.join(out, "single_gene_simulated_data.npy"), counts_array)
logging.info(
f"Saved single gene simulation data to {out}/single_gene_simulated_data.npy"
)

params = {
"pi": pi,
Expand All @@ -278,6 +285,9 @@ def create_single_gene_simulation(
}
with open(os.path.join(out, "single_gene_simulation_parameters.json"), "w") as f:
json.dump(params, f, indent=4)
logging.info(
f"Saved simulation parameters to {out}/single_gene_simulation_parameters.json"
)


# ---------------------------------------------------------------------------- #
Expand Down

0 comments on commit 818b18b

Please sign in to comment.