diff --git a/client/src/components/Pages/Summary/Main/Summary.tsx b/client/src/components/Pages/Summary/Main/Summary.tsx index d50ed62d..b19362d5 100644 --- a/client/src/components/Pages/Summary/Main/Summary.tsx +++ b/client/src/components/Pages/Summary/Main/Summary.tsx @@ -36,6 +36,9 @@ export const Summary: React.FC = ({ setVisibleTab }) => { const [validatedFusion, setValidatedFusion] = useState< AssayedFusion | CategoricalFusion | null >(null); + const [formattedFusion, setFormattedFusion] = useState< + FormattedAssayedFusion | FormattedCategoricalFusion | null + >(null); const [validationErrors, setValidationErrors] = useState([]); const { fusion } = useContext(FusionContext); @@ -154,15 +157,15 @@ export const Summary: React.FC = ({ setVisibleTab }) => { }; } requestValidatedFusion(formattedFusion); + setFormattedFusion(formattedFusion); }, [fusion]); - console.log(validatedFusion); - return ( <> {(!validationErrors || validationErrors.length === 0) && + formattedFusion && validatedFusion ? ( - + ) : ( <> {validationErrors && validationErrors.length > 0 ? ( diff --git a/client/src/components/Pages/Summary/Readable/Readable.tsx b/client/src/components/Pages/Summary/Readable/Readable.tsx index ffccfe86..2bed053a 100644 --- a/client/src/components/Pages/Summary/Readable/Readable.tsx +++ b/client/src/components/Pages/Summary/Readable/Readable.tsx @@ -1,5 +1,9 @@ import "./Readable.scss"; -import { ClientStructuralElement } from "../../../../services/ResponseModels"; +import { + ClientStructuralElement, + FormattedAssayedFusion, + FormattedCategoricalFusion, +} from "../../../../services/ResponseModels"; import React, { useContext, useEffect, useState } from "react"; import Chip from "@material-ui/core/Chip"; import { FusionContext } from "../../../../global/contexts/FusionContext"; @@ -12,24 +16,25 @@ import { Typography, } from "@material-ui/core"; import { eventDisplayMap } from "../../CausativeEvent/CausativeEvent"; -import { FusionType } from "../Main/Summary"; import { getFusionNomenclature } from "../../../../services/main"; type Props = { - validatedFusion: FusionType; + formattedFusion: FormattedAssayedFusion | FormattedCategoricalFusion; }; -export const Readable: React.FC = ({ validatedFusion }) => { +export const Readable: React.FC = ({ + formattedFusion: formattedFusion, +}) => { // the validated fusion object is available as a parameter, but we'll use the // client-ified version to grab things like nomenclature and display values const { fusion } = useContext(FusionContext); const [nomenclature, setNomenclature] = useState(""); useEffect(() => { - getFusionNomenclature(validatedFusion).then((nmResponse) => + getFusionNomenclature(formattedFusion).then((nmResponse) => setNomenclature(nmResponse.nomenclature as string) ); - }, [validatedFusion]); + }, [formattedFusion]); const assayName = fusion.assay?.assayName ? fusion.assay.assayName : ""; const assayId = fusion.assay?.assayId ? `(${fusion.assay.assayId})` : ""; diff --git a/client/src/components/Pages/Summary/Success/Success.tsx b/client/src/components/Pages/Summary/Success/Success.tsx index 28eaa0a0..c35e2b4e 100644 --- a/client/src/components/Pages/Summary/Success/Success.tsx +++ b/client/src/components/Pages/Summary/Success/Success.tsx @@ -3,7 +3,10 @@ import { useColorTheme } from "../../../../global/contexts/Theme/ColorThemeConte import { Readable } from "../Readable/Readable"; import { Tabs, Tab } from "@material-ui/core/"; import { SummaryJSON } from "../JSON/SummaryJSON"; -import { FusionType } from "../Main/Summary"; +import { + FormattedAssayedFusion, + FormattedCategoricalFusion, +} from "../../../../services/ResponseModels"; const TabPanel = (props) => { const { children, value, index, ...other } = props; @@ -22,7 +25,7 @@ const TabPanel = (props) => { }; interface Props { - fusion: FusionType; + fusion: FormattedAssayedFusion | FormattedCategoricalFusion; } export const Success: React.FC = ({ fusion }) => { @@ -52,7 +55,7 @@ export const Success: React.FC = ({ fusion }) => {
- {fusion && } + {fusion && }
diff --git a/client/src/services/main.tsx b/client/src/services/main.tsx index ee3c29cd..e3320678 100644 --- a/client/src/services/main.tsx +++ b/client/src/services/main.tsx @@ -257,7 +257,6 @@ export const getExonCoords = async ( gene?: string, txAc?: string ): Promise => { - console.log(txAc); const argsArray = [ `chromosome=${chromosome}`, `strand=${strand === "+" ? "%2B" : "-"}`, diff --git a/server/src/curfu/routers/nomenclature.py b/server/src/curfu/routers/nomenclature.py index 7fb4fbf0..55b83743 100644 --- a/server/src/curfu/routers/nomenclature.py +++ b/server/src/curfu/routers/nomenclature.py @@ -186,7 +186,8 @@ def generate_fusion_nomenclature( :return: response with fusion nomenclature """ try: - nomenclature = request.app.state.fusor.generate_nomenclature(fusion) - return {"nomenclature": nomenclature} + valid_fusion = request.app.state.fusor.fusion(**fusion) except FUSORParametersException as e: return {"warnings": [str(e)]} + nomenclature = request.app.state.fusor.generate_nomenclature(valid_fusion) + return {"nomenclature": nomenclature}