diff --git a/src/components/SubsetsHierarchyLoader.js b/src/components/SubsetsHierarchyLoader.js index 55c17b46..c21fd9c5 100644 --- a/src/components/SubsetsHierarchyLoader.js +++ b/src/components/SubsetsHierarchyLoader.js @@ -1,45 +1,35 @@ -import { useCollationsByType, useCollationsById } from "../hooks/api" +// import { useCollationsByType, useCollationsById } from "../hooks/api" +import { useCollationsByType } from "../hooks/api" import { WithData } from "./Loader" import React from "react" -import { keyBy, merge } from "lodash" +import { keyBy } from "lodash" import { buildTree, TreePanel } from "./classificationTree/TreePanel" export default function SubsetsHierarchyLoader({ collationTypes, datasetIds, defaultTreeDepth }) { - const bioSubsetsHierarchiesReply = useCollationsByType({ + const collationsHierarchyReply = useCollationsByType({ datasetIds, deliveryKeys: "", collationTypes }) - const allBioSubsetsReply = useCollationsById({datasetIds}) - return ( ( - ( - - )} + render={(collationsHierarchyReply) => ( + )} /> ) } -function SubsetsResponse({ bioSubsetsHierarchies, allBioSubsets, datasetIds, defaultTreeDepth }) { - // We merge both subsets from hierarchies and subsets from allSubsets. - // This is because some children in the bioSubsetsHierarchies don't have labels or sample count information. - const subsetById = merge(keyBy(bioSubsetsHierarchies, "id"), allBioSubsets) - const { tree, size } = buildTree(bioSubsetsHierarchies, subsetById) +function SubsetsResponse({ collationsHierarchies, datasetIds, defaultTreeDepth }) { + const subsetById = keyBy(collationsHierarchies, "id") + const { tree, size } = buildTree(collationsHierarchies, subsetById) return ( saveAsJson(json, `${fileName}.json`) - : () => saveAsCSV(json, `${fileName}.csv`) - return ( -
-

- - - -

-

- -

-
- ) -} - -function saveAsJson(json, fileName) { - initiateSaveAs( - JSON.stringify(json, null, 2), - fileName, - "text/json;charset=utf-8" - ) -} - -function saveAsCSV(json, fileName) { - const { unwind, flatten } = json2csv.transforms - const transforms = [flatten({ objects: true, arrays: true }), unwind()] - const parser = new json2csv.Parser({ transforms }) - const data = parser.parse(json) - initiateSaveAs(data, fileName, "text/csv;charset=utf-8") -} diff --git "a/\357\243\277remnants/TCGA_dataPage.js" "b/\357\243\277remnants/TCGA_dataPage.js" deleted file mode 100644 index c92e9d5a..00000000 --- "a/\357\243\277remnants/TCGA_dataPage.js" +++ /dev/null @@ -1,51 +0,0 @@ -import React from "react" -import { Layout } from "../../components/Layout" -import parametersConfig from "../../config/beaconSearchParameters.yaml" -import beaconQueryTypes from "../../config/beaconQueryTypes.yaml" -import requestTypeExamples from "../../config/TCGA_searchExamples.yaml" -import BiosamplesSearchPanel from "../../components/searchForm/BiosamplesSearchPanel" - -import Panel from "../../components/Panel" -import { SubsetHistogram } from "../../components/SVGloaders" -import { ExternalLink } from "../../components/helpersShared/linkHelpers" -import SubsetsHierarchyLoader from "../../components/SubsetsHierarchyLoader" - -export default function TCGA_dataPage({ cytoBands }) { - const imgHere = { - float: "right", - width: "200px", - border: "0px", - margin: "-90px -20px 0px 0px" - } - - return ( - - -
- - This search page accesses the TCGA subset of the Progenetix - collection, based on 22142 samples (tumor and reeferences) from The - Cancer Genome Atlas project. The results are based upon data generated - by the{" "} - {" "}. Disease-specific subsets of TCGA data (aka. projects) can be - accessed below. -
- -
- - - - - -
- ) -} diff --git "a/\357\243\277remnants/cytomapper.js" "b/\357\243\277remnants/cytomapper.js" deleted file mode 100644 index d3daedca..00000000 --- "a/\357\243\277remnants/cytomapper.js" +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useRef } from "react" -import { Chromosome } from "../../components/Chromosome" -import { getCytoBands } from "../../utils/genome" -import { Layout } from "../../components/Layout" -import { useContainerDimensions } from "../../hooks/containerDimensions" - -export default function CytobandsInfo({ cytoBands }) { - const componentRef = useRef() - const { width } = useContainerDimensions(componentRef, { - updateOnResize: true, - debounceWait: 10 - }) - return ( - -
- -
-
- ) -} - -function Content({ cytoBands, width }) { - return ( -
-
CDKN2A Deletion Example
- -
MYC Duplication
- -
- ) -} - -export const getStaticProps = async () => { - return { - props: { - cytoBands: await getCytoBands() - } - } -} diff --git "a/\357\243\277remnants/files.js" "b/\357\243\277remnants/files.js" deleted file mode 100644 index a149957f..00000000 --- "a/\357\243\277remnants/files.js" +++ /dev/null @@ -1,16 +0,0 @@ -import FileSaver from "file-saver" - -export function initiateSaveAs(string, name, type = "text/csv;charset=utf-8") { - const file = new File([string], name, { - type: type - }) - FileSaver.saveAs(file) -} - -export function openJsonInNewTab(dataJson) { - const jsonString = JSON.stringify(dataJson, null, 2) - const x = window.open() - x.document.open() - x.document.write(`
${jsonString}
`) - x.document.close() -} diff --git "a/\357\243\277remnants/gao-2021-signatures.js" "b/\357\243\277remnants/gao-2021-signatures.js" deleted file mode 100644 index 402aa1a6..00000000 --- "a/\357\243\277remnants/gao-2021-signatures.js" +++ /dev/null @@ -1,11 +0,0 @@ -import Page from "../../modules/data-pages/gao2021signatures_dataPage" -import { getCytoBands } from "../../utils/genome" -export default Page - -export const getStaticProps = async () => { - return { - props: { - cytoBands: await getCytoBands() - } - } -} diff --git "a/\357\243\277remnants/gao2021signatures_dataPage.js" "b/\357\243\277remnants/gao2021signatures_dataPage.js" deleted file mode 100644 index 5bb54fc2..00000000 --- "a/\357\243\277remnants/gao2021signatures_dataPage.js" +++ /dev/null @@ -1,104 +0,0 @@ -import React from "react" -import { ExternalLink } from "../../components/helpersShared/linkHelpers" -import { Layout } from "../../components/Layout" -import parametersConfig from "../../config/beaconSearchParameters.yaml" -import requestTypeConfig from "../../config/gao2021signatures_searchParameters.yaml" -import requestTypeExamples from "../../config/gao2021signatures_searchExamples.yaml" - -import BiosamplesSearchPanel from "../../components/searchForm/BiosamplesSearchPanel" -import { SubsetHistogram } from "../../components/SVGloaders" -import Panel from "../../components/Panel" -// import Link from "next/link" - -export default function gao2021signatures_dataPage({ cytoBands }) { - const imgHere = { - float: "right", - width: "200px", - border: "0px", - margin: "-90px -20px 0px 0px" - } - - return ( - - -
- - This search page uses the subset of Progenetix data - including TCGA - samples - used in the{" "} - {" "} - publication. -
- For access restriction imposed by PCAWG the data cannot not include - the samples from this consortium which have been used in our - publication. -
-
- -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
-
- - - - -
- ) -} diff --git "a/\357\243\277remnants/gao2021signatures_searchExamples.yaml" "b/\357\243\277remnants/gao2021signatures_searchExamples.yaml" deleted file mode 100644 index 9d964351..00000000 --- "a/\357\243\277remnants/gao2021signatures_searchExamples.yaml" +++ /dev/null @@ -1,31 +0,0 @@ ---- -note: "" -label: "" -description: "" -parameters: - datasetIds: - defaultValue: ["progenetix"] - isHidden: true - cohorts: - defaultValue: ["pgx:cohort-gao2021signatures"] - # isHidden: true - referenceName: - placeholder: "9" - start: - placeholder: "19000001-21975098" - end: - placeholder: "21967753-24000000" - variantType: - placeholder: "EFO:0030067" - alternateBases: - placeholder: "" - isHidden: true - referenceBases: - placeholder: "" - isHidden: true - accessid: - isHidden: true - sex: - placeholder: "" - materialtype: - placeholder: "EFO:0009656" #"EFO:0009656" diff --git "a/\357\243\277remnants/gao2021signatures_searchParameters.yaml" "b/\357\243\277remnants/gao2021signatures_searchParameters.yaml" deleted file mode 100644 index 9d964351..00000000 --- "a/\357\243\277remnants/gao2021signatures_searchParameters.yaml" +++ /dev/null @@ -1,31 +0,0 @@ ---- -note: "" -label: "" -description: "" -parameters: - datasetIds: - defaultValue: ["progenetix"] - isHidden: true - cohorts: - defaultValue: ["pgx:cohort-gao2021signatures"] - # isHidden: true - referenceName: - placeholder: "9" - start: - placeholder: "19000001-21975098" - end: - placeholder: "21967753-24000000" - variantType: - placeholder: "EFO:0030067" - alternateBases: - placeholder: "" - isHidden: true - referenceBases: - placeholder: "" - isHidden: true - accessid: - isHidden: true - sex: - placeholder: "" - materialtype: - placeholder: "EFO:0009656" #"EFO:0009656" diff --git "a/\357\243\277remnants/genome.js" "b/\357\243\277remnants/genome.js" deleted file mode 100644 index 337c10d3..00000000 --- "a/\357\243\277remnants/genome.js" +++ /dev/null @@ -1,20 +0,0 @@ -// nodejs, can only be loaded from static props -import { groupBy } from "lodash" - -export const getCytoBands = async () => { - const fs = require("fs") - const path = require("path") - const csv = require("neat-csv") - const cytoBandIdeoPath = path.join( - process.cwd(), - "public", - "rsrc", - "cytoBandIdeo.txt" - ) - const rows = await csv(fs.createReadStream(cytoBandIdeoPath), { - headers: ["referenceName", "start", "end", "cytoband", "stain"], - separator: "\t", - skipComments: true - }) - return groupBy(rows, "referenceName") -} diff --git "a/\357\243\277remnants/oneKgenomes.js" "b/\357\243\277remnants/oneKgenomes.js" deleted file mode 100644 index 93994057..00000000 --- "a/\357\243\277remnants/oneKgenomes.js" +++ /dev/null @@ -1,11 +0,0 @@ -import Page from "../../modules/data-pages/oneKgenomes_dataPage" -import { getCytoBands } from "../../utils/genome" -export default Page - -export const getStaticProps = async () => { - return { - props: { - cytoBands: await getCytoBands() - } - } -} diff --git "a/\357\243\277remnants/oneKgenomes_dataPage.js" "b/\357\243\277remnants/oneKgenomes_dataPage.js" deleted file mode 100644 index c6da7f4b..00000000 --- "a/\357\243\277remnants/oneKgenomes_dataPage.js" +++ /dev/null @@ -1,50 +0,0 @@ -import React from "react" -import { Layout } from "../../components/Layout" -import parametersConfig from "../../config/beaconSearchParameters.yaml" -import beaconQueryTypes from "../../config/beaconQueryTypes.yaml" -import requestTypeExamples from "../../config/oneKgenomes_searchExamples.yaml" -import BiosamplesSearchPanel from "../../components/searchForm/BiosamplesSearchPanel" - -import Panel from "../../components/Panel" -import { SubsetHistogram } from "../../components/SVGloaders" -import { ExternalLink } from "../../components/helpersShared/linkHelpers" - -export default function oneKgenomes_dataPage({ cytoBands }) { - const imgHere = { - float: "right", - width: "200px", - border: "0px", - margin: "0px -10px 10px 10px" - } - - return ( - - -
- - This search page accesses the reference germline CNV data of 3200 samples from the 1000 Genomes Project. - The results are based on the data from the Illumina DRAGEN caller re-analysis of - 3200 whole genome sequencing (WGS) samples downloaded from the{" "} - {" "}. -
- -
- Please note that the CNV spikes are based on the frequency of occurrence of any CNV - in a given 1Mb interval, not on their overlap. Some genome bins may have at least one small CNV in - each sample - especially in peri-centromeric regions - and therefore will display with a 100% frequency - - although many of those may not overlap. -
-
- -
- ) -} diff --git "a/\357\243\277remnants/oneKgenomes_searchExamples.yaml" "b/\357\243\277remnants/oneKgenomes_searchExamples.yaml" deleted file mode 100644 index 23ca86a7..00000000 --- "a/\357\243\277remnants/oneKgenomes_searchExamples.yaml" +++ /dev/null @@ -1,15 +0,0 @@ ---- -- label: "Range Example" - note: "Example for a deletion around the TP53 locus" - description: >- - The range reques matches all deletion CNVs somehow overlapping the interval. - parameters: - referenceName: - defaultValue: "refseq:NC_000017.11" - start: - defaultValue: 7000000 - end: - defaultValue: 8000000 - variantType: - defaultValue: EFO:0030067 - diff --git "a/\357\243\277remnants/oneKgenomes_searchParameters.yaml" "b/\357\243\277remnants/oneKgenomes_searchParameters.yaml" deleted file mode 100644 index ca862245..00000000 --- "a/\357\243\277remnants/oneKgenomes_searchParameters.yaml" +++ /dev/null @@ -1,37 +0,0 @@ ---- -note: "" -label: "" -description: "" -parameters: - datasetIds: - defaultValue: ["progenetix"] - isHidden: true - cohorts: - defaultValue: ["pgx:cohort-oneKgenomes"] - isHidden: true - referenceName: - placeholder: "17" - start: - placeholder: 7000000 - end: - placeholder: 8000000 - geneId: - isHidden: true - variantMinLength: - isHidden: true - variantMaxLength: - isHidden: true - variantType: - defaultValue: "" - bioontology: - isHidden: true - sex: - isHidden: true - materialtype: - isHidden: true - accessid: - isHidden: true - filterLogic: - isHidden: true - geoCity: - isHidden: true