diff --git a/packages/sections/src/constants.js b/packages/sections/src/constants.js index df86ed383..f8ad9d89b 100644 --- a/packages/sections/src/constants.js +++ b/packages/sections/src/constants.js @@ -7,6 +7,7 @@ export const appCanonicalUrl = "https://platform.opentargets.org"; // Chunk sizes for server side pagination/download. export const tableChunkSize = 100; export const downloaderChunkSize = 2500; +export const sectionsBaseSizeQuery = 3500; // NA label. export const naLabel = "N/A"; @@ -38,7 +39,7 @@ const clinicalPhases = { 4: "Phase IV", }; -export const phaseMap = (clinicalPhase) => { +export const phaseMap = clinicalPhase => { const clinicalPhaseId = String(clinicalPhase); return clinicalPhases[clinicalPhaseId]; }; diff --git a/packages/sections/src/evidence/CRISPR/Body.jsx b/packages/sections/src/evidence/CRISPR/Body.jsx index dfd24f4c2..40189dd86 100644 --- a/packages/sections/src/evidence/CRISPR/Body.jsx +++ b/packages/sections/src/evidence/CRISPR/Body.jsx @@ -3,7 +3,7 @@ import { useQuery } from "@apollo/client"; import { Link } from "@mui/material"; import { SectionItem, DataTable, TableDrawer } from "ui"; import { dataTypesMap } from "../../dataTypes"; -import { naLabel } from "../../constants"; +import { naLabel, sectionsBaseSizeQuery } from "../../constants"; import Description from "./Description"; import { definition } from "."; @@ -24,7 +24,7 @@ const columns = [ renderCell: ({ diseaseCellLines, diseaseFromSource }) => { if (!diseaseCellLines) return naLabel; - const cellLines = diseaseCellLines.map((line) => ({ + const cellLines = diseaseCellLines.map(line => ({ name: line.name, url: `https://cellmodelpassports.sanger.ac.uk/passports/${line.id}`, group: "Cancer Cell Lines", @@ -52,6 +52,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(CRISPR_QUERY, { @@ -64,9 +65,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.affected_pathway} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.crisprSummary; return ( diff --git a/packages/sections/src/evidence/CRISPR/CrisprQuery.gql b/packages/sections/src/evidence/CRISPR/CrisprQuery.gql index 38d8095ed..62789bdd0 100644 --- a/packages/sections/src/evidence/CRISPR/CrisprQuery.gql +++ b/packages/sections/src/evidence/CRISPR/CrisprQuery.gql @@ -1,10 +1,11 @@ -query CrisprQuery($ensemblId: String!, $efoId: String!) { +query CrisprQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id crisprSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["crispr"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/CRISPRScreen/Body.jsx b/packages/sections/src/evidence/CRISPRScreen/Body.jsx index 9919612aa..b49f0e89c 100644 --- a/packages/sections/src/evidence/CRISPRScreen/Body.jsx +++ b/packages/sections/src/evidence/CRISPRScreen/Body.jsx @@ -5,7 +5,7 @@ import { Tooltip, SectionItem, TooltipStyledLabel, Link, DataTable } from "ui"; import { dataTypesMap } from "../../dataTypes"; import Description from "./Description"; import { PublicationsDrawer } from "ui"; -import { defaultRowsPerPageOptions, naLabel } from "../../constants"; +import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants"; import { definition } from "."; import CRISPR_QUERY from "./CrisprScreenQuery.gql"; @@ -20,32 +20,23 @@ const sources = { // format the diseaseFromSource field: remove the "essential genes" info // this might be sorted at data level at some point -const parseDiseaseName = (d) => - d.toLowerCase().replace("essential genes / ", ""); +const parseDiseaseName = d => d.toLowerCase().replace("essential genes / ", ""); -const getColumns = (label) => [ +const getColumns = label => [ { id: "diseaseFromSourceMappedId", label: "Reported disease", - renderCell: (row) => { + renderCell: row => { const disease = parseDiseaseName(row.diseaseFromSource); - return ( - - {_.capitalize(disease)} - - ); + return {_.capitalize(disease)}; }, - filterValue: (row) => - row.diseaseFromSource + ", " + row.diseaseFromSourceMappedId, + filterValue: row => row.diseaseFromSource + ", " + row.diseaseFromSourceMappedId, }, { id: "studyId", label: "Study Identifier", - renderCell: (row) => ( - + renderCell: row => ( + {row.studyId} ), @@ -53,7 +44,7 @@ const getColumns = (label) => [ { id: "contrast", label: "Contrast / Study overview", - renderCell: (row) => { + renderCell: row => { // trim the last '.' - this could also be addressed at data level perhaps? const overview = row.studyOverview?.endsWith(".") ? row.studyOverview.slice(0, -1) @@ -63,10 +54,7 @@ const getColumns = (label) => [ + } > @@ -80,28 +68,26 @@ const getColumns = (label) => [ return {overview}; } }, - filterValue: (row) => row.contrast + "; " + row.studyOverview, + filterValue: row => row.contrast + "; " + row.studyOverview, }, { id: "cellType", label: "Cell type", - renderCell: (row) => row.cellType, - filterValue: (row) => row.cellType, + renderCell: row => row.cellType, + filterValue: row => row.cellType, width: "12%", }, { id: "log2FoldChangeValue", label: "log2 fold change", - renderCell: (row) => - row.log2FoldChangeValue - ? parseFloat(row.log2FoldChangeValue.toFixed(6)) - : naLabel, + renderCell: row => + row.log2FoldChangeValue ? parseFloat(row.log2FoldChangeValue.toFixed(6)) : naLabel, width: "9%", }, { id: "resourceScore", label: "Significance", - renderCell: (row) => { + renderCell: row => { if (row.resourceScore && row.statisticalTestTail) { return ( [ ); } else { - return row.resourceScore - ? parseFloat(row.resourceScore.toFixed(6)) - : naLabel; + return row.resourceScore ? parseFloat(row.resourceScore.toFixed(6)) : naLabel; } }, - filterValue: (row) => row.resourceScore + "; " + row.statisticalTestTail, + filterValue: row => row.resourceScore + "; " + row.statisticalTestTail, width: "9%", }, { id: "projectId", label: "Source", - renderCell: (row) => ( + renderCell: row => ( {sources[row.projectId].name} ), - filterValue: (row) => row.projectId, + filterValue: row => row.projectId, width: "9%", }, { @@ -157,57 +141,59 @@ const getColumns = (label) => [ const exportColumns = [ { label: "disease", - exportValue: (row) => parseDiseaseName(row.diseaseFromSource), + exportValue: row => parseDiseaseName(row.diseaseFromSource), }, { label: "disease id", - exportValue: (row) => row.diseaseFromSourceMappedId, + exportValue: row => row.diseaseFromSourceMappedId, }, { label: "study identifier", - exportValue: (row) => row.studyId, + exportValue: row => row.studyId, }, { label: "contrast", - exportValue: (row) => row.contrast, + exportValue: row => row.contrast, }, { label: "study overview", - exportValue: (row) => row.studyOverview, + exportValue: row => row.studyOverview, }, { label: "cell type", - exportValue: (row) => row.cellType, + exportValue: row => row.cellType, }, { label: "log2 fold change", - exportValue: (row) => row.log2FoldChangeValue, + exportValue: row => row.log2FoldChangeValue, }, { label: "significance", - exportValue: (row) => row.resourceScore, + exportValue: row => row.resourceScore, }, { label: "statistical test tail", - exportValue: (row) => row.statisticalTestTail, + exportValue: row => row.statisticalTestTail, }, { label: "source", - exportValue: (row) => row.projectId, + exportValue: row => row.projectId, }, { label: "publication", - exportValue: (row) => row.literature.join(", "), + exportValue: row => row.literature.join(", "), }, ]; function Body({ id, label, entity }) { const { ensgId, efoId } = id; + const variables = { + ensemblId: ensgId, + efoId, + size: sectionsBaseSizeQuery, + }; const request = useQuery(CRISPR_QUERY, { - variables: { - ensemblId: ensgId, - efoId, - }, + variables, }); const columns = getColumns(label); @@ -218,9 +204,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.affected_pathway} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.CrisprScreenSummary; return ( @@ -236,6 +220,8 @@ function Body({ id, label, entity }) { noWrap={false} noWrapHeader={false} rowsPerPageOptions={defaultRowsPerPageOptions} + query={CRISPR_QUERY.loc.source.body} + variables={variables} /> ); }} diff --git a/packages/sections/src/evidence/CRISPRScreen/CrisprScreenQuery.gql b/packages/sections/src/evidence/CRISPRScreen/CrisprScreenQuery.gql index 96917a43b..61a9c8d1d 100644 --- a/packages/sections/src/evidence/CRISPRScreen/CrisprScreenQuery.gql +++ b/packages/sections/src/evidence/CRISPRScreen/CrisprScreenQuery.gql @@ -1,31 +1,14 @@ -query CrisprScreenQuery($ensemblId: String!, $efoId: String!) { +query CrisprScreenQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id CrisprScreenSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["crispr_screen"] + size: $size ) { count rows { - # disease { - # id - # name - # } - # projectId - # contrast - # studyOverview - # cellType - # cellLineBackground - # crisprScreenLibrary - # statisticalTestTail - # resourceScore - # log2FoldChangeValue - # diseaseCellLines { - # name - # } - # releaseVersion - studyId datatypeId datasourceId diff --git a/packages/sections/src/evidence/CancerBiomarkers/Body.jsx b/packages/sections/src/evidence/CancerBiomarkers/Body.jsx index af5f1d7d8..9dc70ca53 100644 --- a/packages/sections/src/evidence/CancerBiomarkers/Body.jsx +++ b/packages/sections/src/evidence/CancerBiomarkers/Body.jsx @@ -1,16 +1,9 @@ import { useQuery } from "@apollo/client"; import { Typography } from "@mui/material"; -import { - Link, - Tooltip, - SectionItem, - PublicationsDrawer, - DataTable, - TableDrawer, -} from "ui"; +import { Link, Tooltip, SectionItem, PublicationsDrawer, DataTable, TableDrawer } from "ui"; import { naLabel } from "ui/src/constants"; -import { defaultRowsPerPageOptions } from "../../constants"; +import { defaultRowsPerPageOptions, sectionsBaseSizeQuery } from "../../constants"; import { epmcUrl } from "../../utils/urls"; import Description from "./Description"; import BiomarkersDrawer from "./BiomarkersDrawer"; @@ -18,7 +11,7 @@ import { definition } from "."; import CANCER_BIOMARKERS_EVIDENCE_QUERY from "./CancerBiomarkersEvidence.gql"; -const getColumns = (label) => [ +const getColumns = label => [ { id: "disease.name", label: "Disease", @@ -52,16 +45,13 @@ const getColumns = (label) => [ label: "Reported drug", renderCell: ({ drug, drugFromSource }) => drug ? {drug.name} : drugFromSource, - filterValue: ({ drug, drugFromSource }) => - drug ? drug.name : drugFromSource, + filterValue: ({ drug, drugFromSource }) => (drug ? drug.name : drugFromSource), }, { id: "drugResponse.name", label: "Drug response", renderCell: ({ drugResponse }) => - (drugResponse && ( - {drugResponse.name} - )) || + (drugResponse && {drugResponse.name}) || naLabel, }, { @@ -69,7 +59,7 @@ const getColumns = (label) => [ label: "Source", renderCell: ({ confidence, urls }) => { const entries = urls - ? urls.map((url) => ({ + ? urls.map(url => ({ url: url.url, name: url.niceName, group: "Sources", @@ -83,20 +73,14 @@ const getColumns = (label) => [ label: "Literature", renderCell: ({ literature }) => { const entries = literature - ? literature.map((id) => ({ + ? literature.map(id => ({ name: id, url: epmcUrl(id), group: "literature", })) : []; - return ( - - ); + return ; }, }, ]; @@ -107,6 +91,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(CANCER_BIOMARKERS_EVIDENCE_QUERY, { @@ -121,9 +106,7 @@ function Body({ id, label, entity }) { chipText={definition.dataType} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.cancerBiomarkersSummary; return ( diff --git a/packages/sections/src/evidence/CancerBiomarkers/CancerBiomarkersEvidence.gql b/packages/sections/src/evidence/CancerBiomarkers/CancerBiomarkersEvidence.gql index d39a49a2e..a8cf62021 100644 --- a/packages/sections/src/evidence/CancerBiomarkers/CancerBiomarkersEvidence.gql +++ b/packages/sections/src/evidence/CancerBiomarkers/CancerBiomarkersEvidence.gql @@ -1,10 +1,11 @@ -query CancerBiomarkersQuery($ensemblId: String!, $efoId: String!) { +query CancerBiomarkersQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id cancerBiomarkersSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["cancer_biomarkers"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/CancerGeneCensus/Body.jsx b/packages/sections/src/evidence/CancerGeneCensus/Body.jsx index d26ebdcf8..6ac8c12a3 100644 --- a/packages/sections/src/evidence/CancerGeneCensus/Body.jsx +++ b/packages/sections/src/evidence/CancerGeneCensus/Body.jsx @@ -5,7 +5,7 @@ import { v1 } from "uuid"; import { ChipList, Link, SectionItem, PublicationsDrawer, DataTable } from "ui"; -import { naLabel, defaultRowsPerPageOptions } from "../../constants"; +import { naLabel, defaultRowsPerPageOptions, sectionsBaseSizeQuery } from "../../constants"; import { dataTypesMap } from "../../dataTypes"; import Description from "./Description"; import { epmcUrl } from "../../utils/urls"; @@ -15,19 +15,15 @@ import { definition } from "."; import CANCER_GENE_CENSUS_QUERY from "./sectionQuery.gql"; -const samplePercent = (item) => - (item.numberSamplesWithMutationType / item.numberSamplesTested) * 100; +const samplePercent = item => (item.numberSamplesWithMutationType / item.numberSamplesTested) * 100; -const getMaxPercent = (row) => - Math.max(...row.mutatedSamples.map((item) => samplePercent(item))); +const getMaxPercent = row => Math.max(...row.mutatedSamples.map(item => samplePercent(item))); -const getColumns = (label) => [ +const getColumns = label => [ { id: "disease.name", label: "Disease/phenotype", - renderCell: ({ disease }) => ( - {disease.name} - ), + renderCell: ({ disease }) => {disease.name}, }, { id: "mutationType", @@ -40,17 +36,11 @@ const getColumns = (label) => [ .sort((a, b) => samplePercent(b) - samplePercent(a)); return ( - {sortedMutatedSamples.map((mutatedSample) => ( - + {sortedMutatedSamples.map(mutatedSample => ( + {sentenceCase(mutatedSample.functionalConsequence.label)} @@ -61,9 +51,7 @@ const getColumns = (label) => [ }, filterValue: ({ mutatedSamples }) => (mutatedSamples || []) - .map((mutatedSample) => - sentenceCase(mutatedSample.functionalConsequence.label) - ) + .map(mutatedSample => sentenceCase(mutatedSample.functionalConsequence.label)) .join(), }, { @@ -77,18 +65,14 @@ const getColumns = (label) => [ .sort((a, b) => samplePercent(b) - samplePercent(a)); return ( - {sortedMutatedSamples.map((item) => { + {sortedMutatedSamples.map(item => { const percent = samplePercent(item); return ( - {percent < 5 - ? parseFloat(percent.toFixed(2)).toString() - : Math.round(percent)} - % + {percent < 5 ? parseFloat(percent.toFixed(2)).toString() : Math.round(percent)}% - ({item.numberSamplesWithMutationType}/ - {item.numberSamplesTested}) + ({item.numberSamplesWithMutationType}/{item.numberSamplesTested}) ); @@ -116,11 +100,7 @@ const getColumns = (label) => [ }, []) || []; return ( - + ); }, }, @@ -142,6 +122,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(CANCER_GENE_CENSUS_QUERY, { @@ -156,9 +137,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.somatic_mutation} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease: { cancerGeneCensusSummary: { rows }, @@ -168,8 +147,8 @@ function Body({ id, label, entity }) { const roleInCancerItems = hallmarks && hallmarks.attributes.length > 0 ? hallmarks.attributes - .filter((attribute) => attribute.name === "role in cancer") - .map((attribute) => ({ + .filter(attribute => attribute.name === "role in cancer") + .map(attribute => ({ label: attribute.description, url: epmcUrl(attribute.pmid), })) diff --git a/packages/sections/src/evidence/CancerGeneCensus/sectionQuery.gql b/packages/sections/src/evidence/CancerGeneCensus/sectionQuery.gql index 337c211a2..f29268e0f 100644 --- a/packages/sections/src/evidence/CancerGeneCensus/sectionQuery.gql +++ b/packages/sections/src/evidence/CancerGeneCensus/sectionQuery.gql @@ -1,10 +1,11 @@ -query CancerGeneCensusQuery($ensemblId: String!, $efoId: String!) { +query CancerGeneCensusQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id cancerGeneCensusSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["cancer_gene_census"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/ClinGen/Body.jsx b/packages/sections/src/evidence/ClinGen/Body.jsx index 7d9283325..80bac0377 100644 --- a/packages/sections/src/evidence/ClinGen/Body.jsx +++ b/packages/sections/src/evidence/ClinGen/Body.jsx @@ -1,7 +1,7 @@ import { useQuery } from "@apollo/client"; import { Typography } from "@mui/material"; import { Link, Tooltip, SectionItem, DataTable } from "ui"; -import { defaultRowsPerPageOptions, naLabel } from "../../constants"; +import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants"; import { dataTypesMap } from "../../dataTypes"; import Description from "./Description"; import { definition } from "."; @@ -45,7 +45,7 @@ const columns = [ listStyle: "none", }} > - {allelicRequirements.map((allelicRequirement) => ( + {allelicRequirements.map(allelicRequirement => (
  • {allelicRequirement}
  • ))} @@ -62,10 +62,7 @@ const columns = [ title={ As defined by the{" "} - + GenCC Guidelines @@ -90,6 +87,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(CLINGEN_QUERY, { @@ -102,9 +100,7 @@ function Body({ id, label, entity }) { entity={entity} chipText={dataTypesMap.genetic_association} request={request} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.clingenSummary; return ( diff --git a/packages/sections/src/evidence/ClinGen/ClingenQuery.gql b/packages/sections/src/evidence/ClinGen/ClingenQuery.gql index 1f32a4535..b07bc5033 100644 --- a/packages/sections/src/evidence/ClinGen/ClingenQuery.gql +++ b/packages/sections/src/evidence/ClinGen/ClingenQuery.gql @@ -1,10 +1,11 @@ -query ClingenQuery($ensemblId: String!, $efoId: String!) { +query ClingenQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id clingenSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["clingen"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/ExpressionAtlas/Body.jsx b/packages/sections/src/evidence/ExpressionAtlas/Body.jsx index 1992658da..7f414c51a 100644 --- a/packages/sections/src/evidence/ExpressionAtlas/Body.jsx +++ b/packages/sections/src/evidence/ExpressionAtlas/Body.jsx @@ -10,6 +10,7 @@ import { sentenceCase } from "../../utils/global"; import EXPRESSION_ATLAS_QUERY from "./ExpressionAtlasQuery.gql"; import { definition } from "."; +import { sectionsBaseSizeQuery } from "../../constants"; const columns = [ { @@ -93,9 +94,7 @@ const columns = [ p-value ), - renderCell: ({ resourceScore }) => ( - - ), + renderCell: ({ resourceScore }) => , numeric: true, sortable: true, }, @@ -106,6 +105,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(EXPRESSION_ATLAS_QUERY, { @@ -118,9 +118,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.rna_expression} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.expressionAtlasSummary; return ( diff --git a/packages/sections/src/evidence/ExpressionAtlas/ExpressionAtlasQuery.gql b/packages/sections/src/evidence/ExpressionAtlas/ExpressionAtlasQuery.gql index 7c9e3e552..59739687e 100644 --- a/packages/sections/src/evidence/ExpressionAtlas/ExpressionAtlasQuery.gql +++ b/packages/sections/src/evidence/ExpressionAtlas/ExpressionAtlasQuery.gql @@ -1,10 +1,11 @@ -query ExpressionAtlasQuery($ensemblId: String!, $efoId: String!) { +query ExpressionAtlasQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id expressionAtlasSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["expression_atlas"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/Gene2Phenotype/Body.jsx b/packages/sections/src/evidence/Gene2Phenotype/Body.jsx index fb8940ffa..2cf895e2f 100644 --- a/packages/sections/src/evidence/Gene2Phenotype/Body.jsx +++ b/packages/sections/src/evidence/Gene2Phenotype/Body.jsx @@ -3,7 +3,7 @@ import { useQuery } from "@apollo/client"; import { v1 } from "uuid"; import { SectionItem, Tooltip, Link, PublicationsDrawer, DataTable } from "ui"; -import { defaultRowsPerPageOptions, naLabel } from "../../constants"; +import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants"; import Description from "./Description"; import { epmcUrl } from "../../utils/urls"; import { dataTypesMap } from "../../dataTypes"; @@ -14,7 +14,7 @@ import { definition } from "."; const g2pUrl = (studyId, symbol) => `https://www.ebi.ac.uk/gene2phenotype/search?panel=${studyId}&search_term=${symbol}`; -const getColumns = (label) => [ +const getColumns = label => [ { id: "disease.name", label: "Disease/phenotype", @@ -60,7 +60,7 @@ const getColumns = (label) => [ if (allelicRequirements && allelicRequirements.length > 1) { return ( - {allelicRequirements.map((item) => ( + {allelicRequirements.map(item => ( {item} ))} @@ -92,10 +92,7 @@ const getColumns = (label) => [ title={ As defined by the{" "} - + GenCC Guidelines @@ -113,25 +110,19 @@ const getColumns = (label) => [ label: "Literature", renderCell: ({ literature }) => { const entries = literature - ? literature.map((id) => ({ + ? literature.map(id => ({ name: id, url: epmcUrl(id), group: "literature", })) : []; - return ( - - ); + return ; }, }, ]; function Body({ id: { ensgId, efoId }, label: { symbol, name }, entity }) { - const variables = { ensemblId: ensgId, efoId }; + const variables = { ensemblId: ensgId, efoId, size: sectionsBaseSizeQuery }; const request = useQuery(OPEN_TARGETS_GENETICS_QUERY, { variables, @@ -146,7 +137,7 @@ function Body({ id: { ensgId, efoId }, label: { symbol, name }, entity }) { request={request} entity={entity} renderDescription={() => } - renderBody={(data) => ( + renderBody={data => ( { }; const getSourceLink = (project, targetId) => { - if (project === "Epi25 collaborative") - return `https://epi25.broadinstitute.org/gene/${targetId}`; + if (project === "Epi25 collaborative") return `https://epi25.broadinstitute.org/gene/${targetId}`; if (project === "Autism Sequencing Consortiuml") return `https://asc.broadinstitute.org/gene/${targetId}`; - if (project === "SCHEMA consortium") - return `https://schema.broadinstitute.org/gene/${targetId}`; + if (project === "SCHEMA consortium") return `https://schema.broadinstitute.org/gene/${targetId}`; if (project === "Genebass") return `https://app.genebass.org/gene/${targetId}?burdenSet=pLoF&phewasOpts=1&resultLayout=full`; if (project === "AstraZeneca PheWAS Portal") return `https://azphewas.com`; return ""; }; -const getColumns = (label) => [ +const getColumns = label => [ { id: "disease.name", label: "Disease/phenotype", @@ -145,9 +136,7 @@ const getColumns = (label) => [ numeric: true, sortable: true, renderCell: ({ studySampleSize }) => - studySampleSize - ? parseInt(studySampleSize, 10).toLocaleString() - : naLabel, + studySampleSize ? parseInt(studySampleSize, 10).toLocaleString() : naLabel, }, { id: "oddsRatio", @@ -161,9 +150,9 @@ const getColumns = (label) => [ }) => { const ci = oddsRatioConfidenceIntervalLower && oddsRatioConfidenceIntervalUpper - ? `(${parseFloat( - oddsRatioConfidenceIntervalLower.toFixed(3) - )}, ${parseFloat(oddsRatioConfidenceIntervalUpper.toFixed(3))})` + ? `(${parseFloat(oddsRatioConfidenceIntervalLower.toFixed(3))}, ${parseFloat( + oddsRatioConfidenceIntervalUpper.toFixed(3) + )})` : ""; return oddsRatio ? `${parseFloat(oddsRatio.toFixed(3))} ${ci}` : naLabel; }, @@ -179,24 +168,16 @@ const getColumns = (label) => [ label: "Beta (CI 95%)", numeric: true, sortable: true, - renderCell: ({ - beta, - betaConfidenceIntervalLower, - betaConfidenceIntervalUpper, - }) => { + renderCell: ({ beta, betaConfidenceIntervalLower, betaConfidenceIntervalUpper }) => { const ci = betaConfidenceIntervalLower && betaConfidenceIntervalUpper - ? `(${parseFloat( - betaConfidenceIntervalLower.toFixed(3) - )}, ${parseFloat(betaConfidenceIntervalUpper.toFixed(3))})` + ? `(${parseFloat(betaConfidenceIntervalLower.toFixed(3))}, ${parseFloat( + betaConfidenceIntervalUpper.toFixed(3) + )})` : ""; return beta ? `${parseFloat(beta.toFixed(3))} ${ci}` : naLabel; }, - filterValue: ({ - beta, - betaConfidenceIntervalLower, - betaConfidenceIntervalUpper, - }) => + filterValue: ({ beta, betaConfidenceIntervalLower, betaConfidenceIntervalUpper }) => `${beta} ${betaConfidenceIntervalLower} ${betaConfidenceIntervalUpper} ${naLabel}`, }, { @@ -211,33 +192,24 @@ const getColumns = (label) => [ renderCell: ({ pValueMantissa, pValueExponent }) => ( ), - filterValue: ({ pValueMantissa, pValueExponent }) => - `${pValueMantissa} ${pValueExponent}`, - exportValue: ({ pValueMantissa, pValueExponent }) => - `${pValueMantissa}x10${pValueExponent}`, + filterValue: ({ pValueMantissa, pValueExponent }) => `${pValueMantissa} ${pValueExponent}`, + exportValue: ({ pValueMantissa, pValueExponent }) => `${pValueMantissa}x10${pValueExponent}`, comparator: (a, b) => - a.pValueMantissa * 10 ** a.pValueExponent - - b.pValueMantissa * 10 ** b.pValueExponent, + a.pValueMantissa * 10 ** a.pValueExponent - b.pValueMantissa * 10 ** b.pValueExponent, }, { id: "literature", label: "Literature", renderCell: ({ literature }) => { const entries = literature - ? literature.map((id) => ({ + ? literature.map(id => ({ name: id, url: epmcUrl(id), group: "literature", })) : []; - return ( - - ); + return ; }, }, ]; @@ -247,6 +219,7 @@ export function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(GENE_BURDEN_QUERY, { @@ -261,9 +234,7 @@ export function Body({ id, label, entity }) { chipText={dataTypesMap.genetic_association} entity={entity} request={request} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.geneBurdenSummary; return ( diff --git a/packages/sections/src/evidence/GeneBurden/GeneBurdenQuery.gql b/packages/sections/src/evidence/GeneBurden/GeneBurdenQuery.gql index bc1a8b87e..504db65c3 100644 --- a/packages/sections/src/evidence/GeneBurden/GeneBurdenQuery.gql +++ b/packages/sections/src/evidence/GeneBurden/GeneBurdenQuery.gql @@ -1,10 +1,11 @@ -query GeneBurdenQuery($ensemblId: String!, $efoId: String!) { +query GeneBurdenQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id geneBurdenSummary: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["gene_burden"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/GenomicsEngland/Body.jsx b/packages/sections/src/evidence/GenomicsEngland/Body.jsx index d57f9ab23..6cbcb5a44 100644 --- a/packages/sections/src/evidence/GenomicsEngland/Body.jsx +++ b/packages/sections/src/evidence/GenomicsEngland/Body.jsx @@ -1,15 +1,12 @@ import { useQuery } from "@apollo/client"; -import { - faCheckSquare, - faExclamationTriangle, -} from "@fortawesome/free-solid-svg-icons"; +import { faCheckSquare, faExclamationTriangle } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Typography } from "@mui/material"; import { v1 } from "uuid"; import { Tooltip, SectionItem, Link, PublicationsDrawer, DataTable } from "ui"; import { definition } from "."; -import { defaultRowsPerPageOptions, naLabel } from "../../constants"; +import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants"; import Description from "./Description"; import { epmcUrl } from "../../utils/urls"; import { sentenceCase } from "../../utils/global"; @@ -20,40 +17,35 @@ import GENOMICS_ENGLAND_QUERY from "./sectionQuery.gql"; const geUrl = (id, approvedSymbol) => `https://panelapp.genomicsengland.co.uk/panels/${id}/gene/${approvedSymbol}`; -const confidenceCaption = (confidence) => +const confidenceCaption = confidence => ({ green: ( - {" "} - {sentenceCase(confidence)} + {sentenceCase(confidence)} ), amber: ( - {" "} - {sentenceCase(confidence)} + {sentenceCase(confidence)} ), }[confidence]); -const confidenceMap = (confidence) => +const confidenceMap = confidence => ({ green: 20, amber: 10, }[confidence.toLowerCase()] || 0); -const allelicRequirementsCaption = (allelicRequirements) => { - const caption = sentenceCase( - allelicRequirements.split(" ", 1)[0].replace(/[;:,]*/g, "") - ); +const allelicRequirementsCaption = allelicRequirements => { + const caption = sentenceCase(allelicRequirements.split(" ", 1)[0].replace(/[;:,]*/g, "")); const description = - allelicRequirements.split(" ").slice(1).join(" ") || - "No more information available"; + allelicRequirements.split(" ").slice(1).join(" ") || "No more information available"; return [caption, description]; }; -const getColumns = (label) => [ +const getColumns = label => [ { id: "disease", label: "Disease/phenotype", @@ -64,12 +56,7 @@ const getColumns = (label) => [ Reported disease or phenotype: - + {sentenceCase(diseaseFromSource)} @@ -79,7 +66,7 @@ const getColumns = (label) => [ All reported phenotypes: - {cohortPhenotypes.map((cp) => ( + {cohortPhenotypes.map(cp => (
    {cp}
    ))}
    @@ -94,24 +81,18 @@ const getColumns = (label) => [ {disease.name}
    ), - filterValue: ({ disease, diseaseFromSource }) => - [disease.name, diseaseFromSource].join(), + filterValue: ({ disease, diseaseFromSource }) => [disease.name, diseaseFromSource].join(), }, { id: "allelicRequirements", label: "Allelic Requirement", renderCell: ({ allelicRequirements }) => allelicRequirements - ? allelicRequirements.map((item) => { + ? allelicRequirements.map(item => { const [caption, description] = allelicRequirementsCaption(item); return ( - + {caption} ); @@ -139,10 +120,7 @@ const getColumns = (label) => [ title={ As defined by the{" "} - + Panel App Guidelines @@ -152,8 +130,7 @@ const getColumns = (label) => [ {confidenceCaption(confidence)} ), - comparator: (a, b) => - confidenceMap(a.confidence) - confidenceMap(b.confidence), + comparator: (a, b) => confidenceMap(a.confidence) - confidenceMap(b.confidence), }, { id: "literature", @@ -173,11 +150,7 @@ const getColumns = (label) => [ }, []) || []; return ( - + ); }, }, @@ -188,6 +161,7 @@ export function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(GENOMICS_ENGLAND_QUERY, { @@ -202,10 +176,8 @@ export function Body({ id, label, entity }) { chipText={dataTypesMap.genetic_association} request={request} entity={entity} - renderDescription={() => ( - - )} - renderBody={(data) => ( + renderDescription={() => } + renderBody={data => ( `https://www.intogen.org/search?gene=${approvedSymbol}&cohort=${id}`; -const samplePercent = (item) => - (item.numberMutatedSamples / item.numberSamplesTested) * 100; +const samplePercent = item => (item.numberMutatedSamples / item.numberSamplesTested) * 100; const columns = [ { @@ -47,8 +39,7 @@ const columns = [ {disease.name} ), - filterValue: ({ disease, diseaseFromSource }) => - [disease.name, diseaseFromSource].join(), + filterValue: ({ disease, diseaseFromSource }) => [disease.name, diseaseFromSource].join(), }, { id: "mutatedSamples", @@ -58,15 +49,12 @@ const columns = [ {mutatedSamples .sort((a, b) => samplePercent(b) - samplePercent(a)) - .map((item) => { + .map(item => { const percent = samplePercent(item); return ( - {percent < 5 - ? parseFloat(percent.toFixed(2)).toString() - : Math.round(percent)} - % + {percent < 5 ? parseFloat(percent.toFixed(2)).toString() : Math.round(percent)}% ({item.numberMutatedSamples}/{item.numberSamplesTested}) @@ -95,20 +83,17 @@ const columns = [ ), numeric: true, sortable: true, - renderCell: ({ resourceScore }) => ( - - ), + renderCell: ({ resourceScore }) => , }, { id: "significantDriverMethods", label: "Cancer driver methods", tooltip: ( <> - The current version of the intOGen pipeline uses seven methods to - identify cancer driver genes from somatic point mutations - HotMAPS, - dNDScv, smRegions, CBaSE, FML, MutPanning, and CLUSTL. The pipeline also - uses a combination of methods. For further information on the methods, - please{" "} + The current version of the intOGen pipeline uses seven methods to identify cancer driver + genes from somatic point mutations - HotMAPS, dNDScv, smRegions, CBaSE, FML, MutPanning, and + CLUSTL. The pipeline also uses a combination of methods. For further information on the + methods, please{" "} click here {" "} @@ -118,7 +103,7 @@ const columns = [ renderCell: ({ significantDriverMethods }) => significantDriverMethods ? ( ({ + items={significantDriverMethods.map(am => ({ label: am, tooltip: (methods[am] || {}).description, }))} @@ -126,18 +111,12 @@ const columns = [ ) : ( naLabel ), - filterValue: ({ significantDriverMethods }) => - significantDriverMethods.map((am) => am).join(), + filterValue: ({ significantDriverMethods }) => significantDriverMethods.map(am => am).join(), }, { id: "cohortShortName", label: "Cohort Information", - renderCell: ({ - cohortId, - cohortShortName, - cohortDescription, - target: { approvedSymbol }, - }) => + renderCell: ({ cohortId, cohortShortName, cohortDescription, target: { approvedSymbol } }) => cohortShortName && cohortDescription ? ( <> @@ -169,6 +148,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(INTOGEN_QUERY, { @@ -181,9 +161,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.somatic_mutation} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease: { intOgen: { rows }, @@ -193,8 +171,8 @@ function Body({ id, label, entity }) { const roleInCancerItems = hallmarks && hallmarks.attributes.length > 0 ? hallmarks.attributes - .filter((attribute) => attribute.name === "role in cancer") - .map((attribute) => ({ + .filter(attribute => attribute.name === "role in cancer") + .map(attribute => ({ label: attribute.description, url: epmcUrl(attribute.pmid), })) diff --git a/packages/sections/src/evidence/IntOgen/sectionQuery.gql b/packages/sections/src/evidence/IntOgen/sectionQuery.gql index 933c759a0..0667bf59a 100644 --- a/packages/sections/src/evidence/IntOgen/sectionQuery.gql +++ b/packages/sections/src/evidence/IntOgen/sectionQuery.gql @@ -1,10 +1,11 @@ -query IntOgenQuery($ensemblId: String!, $efoId: String!) { +query IntOgenQuery($ensemblId: String!, $efoId: String!, $size: Int!) { disease(efoId: $efoId) { id intOgen: evidences( ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["intogen"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/OTGenetics/Body.jsx b/packages/sections/src/evidence/OTGenetics/Body.jsx index 21d6207ec..598cf7675 100644 --- a/packages/sections/src/evidence/OTGenetics/Body.jsx +++ b/packages/sections/src/evidence/OTGenetics/Body.jsx @@ -12,6 +12,7 @@ import { import { defaultRowsPerPageOptions, naLabel, + sectionsBaseSizeQuery, studySourceMap, variantConsequenceSource, } from "../../constants"; @@ -27,9 +28,7 @@ function getColumns(label) { { id: "disease", label: "Disease/phenotype", - renderCell: ({ disease }) => ( - {disease.name} - ), + renderCell: ({ disease }) => {disease.name}, filterValue: ({ disease }) => disease.name, }, { @@ -97,8 +96,7 @@ function getColumns(label) { ) : null} ), - filterValue: ({ variantId, variantRsId }) => - `${variantId} ${variantRsId}`, + filterValue: ({ variantId, variantRsId }) => `${variantId} ${variantRsId}`, }, { id: "variantConsequence", @@ -116,22 +114,14 @@ function getColumns(label) { label={variantConsequenceSource.VEP.label} value={sentenceCase(variantFunctionalConsequence.label)} tooltip={variantConsequenceSource.VEP.tooltip} - to={identifiersOrgLink( - "SO", - variantFunctionalConsequence.id.slice(3) - )} + to={identifiersOrgLink("SO", variantFunctionalConsequence.id.slice(3))} /> )} {variantFunctionalConsequenceFromQtlId && ( )} @@ -160,8 +150,7 @@ function getColumns(label) { ), comparator: (a, b) => - a.pValueMantissa * 10 ** a.pValueExponent - - b.pValueMantissa * 10 ** b.pValueExponent, + a.pValueMantissa * 10 ** a.pValueExponent - b.pValueMantissa * 10 ** b.pValueExponent, }, { id: "studySampleSize", @@ -169,9 +158,7 @@ function getColumns(label) { numeric: true, sortable: true, renderCell: ({ studySampleSize }) => - studySampleSize - ? parseInt(studySampleSize, 10).toLocaleString() - : naLabel, + studySampleSize ? parseInt(studySampleSize, 10).toLocaleString() : naLabel, }, { id: "oddsRatio", @@ -184,29 +171,23 @@ function getColumns(label) { }) => { const ci = oddsRatioConfidenceIntervalLower && oddsRatioConfidenceIntervalUpper - ? `(${parseFloat( - oddsRatioConfidenceIntervalLower.toFixed(3) - )}, ${parseFloat(oddsRatioConfidenceIntervalUpper.toFixed(3))})` + ? `(${parseFloat(oddsRatioConfidenceIntervalLower.toFixed(3))}, ${parseFloat( + oddsRatioConfidenceIntervalUpper.toFixed(3) + )})` : ""; - return oddsRatio - ? `${parseFloat(oddsRatio.toFixed(3))} ${ci}` - : naLabel; + return oddsRatio ? `${parseFloat(oddsRatio.toFixed(3))} ${ci}` : naLabel; }, }, { id: "betaConfidenceInterval", label: "Beta (CI 95%)", numeric: true, - renderCell: ({ - beta, - betaConfidenceIntervalLower, - betaConfidenceIntervalUpper, - }) => { + renderCell: ({ beta, betaConfidenceIntervalLower, betaConfidenceIntervalUpper }) => { const ci = betaConfidenceIntervalLower && betaConfidenceIntervalUpper - ? `(${parseFloat( - betaConfidenceIntervalLower.toFixed(3) - )}, ${parseFloat(betaConfidenceIntervalUpper.toFixed(3))})` + ? `(${parseFloat(betaConfidenceIntervalLower.toFixed(3))}, ${parseFloat( + betaConfidenceIntervalUpper.toFixed(3) + )})` : ""; return beta ? `${parseFloat(beta.toFixed(3))} ${ci}` : naLabel; }, @@ -235,7 +216,7 @@ function getColumns(label) { function Body({ id, label, entity }) { const { ensgId, efoId } = id; - const variables = { ensemblId: ensgId, efoId }; + const variables = { ensemblId: ensgId, efoId, size: sectionsBaseSizeQuery }; const columns = getColumns(label); const request = useQuery(OPEN_TARGETS_GENETICS_QUERY, { @@ -248,10 +229,8 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.genetic_association} request={request} entity={entity} - renderDescription={() => ( - - )} - renderBody={(data) => ( + renderDescription={() => } + renderBody={data => ( [ +const getColumns = label => [ { id: "disease.name", label: "Disease/phenotype", @@ -88,11 +88,7 @@ const getColumns = (label) => [ }, []) || []; return ( - + ); }, }, @@ -101,43 +97,43 @@ const getColumns = (label) => [ const exportColumns = [ { label: "Disease", - exportValue: (row) => row.disease.name, + exportValue: row => row.disease.name, }, { label: "Disease ID", - exportValue: (row) => row.disease.id, + exportValue: row => row.disease.id, }, { label: "Disease from source", - exportValue: (row) => row.diseaseFromSource, + exportValue: row => row.diseaseFromSource, }, { label: "Target from source", - exportValue: (row) => row.targetFromSource, + exportValue: row => row.targetFromSource, }, { label: "Target from source ID", - exportValue: (row) => row.targetFromSourceId, + exportValue: row => row.targetFromSourceId, }, { label: "Allele origins", - exportValue: (row) => row.alleleOrigins.join("; "), + exportValue: row => row.alleleOrigins.join("; "), }, { label: "Functional consequence", - exportValue: (row) => sentenceCase(row.variantFunctionalConsequence.label), + exportValue: row => sentenceCase(row.variantFunctionalConsequence.label), }, { label: "Functional consequence ID", - exportValue: (row) => row.variantFunctionalConsequence.id, + exportValue: row => row.variantFunctionalConsequence.id, }, { label: "Confidence", - exportValue: (row) => row.confidence, + exportValue: row => row.confidence, }, { label: "Publication IDs", - exportValue: (row) => row.literature.join(", "), + exportValue: row => row.literature.join(", "), }, ]; @@ -147,6 +143,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(ORPHANET_QUERY, { @@ -161,9 +158,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.genetic_association} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.orphanetSummary; return ( diff --git a/packages/sections/src/evidence/Orphanet/OrphanetQuery.gql b/packages/sections/src/evidence/Orphanet/OrphanetQuery.gql index 3ad31c22d..fbd6d03d8 100644 --- a/packages/sections/src/evidence/Orphanet/OrphanetQuery.gql +++ b/packages/sections/src/evidence/Orphanet/OrphanetQuery.gql @@ -1,4 +1,4 @@ -query OrphanetQuery($ensemblId: String!, $efoId: String!) { +query OrphanetQuery($ensemblId: String!, $efoId: String!, $size: Int!) { target(ensemblId: $ensemblId) { approvedSymbol } @@ -8,6 +8,7 @@ query OrphanetQuery($ensemblId: String!, $efoId: String!) { ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["orphanet"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/Progeny/Body.jsx b/packages/sections/src/evidence/Progeny/Body.jsx index b4a72e028..ee672ec89 100644 --- a/packages/sections/src/evidence/Progeny/Body.jsx +++ b/packages/sections/src/evidence/Progeny/Body.jsx @@ -7,9 +7,9 @@ import Description from "./Description"; import PROGENY_QUERY from "./sectionQuery.gql"; import { dataTypesMap } from "../../dataTypes"; import { sentenceCase } from "../../utils/global"; -import { defaultRowsPerPageOptions, naLabel } from "../../constants"; +import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants"; -const reactomeUrl = (id) => `https://identifiers.org/reactome:${id}`; +const reactomeUrl = id => `https://identifiers.org/reactome:${id}`; const columns = [ { @@ -32,8 +32,7 @@ const columns = [ {disease.name} ), - filterValue: ({ disease, diseaseFromSource }) => - [disease.name, diseaseFromSource].join(), + filterValue: ({ disease, diseaseFromSource }) => [disease.name, diseaseFromSource].join(), }, { id: "pathwayName", @@ -56,9 +55,7 @@ const columns = [ ), numeric: true, sortable: true, - renderCell: ({ resourceScore }) => ( - - ), + renderCell: ({ resourceScore }) => , }, ]; @@ -68,6 +65,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(PROGENY_QUERY, { @@ -80,10 +78,8 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.affected_pathway} request={request} entity={entity} - renderDescription={() => ( - - )} - renderBody={(data) => ( + renderDescription={() => } + renderBody={data => ( [ +const getColumns = label => [ { id: "disease.name", label: "Disease / phenotype", @@ -52,15 +52,12 @@ const getColumns = (label) => [ } if (pathways.length === 1) { return ( - + {pathways[0].name} ); } - const refs = pathways.map((p) => ({ + const refs = pathways.map(p => ({ url: `http://www.reactome.org/PathwayBrowser/#${p.id}`, name: p.name, group: "Pathways", @@ -83,10 +80,7 @@ const getColumns = (label) => [ id: "targetFromSourceId", label: "Reported target", renderCell: ({ targetFromSourceId }) => ( - + {targetFromSourceId} ), @@ -96,18 +90,14 @@ const getColumns = (label) => [ id: "targetModulation", label: "Target modulation", renderCell: ({ targetModulation }) => - targetModulation ? ( - {sentenceCase(targetModulation)} - ) : ( - naLabel - ), + targetModulation ? {sentenceCase(targetModulation)} : naLabel, filterValue: ({ targetModulation }) => sentenceCase(targetModulation), width: "12%", }, { filterValue: ({ variantAminoacidDescriptions }) => variantAminoacidDescriptions - ?.map((variantAminoacidDescription) => variantAminoacidDescription) + ?.map(variantAminoacidDescription => variantAminoacidDescription) .join(), label: "Amino acid variation", renderCell: ({ variantAminoacidDescriptions }) => { @@ -117,7 +107,7 @@ const getColumns = (label) => [ if (variantAminoacidDescriptions?.length > 1) { return ( ({ + entries={variantAminoacidDescriptions.map(d => ({ name: d, group: "Amino acid variation", }))} @@ -133,7 +123,7 @@ const getColumns = (label) => [ label: "Literature", renderCell: ({ literature = [] }) => { const literatureList = []; - literature?.forEach((id) => { + literature?.forEach(id => { if (id !== "NA") { literatureList.push({ name: id, @@ -143,11 +133,7 @@ const getColumns = (label) => [ } }); return ( - + ); }, width: "12%", @@ -160,6 +146,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(REACTOME_QUERY, { @@ -174,9 +161,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.affected_pathway} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.reactomeSummary; return ( diff --git a/packages/sections/src/evidence/Reactome/sectionQuery.gql b/packages/sections/src/evidence/Reactome/sectionQuery.gql index b4c195b78..3dcc47d62 100644 --- a/packages/sections/src/evidence/Reactome/sectionQuery.gql +++ b/packages/sections/src/evidence/Reactome/sectionQuery.gql @@ -1,4 +1,4 @@ -query reactomeQuery($ensemblId: String!, $efoId: String!) { +query reactomeQuery($ensemblId: String!, $efoId: String!, $size: Int!) { target(ensemblId: $ensemblId) { approvedSymbol } @@ -8,6 +8,7 @@ query reactomeQuery($ensemblId: String!, $efoId: String!) { ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["reactome"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/SlapEnrich/Body.jsx b/packages/sections/src/evidence/SlapEnrich/Body.jsx index afa80f7c5..4ba922f61 100644 --- a/packages/sections/src/evidence/SlapEnrich/Body.jsx +++ b/packages/sections/src/evidence/SlapEnrich/Body.jsx @@ -7,9 +7,9 @@ import Description from "./Description"; import { dataTypesMap } from "../../dataTypes"; import SLAPENRICH_QUERY from "./sectionQuery.gql"; import { sentenceCase } from "../../utils/global"; -import { defaultRowsPerPageOptions, naLabel } from "../../constants"; +import { defaultRowsPerPageOptions, naLabel, sectionsBaseSizeQuery } from "../../constants"; -const reactomeUrl = (id) => `https://identifiers.org/reactome:${id}`; +const reactomeUrl = id => `https://identifiers.org/reactome:${id}`; const columns = [ { @@ -32,8 +32,7 @@ const columns = [ {disease.name} ), - filterValue: ({ disease, diseaseFromSource }) => - [disease.name, diseaseFromSource].join(), + filterValue: ({ disease, diseaseFromSource }) => [disease.name, diseaseFromSource].join(), }, { id: "pathwayName", @@ -56,9 +55,7 @@ const columns = [ ), numeric: true, sortable: true, - renderCell: ({ resourceScore }) => ( - - ), + renderCell: ({ resourceScore }) => , }, ]; @@ -67,6 +64,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(SLAPENRICH_QUERY, { @@ -79,10 +77,8 @@ function Body({ id, label, entity }) { entity={entity} chipText={dataTypesMap.affected_pathway} request={request} - renderDescription={() => ( - - )} - renderBody={(data) => ( + renderDescription={() => } + renderBody={data => ( [ +const getColumns = label => [ { id: "disease", label: "Disease/phenotype", - renderCell: ({ disease }) => ( - {disease.name} - ), + renderCell: ({ disease }) => {disease.name}, filterValue: ({ disease }) => disease.name, }, { @@ -49,11 +47,7 @@ const getColumns = (label) => [ return acc; }, []) || []; return ( - + ); }, }, @@ -65,6 +59,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(SYSBIO_QUERY, { @@ -79,10 +74,8 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.affected_pathway} request={request} entity={entity} - renderDescription={() => ( - - )} - renderBody={(data) => ( + renderDescription={() => } + renderBody={data => ( [ +const getcolumns = label => [ { id: "disease.name", label: "Disease/phenotype", @@ -62,11 +62,7 @@ const getcolumns = (label) => [ }, []) || []; return ( - + ); }, }, @@ -78,6 +74,7 @@ function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const request = useQuery(UNIPROT_LITERATURE_QUERY, { @@ -92,9 +89,7 @@ function Body({ id, label, entity }) { chipText={dataTypesMap.genetic_association} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.uniprotLiteratureSummary; return ( diff --git a/packages/sections/src/evidence/UniProtLiterature/UniprotLiteratureQuery.gql b/packages/sections/src/evidence/UniProtLiterature/UniprotLiteratureQuery.gql index 07d9cf501..f1bf484ad 100644 --- a/packages/sections/src/evidence/UniProtLiterature/UniprotLiteratureQuery.gql +++ b/packages/sections/src/evidence/UniProtLiterature/UniprotLiteratureQuery.gql @@ -1,4 +1,4 @@ -query UniprotLiteratureQuery($ensemblId: String!, $efoId: String!) { +query UniprotLiteratureQuery($ensemblId: String!, $efoId: String!, $size: Int!) { target(ensemblId: $ensemblId) { approvedSymbol } @@ -8,6 +8,7 @@ query UniprotLiteratureQuery($ensemblId: String!, $efoId: String!) { ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["uniprot_literature"] + size: $size ) { count rows { diff --git a/packages/sections/src/evidence/UniProtVariants/Body.jsx b/packages/sections/src/evidence/UniProtVariants/Body.jsx index 5b8ffe00d..d426f4da8 100644 --- a/packages/sections/src/evidence/UniProtVariants/Body.jsx +++ b/packages/sections/src/evidence/UniProtVariants/Body.jsx @@ -1,13 +1,6 @@ import { useQuery } from "@apollo/client"; import { Typography } from "@mui/material"; -import { - Link, - SectionItem, - Tooltip, - PublicationsDrawer, - LabelChip, - DataTable, -} from "ui"; +import { Link, SectionItem, Tooltip, PublicationsDrawer, LabelChip, DataTable } from "ui"; import { definition } from "."; @@ -18,6 +11,7 @@ import { identifiersOrgLink } from "../../utils/global"; import { defaultRowsPerPageOptions, variantConsequenceSource, + sectionsBaseSizeQuery, } from "../../constants"; import UNIPROT_VARIANTS_QUERY from "./UniprotVariantsQuery.gql"; @@ -98,11 +92,7 @@ function getColumns(label) { }, []) || []; return ( - + ); }, }, @@ -115,6 +105,7 @@ export function Body({ id, label, entity }) { const variables = { ensemblId: ensgId, efoId, + size: sectionsBaseSizeQuery, }; const columns = getColumns(label); @@ -128,9 +119,7 @@ export function Body({ id, label, entity }) { chipText={dataTypesMap.genetic_association} request={request} entity={entity} - renderDescription={() => ( - - )} + renderDescription={() => } renderBody={({ disease }) => { const { rows } = disease.uniprotVariantsSummary; return ( diff --git a/packages/sections/src/evidence/UniProtVariants/UniprotVariantsQuery.gql b/packages/sections/src/evidence/UniProtVariants/UniprotVariantsQuery.gql index bd82ce17f..f4682456b 100644 --- a/packages/sections/src/evidence/UniProtVariants/UniprotVariantsQuery.gql +++ b/packages/sections/src/evidence/UniProtVariants/UniprotVariantsQuery.gql @@ -1,4 +1,4 @@ -query UniprotVariantsQuery($ensemblId: String!, $efoId: String!) { +query UniprotVariantsQuery($ensemblId: String!, $efoId: String!, $size: Int!) { target(ensemblId: $ensemblId) { approvedSymbol } @@ -8,6 +8,7 @@ query UniprotVariantsQuery($ensemblId: String!, $efoId: String!) { ensemblIds: [$ensemblId] enableIndirect: true datasourceIds: ["uniprot_variants"] + size: $size ) { count rows {