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

tabs in fasta headers #85

Closed
katholt opened this issue Oct 14, 2024 · 1 comment
Closed

tabs in fasta headers #85

katholt opened this issue Oct 14, 2024 · 1 comment
Assignees
Labels

Comments

@katholt
Copy link
Collaborator

katholt commented Oct 14, 2024

From Corin:

I think there might be a bug in Kleborate when FASTAs have tab characters in their header. I get the following output with the attached FASTA, but if I remove all the tab characters it runs correctly.

`Error: Kleborate failed to run
Command: ['kleborate', '-a', '/tmp/query.fna', '-o', '/tmp/', '-p', 'kpsc']
Return code: 1
Standard output: strain species N50 ST virulence_score resistance_score num_resistance_classes num_resistance_genes

Standard error: Traceback (most recent call last):
File "/usr/local/bin/kleborate", line 8, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/kleborate/main.py", line 154, in main
module_results = modules[module].get_results(unzipped_assembly, minimap2_index, args, results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kleborate/modules/klebsiella_pneumo_complex__kaptive/klebsiella_pneumo_complex__kaptive.py", line 90, in get_results
k_results = typing_pipeline(assembly_path, args.k_db, threads=args.threads)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kaptive/assembly.py", line 278, in typing_pipeline
partial=a.partial, dna_seq=assembly.seq(a.ctg, a.r_st, a.r_en, a.strand))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kaptive/assembly.py", line 60, in seq
return self.contigs[ctg].seq[start:end] if strand == "+" else self.contigs[ctg].seq[
~~~~~~~~~~~~^^^^^
KeyError: 'OW967300.1'`

@tomdstanton
Copy link
Contributor

Issue arises from: https://github.com/klebgenomics/Kaptive/blob/8c4516fd282efa743887a539f7ab7cf9e5bbe411/kaptive/assembly.py#L100
Need to replace split(' ') to a straight-up whitespace split (on first instance).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants