Skip to content

Commit

Permalink
[Platform]: Fix study in GWAS credible sets in evidence (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmcn authored Nov 28, 2024
1 parent 8f61c66 commit 2ba5ca7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions packages/sections/src/evidence/GWASCredibleSets/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function getColumns() {
id: "variantId",
label: "Lead Variant",
renderCell: ({ credibleSet }) => {
const { variant } = credibleSet;
const variant = credibleSet.variant;
if (variant?.id) return <Link to={`/variant/${variant?.id}`}>{variant?.id}</Link>;
return naLabel;
},
Expand All @@ -61,7 +61,7 @@ function getColumns() {
label: "Study",
renderCell: ({ credibleSet }) => {
return (
<Link to={`/study/${credibleSet?.study.studyId}`}>{credibleSet?.study.studyId}</Link>
<Link to={`/study/${credibleSet?.study.id}`}>{credibleSet?.study.id}</Link>
);
},
},
Expand All @@ -81,22 +81,22 @@ function getColumns() {
label: "P-value",
comparator: (a, b) => {
return mantissaExponentComparator(
a?.credibleSet.pValueMantissa,
a?.credibleSet.pValueExponent,
b?.credibleSet.pValueMantissa,
b?.credibleSet.pValueExponent
a?.credibleSet?.pValueMantissa,
a?.credibleSet?.pValueExponent,
b?.credibleSet?.pValueMantissa,
b?.credibleSet?.pValueExponent
);
},
sortable: true,
filterValue: false,
renderCell: ({ credibleSet }) => {
const { pValueMantissa, pValueExponent } = credibleSet;
const { pValueMantissa, pValueExponent } = credibleSet ?? {};
if (typeof pValueMantissa !== "number" || typeof pValueExponent !== "number")
return naLabel;
return <ScientificNotation number={[pValueMantissa, pValueExponent]} />;
},
exportValue: ({ credibleSet }) => {
const { pValueMantissa, pValueExponent } = credibleSet;
const { pValueMantissa, pValueExponent } = credibleSet ?? {};
if (typeof pValueMantissa !== "number" || typeof pValueExponent !== "number") return null;
return `${pValueMantissa}x10${pValueExponent}`;
},
Expand Down Expand Up @@ -158,7 +158,7 @@ function getColumns() {
id: "publication",
label: "Publication",
renderCell: ({ credibleSet }) => {
const { publicationFirstAuthor, publicationDate, pubmedId } = credibleSet?.study;
const { publicationFirstAuthor, publicationDate, pubmedId } = credibleSet?.study ?? {};
if (!publicationFirstAuthor) return naLabel;
return (
<PublicationsDrawer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ query GwasCredibleSetsQuery($ensemblId: String!, $efoId: String!, $size: Int!) {
studyLocusId
study {
traitFromSource
studyId
id
projectId
publicationFirstAuthor
publicationDate
Expand Down

0 comments on commit 2ba5ca7

Please sign in to comment.