Skip to content

Commit

Permalink
add traceable seed for reproducibility #16
Browse files Browse the repository at this point in the history
  • Loading branch information
tensulin committed Nov 15, 2024
1 parent 6a5466f commit e647306
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/marbel/meta_tran_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ def main(n_species: Annotated[int, typer.Option(callback=species_callback,
# maybe change to synthetic species later on, for now just use the available species
# generate some plots so the user can see the distribution

if seed:
random.seed(seed)
np.random.seed(seed)
if not seed:
seed = random.randint(0, 2**32 - 1)

random.seed(seed)
np.random.seed(seed)

species = draw_random_species(number_of_species)
ortho_group_rates = create_ortholgous_group_rates(number_of_orthogous_groups, number_of_species)
filtered_orthog_groups = filter_by_seq_id_and_phylo_dist(max_phylo_distance, min_identity)
Expand Down

0 comments on commit e647306

Please sign in to comment.