Skip to content

Commit

Permalink
[Platform]: pharmgkb allele column (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmehta committed Feb 27, 2024
1 parent b383f9b commit 81d6a96
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const geneEssentiality: Column = {

const hasSafetyEvent: Column = {
id: "hasSafetyEvent",
label: "Known adverse events",
label: "Known safety events",
aggregation: aggregations.safety,
sectionId: "safety",
description: "Target associated with a curated adverse event",
Expand Down
14 changes: 14 additions & 0 deletions packages/sections/src/drug/Pharmacogenomics/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ function Body({ id: chemblId, label: name, entity }) {
naLabel
),
},
{
id: "starAllele",
label: "Star Allele",
renderCell: ({ haplotypeId, haplotypeFromSourceId }) => {
const displayId = haplotypeId || haplotypeFromSourceId || naLabel;
const LinkComponent = haplotypeFromSourceId && (
<Link external to={`https://www.pharmgkb.org/haplotype/${haplotypeFromSourceId}`}>
{displayId}
</Link>
);

return LinkComponent || displayId || naLabel;
},
},
{
id: "genotypeId",
label: "Genotype ID",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ query PharmacogenomicsQuery($chemblId: String!) {
id
approvedSymbol
}
haplotypeId
haplotypeFromSourceId
isDirectTarget
phenotypeFromSourceId
genotypeAnnotationText
Expand Down
1 change: 0 additions & 1 deletion packages/sections/src/evidence/Chembl/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ function Body({ id, label, entity }) {
variables={{
ensemblId,
efoId,
cursor,
size,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ query PharmacogenomicsQuery($ensemblId: String!) {
id
label
}
haplotypeId
haplotypeFromSourceId
isDirectTarget
drugFromSource
drugId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ function OverviewTab({ pharmacogenomics, query, variables }) {
naLabel
),
},
{
id: "starAllele",
label: "Star Allele",
renderCell: ({ haplotypeId, haplotypeFromSourceId }) => {
const displayId = haplotypeId || haplotypeFromSourceId || naLabel;
const LinkComponent = haplotypeFromSourceId && (
<Link external to={`https://www.pharmgkb.org/haplotype/${haplotypeFromSourceId}`}>
{displayId}
</Link>
);

return LinkComponent || displayId || naLabel;
},
},
{
id: "genotypeId",
label: "Genotype ID",
Expand Down

0 comments on commit 81d6a96

Please sign in to comment.