Skip to content

Commit

Permalink
auu ui for clinvar conflictingPathogenicities
Browse files Browse the repository at this point in the history
  • Loading branch information
hanars committed Jul 18, 2023
1 parent 0c341a6 commit 4216bce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/shared/components/panel/variants/Pathogenicity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ const clinvarUrl = (clinvar) => {
return baseUrl + variantPath
}

const clinvarLabel = (pathogenicity, assertions) => {
const clinvarLabel = (pathogenicity, assertions, conflictingPathogenicities) => {
let label = snakecaseToTitlecase(pathogenicity)
if (conflictingPathogenicities && conflictingPathogenicities.length) {
const conflictingLabels = conflictingPathogenicities.map(
({ pathogenicity: conflictingPath, count }) => `${snakecaseToTitlecase(conflictingPath)} (${count})`,
)
label = `${label} [${conflictingLabels.join('; ')}]`
}
if (assertions && assertions.length) {
label = `${label} (${assertions.map(snakecaseToTitlecase).join(', ')})`
}
Expand All @@ -85,7 +91,7 @@ const Pathogenicity = React.memo(({ variant, showHgmd }) => {
if ((clinvar.clinicalSignificance || clinvar.pathogenicity) && (clinvar.variationId || clinvar.alleleId)) {
const { pathogenicity: clinvarPathogenicity, assertions, severity } = clinvarSignificance(clinvar)
pathogenicity.push(['ClinVar', {
label: clinvarLabel(clinvarPathogenicity, assertions),
label: clinvarLabel(clinvarPathogenicity, assertions, clinvar.conflictingPathogenicities),
color: clinvarColor(severity, 'red', 'orange', 'green'),
href: clinvarUrl(clinvar),
goldStars: clinvar.goldStars,
Expand Down

0 comments on commit 4216bce

Please sign in to comment.