gamcil / clinker

Gene cluster comparison figure generator
MIT License
518 stars 69 forks source link

Error raised by low-homology references (ValueError: No alignments are stored in the aligner) #34

Closed sminot closed 3 years ago

sminot commented 3 years ago

I have encountered an error message while processing some genome regions with clinker:

ValueError: No alignments are stored in the aligner

My understanding is that this error is being raised because there is a GBK in the list of inputs which does not have any alignment (that fall above the threshold of inclusion) with any other GBKs in the inputs.

I can definitely understand why this behavior may have been set up, with the justification that if a user provides a GBK then it should be included in the output. However, in my case I have been using clinker as the final visualization component of a larger workflow (BOFFO), which is able to identify homologous genome regions from a collection of bacterial genomes based on a small set of query sequences. In this approach, the inputs to clinker can easily have such distantly-related genes that they do not align above the threshold. For this purpose, it would be really nice if clinker just ignored any GBK inputs which do not align.

Would it be possible to have clinker ignore these missing alignments? Either by default or with an optional flag?

sminot commented 3 years ago

To be clear, I'm only asking this question because clinker has been such an incredibly useful tool! Thank you so much for all your work putting wonderful utility together!

gamcil commented 3 years ago

Glad you find it useful :)

So, clinker internally uses an aligner object which saves all cluster alignments generated during the pipeline - your error should only pop up when attempting to generate the results text summary from that aligner object when no alignments have been generated/saved. In the main clinker workflow, this should be accounted for (i.e. only attempts to generate the summary if there are saved alignments), and the visualisation should work fine regardless.

Even if two clusters don't have any gene links above the threshold, an alignment between them should still be saved, so I think something might be going wrong in the actual alignment stage..

Could you upload some regions that are causing this issue for you? And are you using the most recent version of clinker?

sminot commented 3 years ago

This is very helpful! It appears that this error is coming up for the exact reason you anticipated. This gives me everything I need to fix it on our end. Thanks!