Skip to content
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

Standardize phred qual scaling between BAM and CRAM and add option to make mismatches render in a lighter color when quality is low #1720

Merged
merged 6 commits into from
Feb 22, 2021

Conversation

cmdcolin
Copy link
Collaborator

This adds

(a) a new coloring option "Adjust mismatch visibility by quality" that helps adjust the coloring of SNPs by their qual score
(b) standardize the qual score across BAM and CRAM. the CRAM was adding +33 which is basically what is done to report proper ASCII characters for scores, but to be standardized we skip adding +33

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Feb 20, 2021
@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Feb 20, 2021
@cmdcolin cmdcolin force-pushed the qual_fixes branch 4 times, most recently from 9ae8113 to 97172f7 Compare February 20, 2021 17:50
@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #1720 (8d58cc5) into master (703b97e) will increase coverage by 0.01%.
The diff coverage is 81.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1720      +/-   ##
==========================================
+ Coverage   58.81%   58.83%   +0.01%     
==========================================
  Files         448      448              
  Lines       20754    20767      +13     
  Branches     4919     4922       +3     
==========================================
+ Hits        12207    12218      +11     
- Misses       8240     8242       +2     
  Partials      307      307              
Impacted Files Coverage Δ
...lugins/alignments/src/LinearPileupDisplay/model.ts 73.93% <0.00%> (-0.91%) ⬇️
...ns/alignments/src/PileupRenderer/PileupRenderer.ts 65.87% <70.00%> (-0.11%) ⬇️
...lignments/src/BamAdapter/BamSlightlyLazyFeature.ts 79.24% <100.00%> (+0.39%) ⬆️
...lugins/alignments/src/BamAdapter/MismatchParser.ts 88.15% <100.00%> (+0.74%) ⬆️
...gnments/src/CramAdapter/CramSlightlyLazyFeature.ts 85.78% <100.00%> (+0.22%) ⬆️
packages/core/util/index.ts 82.20% <0.00%> (-0.33%) ⬇️
...inearGenomeView/components/RefNameAutocomplete.tsx 93.61% <0.00%> (+4.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 703b97e...8d58cc5. Read the comment docs.

@cmdcolin cmdcolin force-pushed the qual_fixes branch 4 times, most recently from 504f868 to d68a37e Compare February 22, 2021 20:51
@cmdcolin cmdcolin merged commit 73bdb44 into master Feb 22, 2021
@cmdcolin cmdcolin changed the title Adjust quality score in mismatch rendering and standardize phred scaling between BAM and CRAM Standardize phred qual scaling between BAM and CRAM and add option to make mismatches render in a lighter color when quality is low Feb 22, 2021
@cmdcolin cmdcolin deleted the qual_fixes branch February 23, 2021 03:36
@rbuels
Copy link
Contributor

rbuels commented Mar 3, 2021

but does this lead to the quality scores being all -33 in the feature details panel?

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Mar 3, 2021

Nope, the scores are reported as numbers in the range 0-93 or so when you add 33, you get it starting in the ascii range 33, the first printable character !, to 126, a ~ last printable http://www.asciitable.com/

So the only reason to add 33 is so that you can encode them into an ascii string

And with this change the "Color by per-base quality" and the feature detail panel qual score reports are the same for a BAM and CRAM file. Can see this in volvox examples (many tracks have both BAM and CRAM examples) and the human data (HG002 ultralong BAM and CRAM exist)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants