Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Platform]: QTL studytype in queries #602

Merged
merged 7 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/sections/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,14 @@ export const initialResponse = {
error: null,
loading: true,
};

export const QTLStudyType = [
"scsqtl",
"sceqtl",
"scpqtl",
"sctuqtl",
"sqtl",
"eqtl",
"pqtl",
"tuqtl",
];
8 changes: 3 additions & 5 deletions packages/sections/src/credibleSet/MolQTLColoc/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,15 @@ type BodyProps = {
function Body({ studyLocusId, entity }: BodyProps) {
const variables = {
studyLocusId: studyLocusId,
size: table5HChunkSize,
index: 0,
};

const [request, setRequest] = useState<responseType>(initialResponse);

const getData = useBatchQuery({
query: MOLQTL_COLOC_QUERY,
variables: {
studyLocusId,
size: table5HChunkSize,
index: 0,
},
variables,
dataPath: "data.credibleSet.colocalisation",
size: table5HChunkSize,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 9 additions & 14 deletions packages/sections/src/variant/QTLCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -29,9 +29,7 @@ function getColumns({ id, referenceAllele, alternateAllele }: getColumnsType) {
{
id: "studyLocusId",
label: "Navigate",
renderCell: ({ studyLocusId }) => (
<Navigate to={`/credible-set/${studyLocusId}`} />
),
renderCell: ({ studyLocusId }) => <Navigate to={`/credible-set/${studyLocusId}`} />,
},
{
id: "leadVariant",
Expand Down Expand Up @@ -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: (
<>
Expand Down Expand Up @@ -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,
},
Expand All @@ -218,17 +215,15 @@ type BodyProps = {
function Body({ id, entity }: BodyProps): ReactNode {
const variables = {
variantId: id,
size: table5HChunkSize,
index: 0,
};

const [request, setRequest] = useState<responseType>(initialResponse);

const getAllQtlData = useBatchQuery({
query: QTL_CREDIBLE_SETS_QUERY,
variables: {
variantId: id,
size: table5HChunkSize,
index: 0,
},
variables,
dataPath: "data.variant.qtlCredibleSets",
size: table5HChunkSize,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading