eweitz / ideogram

Chromosome visualization for the web
https://eweitz.github.io/ideogram
Other
288 stars 72 forks source link

Sort annotations on Roman-numeral chromosomes, report duplicate chromosomes #253

Closed eweitz closed 3 years ago

eweitz commented 3 years ago

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:

detect_duplicate_chromosomes_in_raw_annotations_ideogram_2020-11-06
coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.003%) to 89.697% when pulling 56aecee1c1d702928329e8a4f41ff8ebf9cca22e on sort-roman-annotations into 3ebfb41f3a5971a371254bd4d1ad6cbcf44c818f on master.