Skip to content

Commit

Permalink
Merge pull request #261 from andersen-lab/256-bug-recombinants-like-x…
Browse files Browse the repository at this point in the history
…ec-not-being-reporteddetected

Improve error handling
  • Loading branch information
joshuailevy authored Nov 20, 2024
2 parents 9495509 + 09e46a6 commit bb19951
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions freyja/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,13 @@ def demix(variants, depths, output, eps, barcodes, meta,
autoadapt)
df_barcodes, mix, depths_ = reindex_dfs(df_barcodes, mix, depths_)
print('demixing')
try:
sample_strains, abundances, error = solve_demixing_problem(df_barcodes,
mix,
depths_,
eps, adapt,
a_eps,
solver)
except Exception as e:
print(e)
print('Error: Demixing step failed. Returning empty data output')
sample_strains, abundances = [], []
error = -1
sample_strains, abundances, error = solve_demixing_problem(df_barcodes,
mix,
depths_,
eps,
adapt,
a_eps,
solver)
# merge intra-lineage diversity if multiple hits.
if len(set(sample_strains)) < len(sample_strains):
localDict = {}
Expand Down

0 comments on commit bb19951

Please sign in to comment.