-
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
bugfix/DEVSU-2445 rapid report kb matches bug fix #572
bugfix/DEVSU-2445 rapid report kb matches bug fix #572
Conversation
- Update kb matches and evidence level splitting logic in rapid report with new kb matched statements response data structure - Update valueGetter logic for observed variants column in kb matches tables - Switch positions of observed variants and known variants columns back to original
…ta structure (evidenceLevel and category being nested in kbmatchedstatements array since each variant can now have multiple statements) - Rework kbMatches statement categories handling in smallMutations, copyNumber, structuralVariants, and expressionOutliers to work with new kbmatches data structure - Fix ExpOutliersType missing in GeneType
…ches data structure - Update mockData for rapid report unit tests
…ents-structure-bugs
valueGetter: (params) => { | ||
const { data: { kbMatches } } = params; | ||
if (kbMatches) { | ||
const kbVariants = kbMatches?.map((match) => match.kbVariant).filter((kbVariant) => kbVariant !== undefined); |
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.
we can probably just use .filter
no?
kbMatches?.filter((match) => match?.kbVariant);
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.
oh yea you're right let me simplify it
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.
@kttkjl actually I tried it and it didn't work, we still have to extract kbVariant from each match with .map() right?
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.
sorry, , oh yeah, we do have to map out the values toomatch.kbVariant && match.kbVariant !== undefined
, maybe the shorthand is not enough
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.
in which case we'll use reduce
kbMatches?.reduce((acc, match) => {
if (match.kbVariant !== undefined) {
acc.push(match.kbVariant);
}
return acc;
}, []);
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.
Programmatically makes sense, just reduce
vs map
+ filter
- Replace map+filter approach with reduce()
Extension of [https://github.com//pull/571]