Skip to content

Commit

Permalink
collation links - e.g. getting rid of "method" => deliveryKeys where …
Browse files Browse the repository at this point in the history
…needed
  • Loading branch information
mbaudis committed Sep 20, 2024
1 parent b4068cc commit 61c2f85
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 25 deletions.
20 changes: 10 additions & 10 deletions docs/use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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)

--------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/components/SubsetsHierarchyLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/formShared/GenespanUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
2 changes: 1 addition & 1 deletion src/components/searchForm/BiosamplesSearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
19 changes: 9 additions & 10 deletions src/hooks/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
})

Expand All @@ -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)
}

Expand All @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 61c2f85

Please sign in to comment.