From 61c2f85b0044033e0ee830c7f27a079529dfdea9 Mon Sep 17 00:00:00 2001 From: Michael Baudis Date: Fri, 20 Sep 2024 10:36:55 +0200 Subject: [PATCH] collation links - e.g. getting rid of "method" => deliveryKeys where needed --- docs/use-cases.md | 20 +++++++++---------- src/components/SubsetsHierarchyLoader.js | 2 +- .../formShared/GenespanUtilities.js | 2 +- .../searchForm/BiosamplesSearchForm.js | 2 +- src/hooks/api.js | 19 +++++++++--------- src/pages/index.js | 4 ++-- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/docs/use-cases.md b/docs/use-cases.md index df3ae3fc..c58ca544 100644 --- a/docs/use-cases.md +++ b/docs/use-cases.md @@ -89,8 +89,8 @@ queries and may lead to a time-out. ![Example query-based CNV histogram](http://progenetix.org/services/sampleplots/?referenceName=9&variantType=EFO:0030067&start=21500000&start=21975098&end=21967753&end=22500000&filters=NCIT:C3058&filters=pgx:cohort-celllines&output=histoplot) -* [progenetix.org/services/sampleplots/?referenceName=9&variantType=EFO:0030067&start=21500000&start=21975098&end=21967753&end=22500000&filters=NCIT:C3058&filters=pgx:cohort-celllines&output=histoplot](http://progenetix.org/services/sampleplots/?referenceName=9&variantType=EFO:0030067&start=21500000&start=21975098&end=21967753&end=22500000&filters=NCIT:C3058&filters=pgx:cohort-celllines&output=histoplot) - - a search for samples with focal deletion in the _CDKN2A_ locus, limited to glioblastoma cell lines +* [progenetix.org/services/sampleplots/?geneId=CDKN2A&variantType=EFO:0030067&variantMaxLength=2000000&filters=NCIT:C3058&output=histoplot](http://progenetix.org/services/sampleplots/?geneId=CDKN2A&variantType=EFO:0030067&variantMaxLength=2000000&filters=NCIT:C3058&output=histoplot) + - a search for glioblastoma samples with a focal (here <= 2Mb) deletion in the _CDKN2A_ locus ### Example Procedure - Download CNV Frequencies @@ -104,14 +104,14 @@ local, disease-specific CNV frequencies. All cancer codes for a given classification system can be retrieved though: -* NCIT - - [progenetix.org/services/collations?filters=NCIT&output=text](http://progenetix.org/services/collations?filters=NCIT&output=text) -* ICD-O Morphologies - - [progenetix.org/services/collations?filters=icdom&method=counts&output=text](http://progenetix.org/services/collations?filters=icdom&method=counts&output=text) +* NCIt cancer codes `NCIT` + - [progenetix.org/services/collations?collationTypes=NCIT&deliveryKeys=id,label,count](http://progenetix.org/services/collations?collationTypes=NCIT&deliveryKeys=id,label,count) +* ICD-O Morphologies `icdom` + - [progenetix.org/services/collations?collationTypes=icdom&deliveryKeys=id,label,count](http://progenetix.org/services/collations?collationTypes=icdom&deliveryKeys=id,label,count) - please be aware that we have to use transformed ICD-O codes; e.g. "ICD-O 8500/3" is represented as `pgx:icdom-85003` (`s/^(\d{4})\/(\d)$/pgx:icdom-$1$2/`) -* ICD-O Topographies - - [progenetix.org/services/collations?filters=icdot&method=counts&output=text](http://progenetix.org/services/collations?filters=icdot&method=counts&output=text) +* ICD-O Topographies `icdot` + - [progenetix.org/services/collations?collationTypes=icdot&deliveryKeys=id,label,count](http://progenetix.org/services/collations?collationTypes=icdot&deliveryKeys=id,label,count) #### Download the data file @@ -134,8 +134,8 @@ added (single) collation code. ##### Examples -* [progenetix.org/services/collationPlots/?id=pgx:icdom-85003](http://progenetix.org/services/collationPlots/?id=pgx:icdom-85003) -* [progenetix.org/services/collationPlots/?id=PMID:22824167](http://progenetix.org/services/collationPlots/?id=PMID:22824167) +* [progenetix.org/services/collationplots/?id=pgx:icdom-85003](http://progenetix.org/services/collationplots/?id=pgx:icdom-85003) +* [progenetix.org/services/collationplots/?id=PMID:22824167](http://progenetix.org/services/collationplots/?id=PMID:22824167) -------------------------------------------------------------------------------- diff --git a/src/components/SubsetsHierarchyLoader.js b/src/components/SubsetsHierarchyLoader.js index 2d5e9d88..55c17b46 100644 --- a/src/components/SubsetsHierarchyLoader.js +++ b/src/components/SubsetsHierarchyLoader.js @@ -7,7 +7,7 @@ import { buildTree, TreePanel } from "./classificationTree/TreePanel" export default function SubsetsHierarchyLoader({ collationTypes, datasetIds, defaultTreeDepth }) { const bioSubsetsHierarchiesReply = useCollationsByType({ datasetIds, - method: "paths", + deliveryKeys: "", collationTypes }) diff --git a/src/components/formShared/GenespanUtilities.js b/src/components/formShared/GenespanUtilities.js index 45564c7d..dfedb69a 100644 --- a/src/components/formShared/GenespanUtilities.js +++ b/src/components/formShared/GenespanUtilities.js @@ -71,5 +71,5 @@ function geneLabel(gene) { } function geneSearchUrl(querytext) { - return `${basePath}services/genespans/?geneId=${querytext}&filterPrecision=start&method=genespan` + return `${basePath}services/genespans/?geneId=${querytext}&filterPrecision=start&deliveryKeys=symbol,referenceName,start,end` } diff --git a/src/components/searchForm/BiosamplesSearchForm.js b/src/components/searchForm/BiosamplesSearchForm.js index 06270edd..ad80187d 100644 --- a/src/components/searchForm/BiosamplesSearchForm.js +++ b/src/components/searchForm/BiosamplesSearchForm.js @@ -761,7 +761,7 @@ function useFilteringTerms(watchForm, ct, mode) { const datasetIds = watchForm("datasetIds") return useFiltersByType({ datasetIds, - method: "counts", + deliveryKeys: "id,label,count", mode: mode, collationTypes: ct }) diff --git a/src/hooks/api.js b/src/hooks/api.js index d711dff4..3fc09a29 100644 --- a/src/hooks/api.js +++ b/src/hooks/api.js @@ -234,7 +234,7 @@ export function buildDataVisualizationParameters(queryData) { } export function publicationDataUrl(id) { - return `${SITE_DEFAULTS.API_PATH}services/publications?filters=${id}&method=details` + return `${SITE_DEFAULTS.API_PATH}services/publications?filters=${id}` } export function usePublication(id) { @@ -358,11 +358,10 @@ export function useSubsethistogram({ return useExtendedSWR(size > 0 && `${svgbaseurl}&${searchQuery}`, svgFetcher) } -// method is "counts" / "child_terms" for smaller payloads export function useCollationsById({ datasetIds }) { const { data, ...other } = useCollations({ filters: "", - method: "counts", + deliveryKeys: "id,label,count", datasetIds }) @@ -379,19 +378,19 @@ export function useCollationsById({ datasetIds }) { return { data, ...other } } -export function useCollations({ datasetIds, method, filters }) { - const url = `${SITE_DEFAULTS.API_PATH}beacon/filtering_terms/?datasetIds=${datasetIds}&method=${method}&filters=${filters}` +export function useCollations({ datasetIds, deliveryKeys, filters }) { + const url = `${SITE_DEFAULTS.API_PATH}beacon/filtering_terms/?datasetIds=${datasetIds}&deliveryKeys=${deliveryKeys}&filters=${filters}` return useProgenetixApi(url) } -export function useFiltersByType({ datasetIds, method, mode, collationTypes }) { +export function useFiltersByType({ datasetIds, deliveryKeys, mode, collationTypes }) { // TODO: construct URL w/o optional parameters if empty - const url = `${SITE_DEFAULTS.API_PATH}beacon/filtering_terms/?datasetIds=${datasetIds}&method=${method}&mode=${mode}&collationTypes=${collationTypes}` + const url = `${SITE_DEFAULTS.API_PATH}beacon/filtering_terms/?datasetIds=${datasetIds}&deliveryKeys=${deliveryKeys}&mode=${mode}&collationTypes=${collationTypes}` return useProgenetixApi(url) } -export function useCollationsByType({ datasetIds, method, collationTypes }) { - const url = `${SITE_DEFAULTS.API_PATH}services/collations/?datasetIds=${datasetIds}&method=${method}&collationTypes=${collationTypes}` +export function useCollationsByType({ datasetIds, deliveryKeys, collationTypes }) { + const url = `${SITE_DEFAULTS.API_PATH}services/collations/?datasetIds=${datasetIds}&deliveryKeys=${deliveryKeys}&collationTypes=${collationTypes}` return useProgenetixApi(url) } @@ -409,7 +408,7 @@ export function useGeoCity({ city }) { } export function useGeneSymbol({ geneId }) { - const url = geneId ? `${SITE_DEFAULTS.API_PATH}services/genespans/?geneId=${geneId}&filterPrecision=start&method=genespan` : null + const url = geneId ? `${SITE_DEFAULTS.API_PATH}services/genespans/?geneId=${geneId}&filterPrecision=start&deliveryKeys=symbol,referenceName,start,end` : null return useProgenetixApi(url) } diff --git a/src/pages/index.js b/src/pages/index.js index 9310a059..65947fdb 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -104,10 +104,10 @@ export const getStaticProps = async () => { `${SITE}services/dbstats/?datasetIds=${SITE_DEFAULTS.DATASETID}` ) const ncitCountReply = await tryFetch( - `${SITE}services/collations/?datasetIds=${SITE_DEFAULTS.DATASETID}&method=codematches&collationTypes=NCIT` + `${SITE}services/collations/?datasetIds=${SITE_DEFAULTS.DATASETID}&collationTypes=NCIT&includeDescendantTerms=false&requestedGranularity=count` ) const subsetsReply = await tryFetch( - `${SITE}services/collations/?datasetIds=${SITE_DEFAULTS.DATASETID}&method=counts&collationTypes=NCIT` + `${SITE}services/collations/?datasetIds=${SITE_DEFAULTS.DATASETID}&collationTypes=NCIT&deliveryKeys=count,id,label` ) return {