diff --git a/packages/sections/src/study/GWASCredibleSets/Body.tsx b/packages/sections/src/study/GWASCredibleSets/Body.tsx index 7ed80b179..3468cc35d 100644 --- a/packages/sections/src/study/GWASCredibleSets/Body.tsx +++ b/packages/sections/src/study/GWASCredibleSets/Body.tsx @@ -101,6 +101,11 @@ const columns = [ tooltip: "Fine-mapping confidence based on the quality of the linkage-disequilibrium information available and fine-mapping method", sortable: true, + comparator: nullishComparator( + (a, b) => a - b, + row => credsetConfidenceMap?.[row.confidence], + false + ), renderCell: ({ confidence }) => { if (!confidence) return naLabel; return ( diff --git a/packages/sections/src/study/QTLCredibleSets/Body.tsx b/packages/sections/src/study/QTLCredibleSets/Body.tsx index 0f516a2f1..92bffa1bc 100644 --- a/packages/sections/src/study/QTLCredibleSets/Body.tsx +++ b/packages/sections/src/study/QTLCredibleSets/Body.tsx @@ -1,10 +1,19 @@ import { useQuery } from "@apollo/client"; -import { Link, SectionItem, ScientificNotation, DisplayVariantId, OtTable, Navigate } from "ui"; -import { naLabel } from "@ot/constants"; +import { + Link, + SectionItem, + ScientificNotation, + DisplayVariantId, + OtTable, + Navigate, + Tooltip, + ClinvarStars, +} from "ui"; +import { naLabel, credsetConfidenceMap } from "@ot/constants"; import { definition } from "."; import Description from "./Description"; import QTL_CREDIBLE_SETS_QUERY from "./QTLCredibleSetsQuery.gql"; -import { mantissaExponentComparator, variantComparator } from "@ot/utils"; +import { mantissaExponentComparator, nullishComparator, variantComparator } from "@ot/utils"; const columns = [ { @@ -74,6 +83,27 @@ const columns = [ id: "finemappingMethod", label: "Fine-mapping method", }, + { + id: "confidence", + label: "Fine-mapping confidence", + tooltip: + "Fine-mapping confidence based on the quality of the linkage-disequilibrium information available and fine-mapping method", + sortable: true, + comparator: nullishComparator( + (a, b) => a - b, + row => credsetConfidenceMap?.[row.confidence], + false + ), + renderCell: ({ confidence }) => { + if (!confidence) return naLabel; + return ( + + + + ); + }, + filterValue: ({ confidence }) => credsetConfidenceMap[confidence], + }, { id: "credibleSetSize", label: "Credible set size", diff --git a/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsQuery.gql b/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsQuery.gql index 6f8138dbb..2d79bfe08 100644 --- a/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsQuery.gql +++ b/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsQuery.gql @@ -19,6 +19,7 @@ query QTLCredibleSetsQuery($studyId: String!) { count } finemappingMethod + confidence } } }