diff --git a/packages/sections/src/constants.js b/packages/sections/src/constants.js index 358627ea0..34fe60d9c 100644 --- a/packages/sections/src/constants.js +++ b/packages/sections/src/constants.js @@ -119,3 +119,14 @@ export const initialResponse = { error: null, loading: true, }; + +export const QTLStudyType = [ + "scsqtl", + "sceqtl", + "scpqtl", + "sctuqtl", + "sqtl", + "eqtl", + "pqtl", + "tuqtl", +]; diff --git a/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx b/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx index 3083f2954..d7c9e5086 100644 --- a/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx +++ b/packages/sections/src/credibleSet/MolQTLColoc/Body.tsx @@ -222,17 +222,15 @@ type BodyProps = { function Body({ studyLocusId, entity }: BodyProps) { const variables = { studyLocusId: studyLocusId, + size: table5HChunkSize, + index: 0, }; const [request, setRequest] = useState(initialResponse); const getData = useBatchQuery({ query: MOLQTL_COLOC_QUERY, - variables: { - studyLocusId, - size: table5HChunkSize, - index: 0, - }, + variables, dataPath: "data.credibleSet.colocalisation", size: table5HChunkSize, }); diff --git a/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql b/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql index bc49ca334..6e7a753f1 100644 --- a/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql +++ b/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocQuery.gql @@ -1,6 +1,9 @@ query MolQTLColocQuery($studyLocusId: String!, $size: Int!, $index: Int!) { credibleSet(studyLocusId: $studyLocusId) { - colocalisation(studyTypes: [tuqtl, pqtl, eqtl, sqtl], page: { size: $size, index: $index }) { + colocalisation( + studyTypes: [scsqtl, sceqtl, scpqtl, sctuqtl, sqtl, eqtl, pqtl, tuqtl] + page: { size: $size, index: $index } + ) { count rows { otherStudyLocus { diff --git a/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocSummaryFragment.gql b/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocSummaryFragment.gql index f560a26be..ac0d1eb97 100644 --- a/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocSummaryFragment.gql +++ b/packages/sections/src/credibleSet/MolQTLColoc/MolQTLColocSummaryFragment.gql @@ -1,6 +1,6 @@ fragment MolQTLColocSummaryFragment on credibleSet { molqtlcolocalisation: colocalisation( - studyTypes: [tuqtl, pqtl, eqtl, sqtl] + studyTypes: [scsqtl, sceqtl, scpqtl, sctuqtl, sqtl, eqtl, pqtl, tuqtl] page: { size: 1, index: 0 } ) { count diff --git a/packages/sections/src/variant/QTLCredibleSets/Body.tsx b/packages/sections/src/variant/QTLCredibleSets/Body.tsx index df0b865e2..159449174 100644 --- a/packages/sections/src/variant/QTLCredibleSets/Body.tsx +++ b/packages/sections/src/variant/QTLCredibleSets/Body.tsx @@ -14,7 +14,7 @@ import { credsetConfidenceMap, initialResponse, naLabel, table5HChunkSize } from import { definition } from "."; import Description from "./Description"; import QTL_CREDIBLE_SETS_QUERY from "./QTLCredibleSetsQuery.gql"; -import { mantissaExponentComparator, nullishComparator, variantComparator } from "../../utils/comparators"; +import { mantissaExponentComparator, variantComparator } from "../../utils/comparators"; import { ReactNode, useEffect, useState } from "react"; import { responseType } from "ui/src/types/response"; @@ -29,9 +29,7 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { { id: "studyLocusId", label: "Navigate", - renderCell: ({ studyLocusId }) => ( - - ), + renderCell: ({ studyLocusId }) => , }, { id: "leadVariant", @@ -153,8 +151,9 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { filterValue: false, sortable: true, comparator: (a, b) => { - return a?.locus?.rows?.[0]?.posteriorProbability - - b?.locus?.rows?.[0]?.posteriorProbability; + return ( + a?.locus?.rows?.[0]?.posteriorProbability - b?.locus?.rows?.[0]?.posteriorProbability + ); }, tooltip: ( <> @@ -201,9 +200,7 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) { sortable: true, filterValue: false, renderCell: ({ locusSize }) => { - return typeof locusSize?.count === "number" - ? locusSize.count.toLocaleString() - : naLabel; + return typeof locusSize?.count === "number" ? locusSize.count.toLocaleString() : naLabel; }, exportValue: ({ locusSize }) => locusSize?.count, }, @@ -218,17 +215,15 @@ type BodyProps = { function Body({ id, entity }: BodyProps): ReactNode { const variables = { variantId: id, + size: table5HChunkSize, + index: 0, }; const [request, setRequest] = useState(initialResponse); const getAllQtlData = useBatchQuery({ query: QTL_CREDIBLE_SETS_QUERY, - variables: { - variantId: id, - size: table5HChunkSize, - index: 0, - }, + variables, dataPath: "data.variant.qtlCredibleSets", size: table5HChunkSize, }); diff --git a/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsQuery.gql b/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsQuery.gql index 1c666900e..84060a2cd 100644 --- a/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsQuery.gql +++ b/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsQuery.gql @@ -4,7 +4,7 @@ query QTLCredibleSetsQuery($variantId: String!, $size: Int!, $index: Int!) { referenceAllele alternateAllele qtlCredibleSets: credibleSets( - studyTypes: [sqtl, pqtl, eqtl, tuqtl] + studyTypes: [scsqtl, sceqtl, scpqtl, sctuqtl, sqtl, eqtl, pqtl, tuqtl] page: { size: $size, index: $index } ) { count diff --git a/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql b/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql index d517b547c..fea6d60ad 100644 --- a/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql +++ b/packages/sections/src/variant/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql @@ -1,6 +1,6 @@ fragment QTLCredibleSetsSummaryFragment on Variant { qtlCredibleSets: credibleSets( - studyTypes: [sqtl, pqtl, eqtl, tuqtl] + studyTypes: [scsqtl, sceqtl, scpqtl, sctuqtl, sqtl, eqtl, pqtl, tuqtl] page: { size: 1, index: 0 } ) { count