gregdingle/genetify

Change to CSS gene parsing & naming

ddn opened this issue · 1 comments

ddn commented

I've made one small change to my genetify code that has made using it in the real world easier for me.

By default, genetify uses everything left of the 'v' as the gene name. This caused some problems when you needed different display CSS for different variants.

With this change, it will only take the first word left of the 'v' as the gene name. Anything before that is ignored, and can be used to add display CSS.

Line 234 of genetify.js

change to:

    var geneNamePattern = '([A-Z0-9_$][a-zA-Z0-9_$\-]*)';

I'm open to discussion of why this may or may not be a good idea, but it makes genetify much more usable for me in the real world.

I think this change makes a lot of sense. I encourage you to make a pull request so others can benefit. See https://help.github.com/articles/using-pull-requests .