Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with dnaapler all on bacterial chromosome and plasmids #38

Closed
samnooij opened this issue Aug 29, 2023 · 3 comments
Closed

Error with dnaapler all on bacterial chromosome and plasmids #38

samnooij opened this issue Aug 29, 2023 · 3 comments

Comments

@samnooij
Copy link
Contributor

The dnaapler workflow crashes right after the BLAST step on some PacBio HiFi assemblies.
I've been running dnaapler all on bacterial assemblies of PacBio HiFi reads (made with Flye). The assemblies are all nearly identical and consist of a circular chromosome of ~4Mb and two plasmids of ~20kb. This works quite nicely, but fails in one case. The clue I'm getting in the log file is copied below.
If you have any suggestion how to fix this, I'd be happy to adjust some code and test it! Thanks in advance.

  • dnaapler version 0.3.0 (installed through conda)
  • OS: Rocky Linux 8.8
2023-08-29 13:28:48.143 | INFO     | dnaapler.utils.external_tools:run:52 - Done running blastx -db .../lib/python3.11/site-packages/dnaapler/db/all_db -evalue 1e-10 -num_threads 4 -outfmt ' 6 qseqid qlen sseqid slen length qstart qend sstart send pident nident gaps mismatch evalue bitscore qseq sseq ' -out data/tmp/example_blast_output.txt -query data/tmp/example-assembly/assembly.fasta

Traceback (most recent call last):
  File ".../bin/dnaapler", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File ".../lib/python3.11/site-packages/dnaapler/__init__.py", line 728, in main
    main_cli()
  File ".../lib/python3.11/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../lib/python3.11/site-packages/dnaapler/__init__.py", line 709, in all
    all_process_blast_output_and_reorient(
  File ".../lib/python3.11/site-packages/dnaapler/utils/all.py", line 269, in all_process_blast_output_and_reorient
    genes.append(gene)
                 ^^^^
UnboundLocalError: cannot access local variable 'gene' where it is not associated with a value
@gbouras13
Copy link
Owner

It's a bug by me - line 269 shouldn't be

genes.append(gene)

it should simply be

genes.append(message)

Let me know how that goes!

George

@samnooij
Copy link
Contributor Author

Thanks for the amazingly fast fix! It works now. 😄

@gbouras13
Copy link
Owner

No problem @samnooij, thanks for spotting the bug - if you can push a PR that would be much appreciated, I'll make a patch release soon :)

samnooij added a commit to samnooij/dnaapler that referenced this issue Aug 29, 2023
Fix a little bug in the code that led to crashes in reorienting assemblies after the BLAST step
gbouras13 added a commit that referenced this issue Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants