Skip to content

Commit

Permalink
fix notebook & code
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Nov 3, 2023
1 parent b80722c commit 15fe101
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion charcoal/contigs_list_contaminants.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def main(args):
ident = get_ident(ss)
lineage = tax_assign[ident]

lca_db.insert(ss, ident=ident)
try:
lca_db.insert(ss, ident=ident)
except ValueError:
continue
lin_db.insert(ident, lineage)

print(f'loaded {len(siglist)} signatures & created LCA Database')
Expand Down
4 changes: 2 additions & 2 deletions charcoal/notebooks/report-genome.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"\n",
"import plotly.graph_objects as go\n",
"\n",
"import sourmash\n",
"import sourmash, sourmash.lca.lca_utils\n",
"from charcoal import utils\n",
"from charcoal.figs.sourmash_sankey import GenomeSankeyFlow"
]
Expand Down Expand Up @@ -335,7 +335,7 @@
" if genome_lineage[-1].rank != 'genus':\n",
" genome_lineage = list(genome_lineage)\n",
" for rank in taxlist[len(genome_lineage):]:\n",
" genome_lineage.append(sourmash.lca.LineagePair(rank=rank, name='unassigned'))\n",
" genome_lineage.append(sourmash.lca.lca_utils.LineagePair(rank=rank, name='unassigned'))\n",
" \n",
" # set the color of the main lineage\n",
" genome_lineage = tuple(genome_lineage)\n",
Expand Down

0 comments on commit 15fe101

Please sign in to comment.