dasmoth / dalliance

Interactive web-based genome browser.
http://www.biodalliance.org/
BSD 2-Clause "Simplified" License
226 stars 68 forks source link

49 Translate Genes #80

Closed ymen closed 10 years ago

ymen commented 10 years ago

@dasmoth cc @mdrasmus

Addresses https://github.com/dasmoth/dalliance/issues/49

Summary

Show translation of genes to amino acids at high magnifications in the genome browser.

Again, please let us know your feedback or suggestions about design choices and implementation, we're most keen to work with you to make sure this PR aligns well with the overall road map of Dalliance!

Illustration

I changed the color for glyphs of type translation to blue instead of the current default red for better contrast with stop codons (see next point).

screen shot 2014-07-21 at 10 55 26 pm

screen shot 2014-07-21 at 10 55 13 pm

screen shot 2014-07-21 at 11 06 05 pm

Of note

If an amino acid is spread over 2 exons (ie it's at the splice site and some part of the codon is at one exon, and some part at the next exon), the translation of the amino acid is not given. An appropriately colored block with no letter labeling will be drawn (e.g. below, to the left of the A amino acid).

screen shot 2014-07-21 at 11 02 07 pm

I have not found a trivial way of fetching of non-contiguous sequence information (which may not be in the viewing range). If you have any ideas on how this can be implemented I'd love to refine this!

Testing

I did sanity check for the translation based on

  1. Scanning through the browser and ensuring there are minimal stop codons in the middle of ORFs
  2. Comparing the translation results to the GeneCode 19 track on UCSC genome browser.
dasmoth commented 10 years ago

Excellent, thanks very much.

One tiny bug, which bit me while testing -- need to check for "bwgBlob" as well as "bwgURI" to detect a bigBed/bigWig track, otherwise bigbeds loaded from local files won't work. I'll fix this myself after merging.

In the longer run, I think there might be some merit in shifting the logic about when to use the AminoAcidGlyph into stylesheets, rather than the main code. However, that might need a few stylesheet-system improvements to get right, so let's leave it for now.

ymen commented 10 years ago

need to check for "bwgBlob" as well as "bwgURI" to detect a bigBed/bigWig track, otherwise bigbeds loaded from local files won't work. I'll fix this myself after merging.

Thanks for catching that and being so prompt to respond Thomas!