Skip to content

Commit

Permalink
Update for python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
davidemms committed Oct 7, 2024
1 parent 1ee31c0 commit 92d520d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts_of/accelerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def sample_random(og, n_max):
Returns:
genes - list of genes
"""
return random.sample(og, min(n_max, len(og)))
return random.sample(sorted(og), min(n_max, len(og)))


def get_new_species_clades(rooted_species_tree_fn, core_species_ids, n_core_species=2):
Expand Down
2 changes: 1 addition & 1 deletion scripts_of/sample_genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def select_from_aligned(infn, n_sample, q_trim=True):
if n_extra > 0:
# select some more to make it up to the total
not_used = set(range(n_keep)).difference(cluster_representative)
cluster_representative.extend(random.sample(not_used, n_extra))
cluster_representative.extend(random.sample(sorted(not_used), n_extra))
# print("Found extra sequences. Have %d" % len(cluster_representative))
# print(cluster_representative)
selected = [accs[d_new_old[i]] for i in cluster_representative]
Expand Down

0 comments on commit 92d520d

Please sign in to comment.