rrwick / Trycycler

A tool for generating consensus long-read assemblies for bacterial genomes
GNU General Public License v3.0
306 stars 28 forks source link

AssertionError during Reconcile of plasmid sequence #40

Closed menickname closed 2 years ago

menickname commented 2 years ago

Dear Trycycler Team

I have been running/assembling a big dataset of bacterial genomes with Trycycler and I have just encountered following problem with one of my plasmid clusters. The sequences are circular and are taken along the dataset, untill the known starting sequences are searched for. No matter which sequences I include and/or remove, the error keeps on persisting. This error did not occur with any other plasmid cluster before. Also not from the same dataset.

`Finding starting sequence (2022-07-08 10:39:36) In this step, Trycycler finds a sequence to use as a starting point for each of the contigs. This can be a standard starting point (e.g. the dnaA gene) or if one is not found, then a randomly-chosen unique sequence will be used. If necessary, the sequences will be flipped (converted to their reverse complement sequence) to ensure that the starting sequence is on the positive strand.

Looking for known starting sequences in each contig...

Found starting sequence 0676_AWB10_RS27370 (replication protein RepA4) ATGAGAGAGCTTCTGTGCGCGGTCGGAGTGGTCCCGACGAGGGTTTACCC...

A_contig_7: Traceback (most recent call last): File "/home/linuxbrew/.linuxbrew/bin/trycycler", line 8, in sys.exit(main()) File "/home/thor/.local/lib/python3.9/site-packages/trycycler/main.py", line 48, in main reconcile(args) File "/home/thor/.local/lib/python3.9/site-packages/trycycler/reconcile.py", line 37, in reconcile seqs, starting_seq = get_starting_seq(seqs, args.threads) File "/home/thor/.local/lib/python3.9/site-packages/trycycler/starting_seq.py", line 68, in get_starting_seq seqs = flip_seqs_as_necessary(seqs, starting_seq) File "/home/thor/.local/lib/python3.9/site-packages/trycycler/starting_seq.py", line 43, in flip_seqs_as_necessary assert len(alignments) == 1 AssertionError `

Thank you in advance. Regards Nick Vereecke

rrwick commented 2 years ago

Hi Nick,

Thanks for pointing this out! It was a subtle bug (one part of the code filtered alignments for coverage while another didn't) but I think I've fixed it. The fix (9da386d) is in the main branch and should make it into the next release.

Ryan