Skip to content

Commit

Permalink
fixed html report key bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dcchivian committed Oct 17, 2023
1 parent a864f95 commit 27c598d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ RUN pip install ete3==3.1.3 PyQt5==5.11.3

# tree utils install
WORKDIR /kb/module
RUN git clone https://github.com/dcchivian/tree_utils \
&& mkdir bin \
&& mv tree_utils/gtdb/* bin/ \
&& chmod +x bin/*
RUN git clone https://github.com/dcchivian/tree_utils && \
mkdir bin && \
mv tree_utils/gtdb/* bin/ && \
chmod +x bin/*

# -----------------------------------------

Expand Down
9 changes: 5 additions & 4 deletions lib/kb_gtdbtk/core/genome_obj_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
[OBJID_I, NAME_I, TYPE_I, SAVE_DATE_I, VERSION_I, SAVED_BY_I, WSID_I,
WORKSPACE_I, CHSUM_I, SIZE_I, META_I] = range(11) # object_info tuple

# global for tree html
tree_key_taxon_seen = dict()


# get_obj_info ()
def get_obj_info (
Expand Down Expand Up @@ -339,18 +336,22 @@ def _write_gtdb_tree_html_file (out_dir, files_for_html):
indent_cnt = 0
key_box_size = '15px'
key_font_size = key_box_size
table_buf += ['<td align=left valign=middle><table border=0>']
table_buf += ['<td align=left valign=top><table border=0>']
#tax_level_order = ['d', 'p', 'c', 'o', 'f', 'g']
tax_level_order = ['p', 'c', 'o', 'f', 'g']
first_row = True
global tree_key_taxon_seen
tree_key_taxon_seen = dict() # need to reset in case multiple trees have same taxon

for tax_level in tax_level_order: # phylum -> genus
for taxon in sorted (lineages.keys()):
if taxon[0] != tax_level:
continue
if taxon not in tree_key_taxon_seen:
if first_row:
first_row = False
table_buf += ['<tr><td>&nbsp;</td></tr>']
table_buf += ['<tr><td>&nbsp;</td></tr>']
else:
table_buf += ['<tr><td>&nbsp;</td></tr>']
table_buf += add_tree_key_row (taxon, lineages, taxon_color, indent_cnt, key_box_size, key_font_size)
Expand Down
1 change: 1 addition & 0 deletions test/kb_gtdbtk_server_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def prepare_data(cls):
except Exception as e:
raise ValueError ("ABORT: unable to save Bac AssemblySet object.\n"+str(e))


@classmethod
def clean_scratch_dir(cls):
for inode in os.listdir(cls.scratch):
Expand Down

0 comments on commit 27c598d

Please sign in to comment.