-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coloring BAM reads by strand with mismatch highlights #72
Conversation
Color strands differently for call review, show quality of nonref bases based on opacity.
Bug fix for uncollapsing super groups
For update of branch
T: 'red' | ||
G: 'orange', | ||
T: 'red', | ||
'-' : 'hotPink' // deletion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps there could be an option to customize these colors.
Also, the '-'
character denoting deletion is currently just hardcoded here, which is probably not ideal.
Thanks very much for this contribution. A few minor things:
Are you happy to make those changes, or shall I? Slightly longer-term things I think we should be considering (but let's not hold up this PR, which is clearly useful as is):
I've just realized that this Dalliance-specific stylesheet extension never made it into the docs (my bad, will fix shortly). Doing things this way is more general, at the expense of making it a little harder to hook everything up in the track editor. Just something to consider in the future. |
@ymen correct me if I'm wrong, but I believe we made this change because using black for the characters was better for readability. |
It's this change I was talking about: https://github.com/dasmoth/dalliance/pull/72/files#diff-0d966b7245df74fbb0a38172982c9717L107 On Thu, Jul 17, 2014 at 4:46 PM, Matt Rasmussen notifications@github.com
|
Thanks Thomas for your feedback. I'll make the changes and push it back to you later today.
I was following the colours from IGV, but this is pretty much arbitrary. Another consideration was that we had to change the font color for
Sounds good, I'll make the adjustment! |
Pushed the correction for the typo and adjusted the SequenceGlyph constructor as suggested. If you prefer the original base color for |
Coloring BAM reads by strand with mismatch highlights
Addresses: #67
Sorry for taking such a long time for the PR, and definitely let us know your opinions and suggestions. We would love to work with you to improve implementations and design choices, and make sure the changes align to the overall roadmap of Dalliance!
Changes
This PR implements coloring of BAM reads by strand, rendered using
_SEQUENCE
glyphs.The option to color BAM reads is turned on by the option
Highlight mismatches & strands
, piggybacking on the previous optionColor mismatches
. This option is currently not turned on by default, but I believe it might be reasonable to make this turned on by default for Bam files.Specific changes as follows:
Changes to edit tier panel:
Color mismatches
renamed asHighlight mismatches & strands
.When checked, adds 2 color selector rows for selecting colors of plus strand (default:
![image](https://cloud.githubusercontent.com/assets/7988161/3609290/1d587a50-0d77-11e4-865b-abff14ded551.png)
lightsalmon
) and the minus strand (default:lightskyblue
)Changes to glyph rendering (when color strand option selected)
At close up view (defined as
scale
> 8), draw rectangle for each base: bases that agree with ref bases are colored using strand colors, as selected in the tier-edit panel. Non-ref bases' rects are colored based on their base colors (defined in the objectbaseColors
incbrowser.js
) and labelled with black text. Opacity is adjusted inverse to the read quality score, as previously.At high zoom without closeup (defined as
zoom=high
&scale
< 8), reads are first drawn as a solid rectangle based on strand direction with height corresponding to half of the tier height. Non-ref bases are drawn over with full height.From working with the browser, we have found this to 1) improve visibility of non-ref bases and 2) reduce rendering time, especially for high depth (>1000) sequencing results. Ref bases are fully opaque and not adjusted based on qual score.
Changes to toSVG rendering (when color strand option selected)
SVG rendering always draw each base individually, at full height, with opacity adjusted to qual score, since rendering time is probably not a huge consideration in this case.