neherlab / treetime

Maximum likelihood inference of time stamped phylogenies and ancestral reconstruction
MIT License
225 stars 55 forks source link

ENH: Better error message when input alignment has sequences of unequal length #258

Open corneliusroemer opened 1 year ago

corneliusroemer commented 1 year ago

I got this error from refine that I struggled to debug:

ERROR: SequenceData: loading alignment failed... builds/masked.fasta

ERROR from TreeTime: This error is most likely due to a problem with your input data.
Please check your input data and try again. If you continue to have problems, please open a new issue including
the original command and the error above:  <https://github.com/nextstrain/augur/issues/new/choose> 

I didn't know why the alignment couldn't be loaded.

Turns out, my sequences weren't aligned, they had different lengths.

Would be good to report a bit more granular detail from what goes wrong in the alignment loading.

corneliusroemer commented 1 year ago

Error should be handled here: https://github.com/neherlab/treetime/blob/52e7cd106a9e0b9a8ea661f213e7e5338e1165cd/treetime/sequence_data.py#L154-L159 See https://bedfordlab.slack.com/archives/C01LCTT7JNN/p1694021182135669?thread_ts=1694018285.407369&cid=C01LCTT7JNN