Sort annotations on Roman-numeral chromosomes, report duplicate chromosomes #253
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This improves error handling for raw annotations. It eliminates one class of user error, and provides helpful error messaging for another. In cases like #239, developer experience is now smoother and richer, letting client developers focus less on appeasing Ideogram.js and more on building useful genome visualizations.
Pass yeast annotations in any chromosome order
Client developers provide raw annotations to show genomic features in Ideogram -- locations of genes, etc.
Previously, raw annotations had to be sorted by chromosome. This was error-prone in organisms like yeast (Saccharomyces cerevisiae), which have chromosomes labeled with Roman numerals and domain-specific names like "MT". Client developers either needed to hard-code chromosome order for such organisms, or re-implement much of Ideogram's chromosome sorting algorithm. That's too much work!
Now, raw annotations can be passed in any chromosome order. Ideogram sorts raw annotations internally, as it does for its own chromosome objects. Client developers no longer need to worry about it.
Get notified about duplicate-chromosome errors
Raw annotation datasets can have errors, like specifying a given chromosome redundantly. Previously, this kind of user error passed by silently -- annotations were simply done twice. Such duplicate annotations are problematic in layouts that show feature count distribution, e.g. histograms as used in #239.
Now, an error is thrown in the console. It includes instructions on how to fix the problem. Here's what it looks like: