Skip to content

Commit

Permalink
removing modules, adding fusion query
Browse files Browse the repository at this point in the history
This largish restructuring gets rid of the `modules` part & just defines the pages. And: "mateName" etc. fusion support!
  • Loading branch information
mbaudis committed Aug 7, 2024
1 parent 1c02ce7 commit 0800f7e
Show file tree
Hide file tree
Showing 61 changed files with 2,599 additions and 2,873 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"classnames": "^2.2.6",
"env-cmd": "^10.1.0",
"file-saver": "^2.0.5",
"fs": "0.0.1-security",
"fs": "^0.0.1-security",
"json2csv": "^5.0.6",
"leaflet": "^1.7.1",
"lodash": "^4.17.21",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ontologymapsUrl, useProgenetixApi } from "../../hooks/api"
import { ontologymapsUrl, useProgenetixApi } from "../hooks/api"
import Link from "next/link"

export function CodeGroups({ codeGroups, ontomapsUrl }) {
Expand Down
20 changes: 20 additions & 0 deletions src/components/SearchPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react"
import { Layout } from "./Layout"
import BiosamplesSearchPanel from "./searchForm/BiosamplesSearchPanel"
import parametersConfig from "../config/beaconSearchParameters.yaml"
import beaconQueryTypes from "../config/beaconQueryTypes.yaml"
import requestTypeExamples from "../config/beaconSearchExamples.yaml"

export default function Page({ cytoBands }) {
return (
<Layout title="Search Samples" headline="">
<BiosamplesSearchPanel
cytoBands={cytoBands}
parametersConfig={parametersConfig}
beaconQueryTypes={beaconQueryTypes}
requestTypeExamples={requestTypeExamples}
collapsed={false}
/>
</Layout>
)
}
59 changes: 46 additions & 13 deletions src/components/searchForm/BiosamplesSearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ export function BeaconSearchForm({
/>
)}
<div className="columns my-0">
<InputField
className={cn(
!parameters.geneId.isHidden && "column",
"py-0 mb-3"
)}
{...parameters.geneId} {...fieldProps}
/>
<InputField
className={cn(
!parameters.genomicAlleleShortForm.isHidden && "column",
Expand All @@ -239,19 +246,20 @@ export function BeaconSearchForm({
/>
</div>
<div className="columns my-0">
<InputField
<SelectField
className={cn(
!parameters.geneId && "column",
!parameters.analysisOperation.isHidden && "column",
"py-0 mb-3"
)}
{...parameters.geneId} {...fieldProps}
{...parameters.analysisOperation}
{...selectProps}
/>
<SelectField
className={cn(
!parameters.analysisOperation.isHidden && "column",
!parameters.variantType.isHidden && "column",
"py-0 mb-3"
)}
{...parameters.analysisOperation}
{...parameters.variantType}
{...selectProps}
/>
</div>
Expand All @@ -264,31 +272,50 @@ export function BeaconSearchForm({
{...parameters.referenceName}
{...selectProps}
/>
<SelectField
<InputField
className={cn(
!parameters.variantType.isHidden && "column",
!parameters.start.isHidden && "column",
"py-0 mb-3"
)}
{...parameters.variantType}
{...selectProps}
{...fieldProps}
{...parameters.start}
rules={{
validate: checkIntegerRange
}}
/>
<InputField
className={cn(!parameters.end.isHidden && "column", "py-0 mb-3")}
{...fieldProps}
{...parameters.end}
rules={{
validate: checkIntegerRange
}}
/>
</div>
<div className="columns my-0">
<SelectField
className={cn(
!parameters.mateName.isHidden && "column",
"py-0 mb-3"
)}
{...parameters.mateName}
{...selectProps}
/>
<InputField
className={cn(
!parameters.start.isHidden && "column",
!parameters.mateStart.isHidden && "column",
"py-0 mb-3"
)}
{...fieldProps}
{...parameters.start}
{...parameters.mateStart}
rules={{
validate: checkIntegerRange
}}
/>
<InputField
className={cn(!parameters.end.isHidden && "column", "py-0 mb-3")}
className={cn(!parameters.mateEnd.isHidden && "column", "py-0 mb-3")}
{...fieldProps}
{...parameters.end}
{...parameters.mateEnd}
rules={{
validate: checkIntegerRange
}}
Expand Down Expand Up @@ -666,10 +693,13 @@ function validateForm(formValues) {
const {
variantType,
referenceName,
mateName,
referenceBases,
alternateBases,
start,
end,
mateStart,
mateEnd,
cytoBands,
variantQueryDigests,
geneId,
Expand All @@ -693,6 +723,9 @@ function validateForm(formValues) {
!alternateBases && setMissing("alternateBases")
!start && setMissing("start")
!end && setMissing("end")
!mateName && setMissing("mateName")
!mateStart && setMissing("mateStart")
!mateEnd && setMissing("mateEnd")
!cytoBands && setMissing("cytoBands")
!variantQueryDigests && setMissing("variantQueryDigests")
!variantType && setMissing("variantType")
Expand Down
15 changes: 15 additions & 0 deletions src/components/searchForm/ChromosomePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ export default function ChromosomePreview({ watch, cytoBands }) {
const { width } = useContainerDimensions(componentRef)
const startRange = watch("start")
const endRange = watch("end")
const mateStartRange = watch("mateStart")
const mateEndRange = watch("mateEnd")
const referenceName = watch("referenceName")
const mateName = watch("mateName")
const chro = referenceName ? refseq2chro(referenceName) : ""
const mateChro = mateName ? refseq2chro(mateName) : ""
const bands = cytoBands["chr" + chro]
const mateBands = cytoBands["chr" + mateChro]
const shouldDisplay = (startRange || endRange) && bands
const shouldDisplayMate = (mateStartRange || mateEndRange) && mateBands

return (
<div ref={componentRef}>
Expand All @@ -23,6 +29,15 @@ export default function ChromosomePreview({ watch, cytoBands }) {
width={width}
/>
)}
{shouldDisplayMate && (
<Chromosome
bands={mateBands}
refseqId={mateName}
startRange={mateStartRange}
endRange={mateEndRange}
width={width}
/>
)}
</div>
)
}
18 changes: 18 additions & 0 deletions src/components/searchResults/BiosamplesResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ function QuerySummary({ query }) {
{query.end}
</li>
)}
{query.mateName && (
<li>
<small>Adjacent Chro: </small>
{query.mateName}
</li>
)}
{query.mateStart && (
<li>
<small>Adj. Start: </small>
{query.mateStart}
</li>
)}
{query.mateEnd && (
<li>
<small>Adj. End: </small>
{query.mateEnd}
</li>
)}
{query.variantType && (
<li>
<small>Type: </small>
Expand Down
2 changes: 1 addition & 1 deletion src/components/searchResults/DatasetResultBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useRef, useState } from "react"
import {
// MAX_HISTO_SAMPLES,
// SITE_DEFAULTS,
getVisualizationLink,
replaceWithProxy,
useProgenetixApi,
useExtendedSWR
Expand All @@ -17,7 +18,6 @@ import BiosamplesStatsDataTable from "./BiosamplesStatsDataTable"
import { WithData } from "../Loader"
import { openJsonInNewTab } from "../../utils/files"
// import dynamic from "next/dynamic"
import { getVisualizationLink } from "../../modules/service-pages/dataVisualizationPage"

const HANDOVER_IDS = {
histoplot: "histoplot",
Expand Down
63 changes: 0 additions & 63 deletions src/config/DIPG_searchExamples.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions src/config/DIPG_searchParameters.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions src/config/TCGA_searchExamples.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions src/config/TCGA_searchParameters.yaml

This file was deleted.

Loading

0 comments on commit 0800f7e

Please sign in to comment.