-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix heatmap bug in representing deletions. #183
Conversation
export function parseSimpleProVariant(variant: string): SimpleProteinVariation | null { | ||
const match = variant.match(proVariantRegex) | ||
if (!match) { | ||
// console.log(`WARNING: Unrecognized pro variant: ${variant}`) |
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.
should probably be un-commented or deleted
src/components/ScoreSetHeatmap.vue
Outdated
// .tickFormat(n => String.fromCharCode('A'.charCodeAt(0) + n - 1)) | ||
.tickFormat((n) => { | ||
// Get the row's amino acid code or variation symbol. | ||
const label = HEATMAP_ROWS[HEATMAP_ROWS.length - 1 - n] |
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.
repeating this logic to reverse the HEATMAP_ROWS gets very confusing to the reader.
I think there are a few options here.
- reverse heatmap_rows
- use a d3 scalePoint as in this notebook to combine the flipping and translation of letter to axis position: https://observablehq.com/@mbostock/phases-of-the-moon
- to eliminate the backwards iteration below, use a data structure for each heatmap_rows entry with style and label attributes that have defaults, so we have entries like {'symbol': '-', 'style': 'mave-heatmap-y-axis-tick-label-lg'} and {'symbol': '*', 'label': '\uff0a'}
src/lib/heatmap.ts
Outdated
* @return The one-character code representing the same amino acid or change, or null if the input was not a supported | ||
* amino acid or change. | ||
*/ | ||
export function singleLetterAminoAcidOrHgvsCode(aaCodeOrChange: string) { |
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.
let's do explicit return types for ts in this project
This fixes issue #139, in which it was reported that deletions appear in the top row of the heatmap, normally reserved for substitutions by Ala.
In addition:
@PlushZ provided a useful example in score set tmp:540c9d47-9e0c-4c56-839c-3b1249a957df. To test the bug fix using this example, you may change the ownership of that score set in a development instance of MaveDB.
The heatmap for this score set should now look like this:
The heatmap for score set urn:mavedb:00000001-a-1 is a good check against regressions, and it should look like this: