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

AssertionError due to insufficient margins #16

Open
jakobnissen opened this issue Jun 17, 2021 · 5 comments
Open

AssertionError due to insufficient margins #16

jakobnissen opened this issue Jun 17, 2021 · 5 comments

Comments

@jakobnissen
Copy link

At least I think. I have a large-ish alignment with some sequences having quite long names. Running alv aln.fna works, but alv aln.fna | less results in:

Traceback (most recent call last):
  File "/Users/jakobnissen/miniconda3/bin/alv", line 250, in <module>
    main()
  File "/Users/jakobnissen/miniconda3/bin/alv", line 228, in main
    terminal.output_alignment(alignment, painter, args.width, args.dotted)
  File "/Users/jakobnissen/miniconda3/lib/python3.8/site-packages/alv/alignmentterminal.py", line 93, in output_alignment
    self._setup_left_margin(al, chosen_accessions)
  File "/Users/jakobnissen/miniconda3/lib/python3.8/site-packages/alv/alignmentterminal.py", line 75, in _setup_left_margin
    assert self.left_margin < self.width - 10
AssertionError
@arvestad
Copy link
Owner

Hi Jakob!
Thanks for the bug report. And sorry for the late reply --- it seems github issues have been sent to my spam folder.

What happens here is that there is no or almost no space for the actual sequence. I did not think that would occur, but left the assert for catching possible edge cases. What would be a good solution for when this is happening?

There is the option -aa that you could try. Maybe a version of this would be a good automatic workaround?

@arvestad
Copy link
Owner

Actually, I realise now that I did not read your bug report properly. I will have another look.

@arvestad
Copy link
Owner

It would help me if you could share some sample data that triggers this error, because I can't replicate the bug as you report it. Finding other problems, however...

@jakobnissen
Copy link
Author

I hate to break it to you, but I created a terminal alignment viewer myself in the meantime :) Check it out, it's pretty neat!
https://github.com/jakobnissen/alen
I'll try to find a minimal example to trigger the bug when I'm back from holiday.

@jakobnissen
Copy link
Author

This FASTA file breaks it on my computer:

>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a

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