Skip to content

Commit

Permalink
Fix issue with root seq (#471)
Browse files Browse the repository at this point in the history
* fix issue with root seq

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
theosanderson and pre-commit-ci[bot] authored Feb 11, 2023
1 parent 8da484d commit ffbbc7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions taxoniumtools/src/taxoniumtools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .ushertools import UsherMutationAnnotatedTree
9 changes: 7 additions & 2 deletions taxoniumtools/src/taxoniumtools/ushertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,19 @@ def __init__(self,
self.expand_condensed_nodes()
self.assign_num_tips()
print(f"Loaded initial tree with {self.tree.root.num_tips} tips")
print("Ending early")
if genbank_file:
# We need to reconstruct root seq before shearing as shearing can mess it up

self.load_genbank_file(genbank_file)
self.get_root_sequence()
if shear:
print("Shearing tree...")
self.shear_tree(shear_threshold)
self.assign_num_tips()
print(f"Tree to use now has {self.tree.root.num_tips} tips")
self.set_branch_lengths()
if genbank_file:
self.load_genbank_file(genbank_file)
self.get_root_sequence()
self.perform_aa_analysis()

def prune_node(self, node_to_prune):
Expand Down Expand Up @@ -291,6 +295,7 @@ def create_mutation_like_objects_to_record_root_seq(self):
NucMutation(one_indexed_position=i + 1,
mut_nuc=character,
par_nuc="X"))

return ref_muts

def annotate_clades(self, clade_types):
Expand Down

1 comment on commit ffbbc7c

@vercel
Copy link

@vercel vercel bot commented on ffbbc7c Feb 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.