diff --git a/client/src/components/Pages/Assay/Assay.tsx b/client/src/components/Pages/Assay/Assay.tsx index 86c71da0..29e45592 100644 --- a/client/src/components/Pages/Assay/Assay.tsx +++ b/client/src/components/Pages/Assay/Assay.tsx @@ -61,52 +61,52 @@ export const Assay: React.FC = () => { // initialize field values const [fusionDetection, setFusionDetection] = useState( - fusion?.assay?.fusion_detection !== undefined - ? fusion?.assay?.fusion_detection + fusion?.assay?.fusionDetection !== undefined + ? fusion?.assay?.fusionDetection : null ); const [assayName, setAssayName] = useState( - fusion?.assay?.assay_name !== undefined ? fusion?.assay?.assay_name : "" + fusion?.assay?.assayName !== undefined ? fusion?.assay?.assayName : "" ); const [assayId, setAssayId] = useState( - fusion?.assay?.assay_id !== undefined ? fusion?.assay?.assay_id : "" + fusion?.assay?.assayId !== undefined ? fusion?.assay?.assayId : "" ); const [methodUri, setMethodUri] = useState( - fusion?.assay?.method_uri !== undefined ? fusion?.assay?.method_uri : "" + fusion?.assay?.methodUri !== undefined ? fusion?.assay?.methodUri : "" ); const handleEvidenceChange = (event: FormEvent) => { const evidence_value = event.currentTarget.value; - if (fusion?.assay?.fusion_detection !== evidence_value) { + if (fusion?.assay?.fusionDetection !== evidence_value) { setFusionDetection(evidence_value); const assay = JSON.parse(JSON.stringify(fusion.assay)); - assay["fusion_detection"] = evidence_value; + assay["fusionDetection"] = evidence_value; setFusion({ ...fusion, assay: assay }); } }; const propertySetterMap = { - assayName: [setAssayName, "assay_name"], - assayId: [setAssayId, "assay_id"], - methodUri: [setMethodUri, "method_uri"], + assayName: [setAssayName, "assayName"], + assayId: [setAssayId, "assayId"], + methodUri: [setMethodUri, "methodUri"], }; // live update fields useEffect(() => { - if (fusion?.assay?.fusion_detection !== fusionDetection) { - setFusionDetection(fusion?.assay?.fusion_detection); + if (fusion?.assay?.fusionDetection !== fusionDetection) { + setFusionDetection(fusion?.assay?.fusionDetection); } - if (fusion?.assay?.assay_name !== assayName) { - setAssayName(fusion?.assay?.assay_name); + if (fusion?.assay?.assayName !== assayName) { + setAssayName(fusion?.assay?.assayName); } - if (fusion?.assay?.assay_id !== assayId) { - setAssayId(fusion?.assay?.assay_id); + if (fusion?.assay?.assayId !== assayId) { + setAssayId(fusion?.assay?.assayId); } - if (fusion?.assay?.method_uri !== methodUri) { - setMethodUri(fusion?.assay?.method_uri); + if (fusion?.assay?.methodUri !== methodUri) { + setMethodUri(fusion?.assay?.methodUri); } }, [fusion]); diff --git a/client/src/components/Pages/CausativeEvent/CausativeEvent.tsx b/client/src/components/Pages/CausativeEvent/CausativeEvent.tsx index 1e5c3aa1..0cc5b6ca 100644 --- a/client/src/components/Pages/CausativeEvent/CausativeEvent.tsx +++ b/client/src/components/Pages/CausativeEvent/CausativeEvent.tsx @@ -28,18 +28,18 @@ export const CausativeEvent: React.FC = () => { const { fusion, setFusion } = useContext(FusionContext); const [eventType, setEventType] = useState( - fusion.causative_event?.event_type || "" + fusion.causativeEvent?.eventType || "" ); const [eventDescription, setEventDescription] = useState( - fusion.causative_event?.event_type || "" + fusion.causativeEvent?.eventType || "" ); /** * Ensure that causative event object exists for getter/setter purposes */ const ensureEventInitialized = () => { - if (!fusion.causative_event) { - setFusion({ ...fusion, causative_event: {} }); + if (!fusion.causativeEvent) { + setFusion({ ...fusion, causativeEvent: {} }); } }; @@ -56,8 +56,8 @@ export const CausativeEvent: React.FC = () => { if (eventType !== value) { setEventType(value); } - const newCausativeEvent = { event_type: value, ...fusion.causative_event }; - setFusion({ causative_event: newCausativeEvent, ...fusion }); + const newCausativeEvent = { eventType: value, ...fusion.causativeEvent }; + setFusion({ causativeEvent: newCausativeEvent, ...fusion }); }; /** @@ -72,10 +72,10 @@ export const CausativeEvent: React.FC = () => { setEventDescription(value); } const newCausativeEvent = { - event_description: value, - ...fusion.causative_event, + eventDescription: value, + ...fusion.causativeEvent, }; - setFusion({ causative_event: newCausativeEvent, ...fusion }); + setFusion({ causativeEvent: newCausativeEvent, ...fusion }); }; return ( diff --git a/client/src/components/Pages/Domains/DomainForm/DomainForm.tsx b/client/src/components/Pages/Domains/DomainForm/DomainForm.tsx index 8665cc8a..442e305b 100644 --- a/client/src/components/Pages/Domains/DomainForm/DomainForm.tsx +++ b/client/src/components/Pages/Domains/DomainForm/DomainForm.tsx @@ -35,8 +35,8 @@ const useStyles = makeStyles((theme) => ({ const DomainForm: React.FC = () => { // // TODO: shouldn't be necessary useEffect(() => { - if (fusion.critical_functional_domains === undefined) { - setFusion({ ...fusion, ...{ critical_functional_domains: [] } }); + if (fusion.criticalFunctionalDomains === undefined) { + setFusion({ ...fusion, ...{ criticalFunctionalDomains: [] } }); } }, []); @@ -65,7 +65,7 @@ const DomainForm: React.FC = () => { const handleAdd = () => { const domainParams = domainOptions[gene].find( - (domainOption: DomainParams) => domainOption.interpro_id == domain + (domainOption: DomainParams) => domainOption.interproId == domain ); getFunctionalDomain(domainParams, status as DomainStatus, gene).then( (response) => { @@ -74,11 +74,11 @@ const DomainForm: React.FC = () => { domain_id: uuid(), ...response.domain, }; - const cloneArray = Array.from(fusion["critical_functional_domains"]); + const cloneArray = Array.from(fusion["criticalFunctionalDomains"]); cloneArray.push(newDomain); setFusion({ ...fusion, - ...{ critical_functional_domains: cloneArray }, + ...{ criticalFunctionalDomains: cloneArray }, }); setStatus("default"); @@ -107,11 +107,11 @@ const DomainForm: React.FC = () => { if (domainOptions[gene]) { const uniqueInterproIds: Set = new Set(); domainOptions[gene].forEach((domain: DomainParams, index: number) => { - if (!uniqueInterproIds.has(domain.interpro_id)) { - uniqueInterproIds.add(domain.interpro_id); + if (!uniqueInterproIds.has(domain.interproId)) { + uniqueInterproIds.add(domain.interproId); domainOptionMenuItems.push( - - {domain.domain_name} + + {domain.domainName} ); } diff --git a/client/src/components/Pages/Domains/Main/Domains.tsx b/client/src/components/Pages/Domains/Main/Domains.tsx index f51d63b1..9fb5515d 100644 --- a/client/src/components/Pages/Domains/Main/Domains.tsx +++ b/client/src/components/Pages/Domains/Main/Domains.tsx @@ -22,7 +22,7 @@ export const Domain: React.FC = () => { const { fusion, setFusion } = useContext(FusionContext); const { globalGenes } = useContext(GeneContext); - const domains = fusion.critical_functional_domains || []; + const domains = fusion.criticalFunctionalDomains || []; const { colorTheme } = useColorTheme(); const useStyles = makeStyles(() => ({ @@ -73,14 +73,14 @@ export const Domain: React.FC = () => { const handleRemove = (domain: ClientFunctionalDomain) => { let cloneArray: ClientFunctionalDomain[] = Array.from( - fusion.critical_functional_domains + fusion.criticalFunctionalDomains ); cloneArray = cloneArray.filter((obj) => { return obj["domain_id"] !== domain["domain_id"]; }); setFusion({ ...fusion, - ...{ critical_functional_domains: cloneArray || [] }, + ...{ criticalFunctionalDomains: cloneArray || [] }, }); }; diff --git a/client/src/components/Pages/Gene/StructureDiagram/StructureDiagram.tsx b/client/src/components/Pages/Gene/StructureDiagram/StructureDiagram.tsx index 31caa2d9..e76d335a 100644 --- a/client/src/components/Pages/Gene/StructureDiagram/StructureDiagram.tsx +++ b/client/src/components/Pages/Gene/StructureDiagram/StructureDiagram.tsx @@ -42,8 +42,8 @@ export const StructureDiagram: React.FC = () => { }); const regEls = []; - suggestion.regulatory_elements.forEach((el) => { - regEls.push(el.gene_descriptor.label); + suggestion.regulatoryElements.forEach((el) => { + regEls.push(el.gene.label); }); return ( diff --git a/client/src/components/Pages/ReadingFrame/ReadingFrame.tsx b/client/src/components/Pages/ReadingFrame/ReadingFrame.tsx index 057fe0bc..9c55e7fa 100644 --- a/client/src/components/Pages/ReadingFrame/ReadingFrame.tsx +++ b/client/src/components/Pages/ReadingFrame/ReadingFrame.tsx @@ -50,19 +50,19 @@ export const ReadingFrame: React.FC = ({ index }) => { }; const [rFramePreserved, setRFramePreserved] = useState( - assignRadioValue(fusion.r_frame_preserved) + assignRadioValue(fusion.readingFramePreserved) ); useEffect(() => { if ( - fusion.r_frame_preserved && - fusion.r_frame_preserved !== rFramePreserved + fusion.readingFramePreserved && + fusion.readingFramePreserved !== rFramePreserved ) { - setRFramePreserved(assignRadioValue(fusion.r_frame_preserved)); + setRFramePreserved(assignRadioValue(fusion.readingFramePreserved)); } - if (fusion.r_frame_preserved === undefined) { - setFusion({ ...fusion, r_frame_preserved: null }); + if (fusion.readingFramePreserved === undefined) { + setFusion({ ...fusion, readingFramePreserved: null }); } }, [fusion]); @@ -71,13 +71,13 @@ export const ReadingFrame: React.FC = ({ index }) => { if (value !== rFramePreserved) { if (value === "yes") { setRFramePreserved("yes"); - setFusion({ ...fusion, r_frame_preserved: true }); + setFusion({ ...fusion, readingFramePreserved: true }); } else if (value === "no") { setRFramePreserved("no"); - setFusion({ ...fusion, r_frame_preserved: false }); + setFusion({ ...fusion, readingFramePreserved: false }); } else { setRFramePreserved("unspecified"); - setFusion({ ...fusion, r_frame_preserved: null }); + setFusion({ ...fusion, readingFramePreserved: null }); } } }; diff --git a/client/src/components/Pages/Structure/Builder/Builder.tsx b/client/src/components/Pages/Structure/Builder/Builder.tsx index cd7e73ed..01946796 100644 --- a/client/src/components/Pages/Structure/Builder/Builder.tsx +++ b/client/src/components/Pages/Structure/Builder/Builder.tsx @@ -54,10 +54,9 @@ const ELEMENT_TEMPLATE = [ type: ElementType.geneElement, nomenclature: "", element_id: uuid(), - gene_descriptor: { + gene: { id: "", type: "", - gene_id: "", label: "", }, }, @@ -69,9 +68,8 @@ const ELEMENT_TEMPLATE = [ exon_start_offset: null, exon_end: null, exon_end_offset: null, - gene_descriptor: { + gene: { id: "", - gene_id: "", type: "", label: "", }, @@ -136,10 +134,10 @@ const Builder: React.FC = () => { }, []); useEffect(() => { - if (!("structural_elements" in fusion)) { + if (!("structure" in fusion)) { setFusion({ ...fusion, - ...{ structural_elements: [] }, + ...{ structure: [] }, }); } }, [fusion]); @@ -153,11 +151,11 @@ const Builder: React.FC = () => { newItem.element_id = uuid(); if (draggableId.includes("RegulatoryElement")) { - setFusion({ ...fusion, ...{ regulatory_element: newItem } }); + setFusion({ ...fusion, ...{ regulatoryElement: newItem } }); } else { - const destClone = Array.from(fusion.structural_elements); + const destClone = Array.from(fusion.structure); destClone.splice(destination.index, 0, newItem); - setFusion({ ...fusion, ...{ structural_elements: destClone } }); + setFusion({ ...fusion, ...{ structure: destClone } }); } // auto-save elements that don't need any additional input @@ -172,30 +170,28 @@ const Builder: React.FC = () => { const reorder = (result: DropResult) => { const { source, destination } = result; - const sourceClone = Array.from(fusion.structural_elements); + const sourceClone = Array.from(fusion.structure); const [movedElement] = sourceClone.splice(source.index, 1); sourceClone.splice(destination.index, 0, movedElement); - setFusion({ ...fusion, ...{ structural_elements: sourceClone } }); + setFusion({ ...fusion, ...{ structure: sourceClone } }); }; // Update global fusion object const handleSave = (index: number, newElement: ClientElementUnion) => { - const items = Array.from(fusion.structural_elements); + const items = Array.from(fusion.structure); const spliceLength = EDITABLE_ELEMENT_TYPES.includes( newElement.type as ElementType ) ? 1 : 0; items.splice(index, spliceLength, newElement); - setFusion({ ...fusion, ...{ structural_elements: items } }); + setFusion({ ...fusion, ...{ structure: items } }); }; const handleDelete = (uuid: string) => { - let items: Array = Array.from( - fusion.structural_elements - ); + let items: Array = Array.from(fusion.structure); items = items.filter((item) => item?.element_id !== uuid); - setFusion({ ...fusion, ...{ structural_elements: items } }); + setFusion({ ...fusion, ...{ structure: items } }); }; const elementNameMap = { @@ -331,14 +327,14 @@ const Builder: React.FC = () => { } }; - const nomenclatureParts = fusion.structural_elements + const nomenclatureParts = fusion.structure .filter( (element: ClientElementUnion) => Boolean(element) && element.nomenclature ) .map((element: ClientElementUnion) => element.nomenclature); - if (fusion.regulatory_element && fusion.regulatory_element.nomenclature) { - nomenclatureParts.unshift(fusion.regulatory_element.nomenclature); + if (fusion.regulatoryElement && fusion.regulatoryElement.nomenclature) { + nomenclatureParts.unshift(fusion.regulatoryElement.nomenclature); } const nomenclature = nomenclatureParts.map( (nom: string, index: number) => `${index ? "::" : ""}${nom}` @@ -432,7 +428,7 @@ const Builder: React.FC = () => { index={index} isDragDisabled={ type === ElementType.regulatoryElement && - fusion.regulatory_element !== undefined + fusion.regulatoryElement !== undefined } > {(provided, snapshot) => { @@ -447,7 +443,7 @@ const Builder: React.FC = () => { className={ "option-item" + (type === ElementType.regulatoryElement && - fusion.regulatory_element !== undefined + fusion.regulatoryElement !== undefined ? " disabled_reg_element" : "") } @@ -504,20 +500,20 @@ const Builder: React.FC = () => { >

Drag elements here

- {fusion.regulatory_element && ( + {fusion.regulatoryElement && ( <> - {renderElement(fusion?.regulatory_element, 0)} + {renderElement(fusion?.regulatoryElement, 0)} { /> )} - {fusion.structural_elements?.map( + {fusion.structure?.map( (element: ClientElementUnion, index: number) => { return ( element && ( diff --git a/client/src/components/Pages/Structure/Input/GeneElementInput/GeneElementInput.tsx b/client/src/components/Pages/Structure/Input/GeneElementInput/GeneElementInput.tsx index 7b34f4d7..ce3ce8a1 100644 --- a/client/src/components/Pages/Structure/Input/GeneElementInput/GeneElementInput.tsx +++ b/client/src/components/Pages/Structure/Input/GeneElementInput/GeneElementInput.tsx @@ -22,9 +22,7 @@ const GeneElementInput: React.FC = ({ handleDelete, icon, }) => { - const [gene, setGene] = useState( - element.gene_descriptor?.label || "" - ); + const [gene, setGene] = useState(element.gene?.label || ""); const [geneText, setGeneText] = useState(""); const validated = gene !== "" && geneText == ""; const [expanded, setExpanded] = useState(!validated); @@ -35,7 +33,7 @@ const GeneElementInput: React.FC = ({ }, [gene, geneText]); const buildGeneElement = () => { - setPendingResponse(true) + setPendingResponse(true); getGeneElement(gene).then((geneElementResponse) => { if ( geneElementResponse.warnings && @@ -44,7 +42,7 @@ const GeneElementInput: React.FC = ({ setGeneText("Gene not found"); } else if ( geneElementResponse.element && - geneElementResponse.element.gene_descriptor + geneElementResponse.element.gene ) { getGeneNomenclature(geneElementResponse.element).then( (nomenclatureResponse: NomenclatureResponse) => { @@ -58,7 +56,7 @@ const GeneElementInput: React.FC = ({ nomenclature: nomenclatureResponse.nomenclature, }; handleSave(index, clientGeneElement); - setPendingResponse(false) + setPendingResponse(false); } } ); @@ -85,7 +83,7 @@ const GeneElementInput: React.FC = ({ inputElements, validated, icon, - pendingResponse + pendingResponse, }); }; diff --git a/client/src/components/Pages/Structure/Input/LinkerElementInput/LinkerElementInput.tsx b/client/src/components/Pages/Structure/Input/LinkerElementInput/LinkerElementInput.tsx index 90b64319..3b5d3111 100644 --- a/client/src/components/Pages/Structure/Input/LinkerElementInput/LinkerElementInput.tsx +++ b/client/src/components/Pages/Structure/Input/LinkerElementInput/LinkerElementInput.tsx @@ -18,7 +18,7 @@ const LinkerElementInput: React.FC = ({ }) => { // bases const [sequence, setSequence] = useState( - element.linker_sequence?.sequence || "" + element.linkerSequence?.sequence || "" ); const linkerError = Boolean(sequence) && sequence.match(/^([aAgGtTcC]+)?$/) === null; @@ -32,11 +32,10 @@ const LinkerElementInput: React.FC = ({ const buildLinkerElement = () => { const linkerElement: ClientLinkerElement = { ...element, - linker_sequence: { + linkerSequence: { id: `fusor.sequence:${sequence}`, - type: "SequenceDescriptor", + type: "LiteralSequenceExpression", sequence: sequence, - residue_type: "SO:0000348", }, nomenclature: sequence, }; diff --git a/client/src/components/Pages/Structure/Input/RegulatoryElementInput/RegulatoryElementInput.tsx b/client/src/components/Pages/Structure/Input/RegulatoryElementInput/RegulatoryElementInput.tsx index 3bc08c4a..2e6e3e73 100644 --- a/client/src/components/Pages/Structure/Input/RegulatoryElementInput/RegulatoryElementInput.tsx +++ b/client/src/components/Pages/Structure/Input/RegulatoryElementInput/RegulatoryElementInput.tsx @@ -52,7 +52,7 @@ const RegulatoryElementInput: React.FC = ({ const { fusion, setFusion } = useContext(FusionContext); const [regElement, setRegElement] = useState< ClientRegulatoryElement | undefined - >(fusion.regulatory_element); + >(fusion.regulatoryElement); const [elementClass, setElementClass] = useState( regElement?.regulatory_class || "default" @@ -75,7 +75,7 @@ const RegulatoryElementInput: React.FC = ({ if (reResponse.warnings && reResponse.warnings.length > 0) { throw new Error(reResponse.warnings[0]); } - getRegElementNomenclature(reResponse.regulatory_element).then( + getRegElementNomenclature(reResponse.regulatoryElement).then( (nomenclatureResponse) => { if ( nomenclatureResponse.warnings && @@ -84,19 +84,19 @@ const RegulatoryElementInput: React.FC = ({ throw new Error(nomenclatureResponse.warnings[0]); } const newRegElement: ClientRegulatoryElement = { - ...reResponse.regulatory_element, + ...reResponse.regulatoryElement, display_class: regulatoryClassItems[elementClass][1], nomenclature: nomenclatureResponse.nomenclature, }; setRegElement(newRegElement); - setFusion({ ...fusion, ...{ regulatory_element: newRegElement } }); + setFusion({ ...fusion, ...{ regulatoryElement: newRegElement } }); } ); }); }; const handleDeleteElement = () => { - delete fusion.regulatory_element; + delete fusion.regulatoryElement; const cloneFusion = { ...fusion }; setRegElement(undefined); setFusion(cloneFusion); diff --git a/client/src/components/Pages/Structure/Main/Structure.tsx b/client/src/components/Pages/Structure/Main/Structure.tsx index 0f486842..6840b3db 100644 --- a/client/src/components/Pages/Structure/Main/Structure.tsx +++ b/client/src/components/Pages/Structure/Main/Structure.tsx @@ -41,8 +41,8 @@ export const Structure: React.FC = () => { Drag and rearrange elements. { // TODO -- how to interact w/ reg element count? - fusion.structural_elements?.length + - (fusion.regulatory_element !== undefined) >= + fusion.structure?.length + + (fusion.regulatoryElement !== undefined) >= 2 ? null : ( {" "} diff --git a/client/src/components/Pages/Summary/Invalid/Invalid.tsx b/client/src/components/Pages/Summary/Invalid/Invalid.tsx index 8672978c..757bdf02 100644 --- a/client/src/components/Pages/Summary/Invalid/Invalid.tsx +++ b/client/src/components/Pages/Summary/Invalid/Invalid.tsx @@ -52,7 +52,8 @@ export const Invalid: React.FC = ({ const duplicateGeneError = (duplicateGenes: string[]) => { return ( - Duplicate gene element(s) detected: {duplicateGenes.join(", ")}. Per the{" "} + Duplicate gene element(s) detected: {duplicateGenes.join(", ")}. + Per the{" "} = ({ > Gene Fusion Specification - , Internal Tandem Duplications are not considered gene fusions, as they do not involve an interaction - between two or more genes.{" "} + , Internal Tandem Duplications are not considered gene fusions, as they + do not involve an interaction between two or more genes.{" "} setVisibleTab(0)}> Edit elements to resolve. - ) + ); }; const elementNumberError = ( @@ -107,32 +108,33 @@ export const Invalid: React.FC = ({ ); - const geneElements = fusion.structural_elements.filter(el => el.type === "GeneElement").map(el => { return el.nomenclature }) - const findDuplicates = arr => arr.filter((item, index) => arr.indexOf(item) !== index) - const duplicateGenes = findDuplicates(geneElements) + const geneElements = fusion.structure + .filter((el) => el.type === "GeneElement") + .map((el) => { + return el.nomenclature; + }); + const findDuplicates = (arr) => + arr.filter((item, index) => arr.indexOf(item) !== index); + const duplicateGenes = findDuplicates(geneElements); const checkErrors = () => { const errorElements: React.ReactFragment[] = []; - if ( - Boolean(fusion.regulatory_element) + fusion.structural_elements.length < - 2 - ) { + if (Boolean(fusion.regulatoryElement) + fusion.structure.length < 2) { errorElements.push(elementNumberError); } else { - const containsGene = fusion.structural_elements.some( - (e: ClientElementUnion) => - [ - "GeneElement", - "TranscriptSegmentElement", - "TemplatedSequenceElement", - ].includes(e.type) + const containsGene = fusion.structure.some((e: ClientElementUnion) => + [ + "GeneElement", + "TranscriptSegmentElement", + "TemplatedSequenceElement", + ].includes(e.type) ); - if (!containsGene && !fusion.regulatory_element) { + if (!containsGene && !fusion.regulatoryElement) { errorElements.push(noGeneElementsError); } } if (duplicateGenes.length > 0) { - errorElements.push(duplicateGeneError(duplicateGenes)) + errorElements.push(duplicateGeneError(duplicateGenes)); } if (errorElements.length == 0) { errorElements.push( diff --git a/client/src/components/Pages/Summary/JSON/SummaryJSON.tsx b/client/src/components/Pages/Summary/JSON/SummaryJSON.tsx index 90045b22..1e4a170e 100644 --- a/client/src/components/Pages/Summary/JSON/SummaryJSON.tsx +++ b/client/src/components/Pages/Summary/JSON/SummaryJSON.tsx @@ -34,13 +34,13 @@ export const SummaryJSON: React.FC = ({ fusion }) => { * transmit to validation endpoint, and update local copy. */ useEffect(() => { - const structuralElements: ElementUnion[] = fusion.structural_elements?.map( + const structuralElements: ElementUnion[] = fusion.structure?.map( (element: ClientElementUnion) => { switch (element.type) { case "GeneElement": const geneElement: GeneElement = { type: element.type, - gene_descriptor: element.gene_descriptor, + gene: element.gene, }; return geneElement; case "LinkerSequenceElement": @@ -64,7 +64,7 @@ export const SummaryJSON: React.FC = ({ fusion }) => { exon_start_offset: element.exon_start_offset, exon_end: element.exon_end, exon_end_offset: element.exon_end_offset, - gene_descriptor: element.gene_descriptor, + gene: element.gene, element_genomic_start: element.element_genomic_start, element_genomic_end: element.element_genomic_end, }; @@ -82,23 +82,23 @@ export const SummaryJSON: React.FC = ({ fusion }) => { } } ); - const regulatoryElements = fusion.regulatory_elements?.map((re) => ({ + const regulatoryElements = fusion.regulatoryElements?.map((re) => ({ type: re.type, associated_gene: re.associated_gene, regulatory_class: re.regulatory_class, - feature_id: re.feature_id, + featureId: re.featureId, genomic_location: re.genomic_location, })); let formattedFusion: AssayedFusion | CategoricalFusion; if (fusion.type === "AssayedFusion") { formattedFusion = { ...fusion, - structural_elements: structuralElements, - regulatory_elements: regulatoryElements, + structure: structuralElements, + regulatoryElements: regulatoryElements, }; } else { const criticalDomains: FunctionalDomain[] = - fusion.critical_functional_domains?.map((domain) => ({ + fusion.criticalFunctionalDomains?.map((domain) => ({ _id: domain._id, label: domain.label, status: domain.status, @@ -107,9 +107,9 @@ export const SummaryJSON: React.FC = ({ fusion }) => { })); formattedFusion = { ...fusion, - structural_elements: structuralElements, - regulatory_elements: regulatoryElements, - critical_functional_domains: criticalDomains, + structure: structuralElements, + regulatoryElements: regulatoryElements, + criticalFunctionalDomains: criticalDomains, }; } diff --git a/client/src/components/Pages/Summary/Main/Summary.tsx b/client/src/components/Pages/Summary/Main/Summary.tsx index 6854acd1..0e820d55 100644 --- a/client/src/components/Pages/Summary/Main/Summary.tsx +++ b/client/src/components/Pages/Summary/Main/Summary.tsx @@ -48,7 +48,7 @@ export const Summary: React.FC = ({ setVisibleTab }) => { case "GeneElement": const geneElement: GeneElement = { type: element.type, - gene_descriptor: element.gene_descriptor, + gene: element.gene, }; return geneElement; case "LinkerSequenceElement": @@ -72,7 +72,7 @@ export const Summary: React.FC = ({ setVisibleTab }) => { exon_start_offset: element.exon_start_offset, exon_end: element.exon_end, exon_end_offset: element.exon_end_offset, - gene_descriptor: element.gene_descriptor, + gene: element.gene, element_genomic_start: element.element_genomic_start, element_genomic_end: element.element_genomic_end, }; @@ -119,29 +119,29 @@ export const Summary: React.FC = ({ setVisibleTab }) => { * transmit to validation endpoint, and update local copy. */ useEffect(() => { - const structuralElements: ElementUnion[] = fusion.structural_elements?.map( + const structuralElements: ElementUnion[] = fusion.structure?.map( (element: ClientElementUnion) => fusorifyStructuralElement(element) ); let regulatoryElement: RegulatoryElement | null = null; - if (fusion.regulatory_element) { + if (fusion.regulatoryElement) { regulatoryElement = { - type: fusion.regulatory_element.type, - associated_gene: fusion.regulatory_element.associated_gene, - regulatory_class: fusion.regulatory_element.regulatory_class, - feature_id: fusion.regulatory_element.feature_id, - feature_location: fusion.regulatory_element.feature_location, + type: fusion.regulatoryElement.type, + associated_gene: fusion.regulatoryElement.associated_gene, + regulatory_class: fusion.regulatoryElement.regulatory_class, + featureId: fusion.regulatoryElement.featureId, + feature_location: fusion.regulatoryElement.feature_location, }; } let formattedFusion: AssayedFusion | CategoricalFusion; if (fusion.type === "AssayedFusion") { formattedFusion = { ...fusion, - structural_elements: structuralElements, - regulatory_element: regulatoryElement, + structure: structuralElements, + regulatoryElement: regulatoryElement, }; } else { const criticalDomains: FunctionalDomain[] = - fusion.critical_functional_domains?.map((domain: FunctionalDomain) => ({ + fusion.criticalFunctionalDomains?.map((domain: FunctionalDomain) => ({ _id: domain._id, label: domain.label, status: domain.status, @@ -150,9 +150,9 @@ export const Summary: React.FC = ({ setVisibleTab }) => { })); formattedFusion = { ...fusion, - structural_elements: structuralElements, - regulatory_element: regulatoryElement, - critical_functional_domains: criticalDomains, + structure: structuralElements, + regulatoryElement: regulatoryElement, + criticalFunctionalDomains: criticalDomains, }; } requestValidatedFusion(formattedFusion); diff --git a/client/src/components/Pages/Summary/Readable/Readable.tsx b/client/src/components/Pages/Summary/Readable/Readable.tsx index 291464f2..ffccfe86 100644 --- a/client/src/components/Pages/Summary/Readable/Readable.tsx +++ b/client/src/components/Pages/Summary/Readable/Readable.tsx @@ -31,8 +31,8 @@ export const Readable: React.FC = ({ validatedFusion }) => { ); }, [validatedFusion]); - const assayName = fusion.assay?.assay_name ? fusion.assay.assay_name : "" - const assayId = fusion.assay?.assay_id ? `(${fusion.assay.assay_id})` : "" + const assayName = fusion.assay?.assayName ? fusion.assay.assayName : ""; + const assayId = fusion.assay?.assayId ? `(${fusion.assay.assayId})` : ""; /** * Render rows specific to assayed fusion fields @@ -46,7 +46,7 @@ export const Readable: React.FC = ({ validatedFusion }) => { - {eventDisplayMap[fusion.causative_event?.event_type] || ""} + {eventDisplayMap[fusion.causativeEvent?.eventType] || ""} @@ -55,7 +55,9 @@ export const Readable: React.FC = ({ validatedFusion }) => { Assay - {fusion.assay ? `${assayName} ${assayId}` : ""} + + {fusion.assay ? `${assayName} ${assayId}` : ""} + @@ -72,9 +74,9 @@ export const Readable: React.FC = ({ validatedFusion }) => { Functional domains - {fusion.critical_functional_domains && - fusion.critical_functional_domains.length > 0 && - fusion.critical_functional_domains.map((domain, index) => ( + {fusion.criticalFunctionalDomains && + fusion.criticalFunctionalDomains.length > 0 && + fusion.criticalFunctionalDomains.map((domain, index) => ( {`${domain.status}: ${domain.label}`} @@ -87,9 +89,9 @@ export const Readable: React.FC = ({ validatedFusion }) => { - {fusion.r_frame_preserved === true + {fusion.readingFramePreserved === true ? "Preserved" - : fusion.r_frame_preserved === false + : fusion.readingFramePreserved === false ? "Not preserved" : "Unspecified"} @@ -111,7 +113,7 @@ export const Readable: React.FC = ({ validatedFusion }) => { Structure - {fusion.structural_elements.map( + {fusion.structure.map( (element: ClientStructuralElement, index: number) => ( ) @@ -123,8 +125,8 @@ export const Readable: React.FC = ({ validatedFusion }) => { Regulatory Element - {fusion.regulatory_element ? ( - + {fusion.regulatoryElement ? ( + ) : ( "" )} diff --git a/client/src/components/main/App/App.tsx b/client/src/components/main/App/App.tsx index 483ec9e4..34056944 100644 --- a/client/src/components/main/App/App.tsx +++ b/client/src/components/main/App/App.tsx @@ -37,7 +37,7 @@ import { ClientAssayedFusion, ClientCategoricalFusion, DomainParams, - GeneDescriptor, + Gene, } from "../../../services/ResponseModels"; import LandingPage from "../Landing/LandingPage"; import AppMenu from "./AppMenu"; @@ -51,13 +51,13 @@ import { type ClientFusion = ClientCategoricalFusion | ClientAssayedFusion; -type GenesLookup = Record; +type GenesLookup = Record; type DomainOptionsLookup = Record; const path = window.location.pathname; const defaultFusion: ClientFusion = { - structural_elements: [], + structure: [], type: path.includes("/assayed-fusion") ? "AssayedFusion" : "CategoricalFusion", @@ -96,33 +96,26 @@ const App = (): JSX.Element => { useEffect(() => { const newGenes = {}; const remainingGeneIds: Array = []; - fusion.structural_elements.forEach((comp: ClientElementUnion) => { + fusion.structure.forEach((comp: ClientElementUnion) => { if ( comp && comp.type && (comp.type === "GeneElement" || comp.type === "TranscriptSegmentElement") && - comp.gene_descriptor?.gene_id + comp.gene?.id ) { - remainingGeneIds.push(comp.gene_descriptor.gene_id); - if ( - comp.gene_descriptor.gene_id && - !(comp.gene_descriptor.gene_id in globalGenes) - ) { - newGenes[comp.gene_descriptor.gene_id] = comp.gene_descriptor; + remainingGeneIds.push(comp.gene.id); + if (comp.gene.id && !(comp.gene.id in globalGenes)) { + newGenes[comp.gene.id] = comp.gene; } } }); - if (fusion.regulatory_element) { - if (fusion.regulatory_element.associated_gene?.gene_id) { - remainingGeneIds.push( - fusion.regulatory_element.associated_gene.gene_id - ); - if ( - !(fusion.regulatory_element.associated_gene.gene_id in globalGenes) - ) { - newGenes[fusion.regulatory_element.associated_gene.gene_id] = - fusion.regulatory_element.associated_gene; + if (fusion.regulatoryElement) { + if (fusion.regulatoryElement.associatedGene?.id) { + remainingGeneIds.push(fusion.regulatoryElement.associatedGene.id); + if (!(fusion.regulatoryElement.associatedGene.id in globalGenes)) { + newGenes[fusion.regulatoryElement.associatedGene.id] = + fusion.regulatoryElement.associatedGene; } } } @@ -176,38 +169,38 @@ const App = (): JSX.Element => { */ const fusionIsEmpty = () => { if ( - fusion?.structural_elements.length === 0 && - fusion?.regulatory_element === undefined + fusion?.structure.length === 0 && + fusion?.regulatoryElement === undefined ) { return true; - } else if (fusion.structural_elements.length > 0) { + } else if (fusion.structure.length > 0) { return false; - } else if (fusion.regulatory_element) { + } else if (fusion.regulatoryElement) { return false; } else if (fusion.type == "AssayedFusion") { if ( fusion.assay && - (fusion.assay.assay_name || - fusion.assay.assay_id || - fusion.assay.method_uri || - fusion.assay.fusion_detection) + (fusion.assay.assayName || + fusion.assay.assayId || + fusion.assay.methodUri || + fusion.assay.fusionDetection) ) { return false; } if ( - fusion.causative_event && - (fusion.causative_event.event_type || - fusion.causative_event.event_description) + fusion.causativeEvent && + (fusion.causativeEvent.eventType || + fusion.causativeEvent.eventDescription) ) { return false; } } else if (fusion.type == "CategoricalFusion") { - if (fusion.r_frame_preserved !== undefined) { + if (fusion.readingFramePreserved !== undefined) { return false; } if ( - fusion.critical_functional_domains && - fusion.critical_functional_domains.length > 0 + fusion.criticalFunctionalDomains && + fusion.criticalFunctionalDomains.length > 0 ) { return false; } diff --git a/client/src/services/ResponseModels.ts b/client/src/services/ResponseModels.ts index de0ade5a..f9674871 100644 --- a/client/src/services/ResponseModels.ts +++ b/client/src/services/ResponseModels.ts @@ -428,18 +428,18 @@ export interface Assay { */ export interface AssociatedDomainResponse { warnings: string[] | null; - gene_id: string; + geneId: string; suggestions: DomainParams[] | null; } /** * Fields for individual domain suggestion entries */ export interface DomainParams { - interpro_id: string; - domain_name: string; + interproId: string; + domainName: string; start: number; end: number; - refseq_ac: string; + refseqAc: string; } /** * Categorical gene fusions are generalized concepts representing a class @@ -490,25 +490,17 @@ export interface FunctionalDomain { */ export interface ClientAssayedFusion { type?: "AssayedFusion"; - regulatoryElement?: RegulatoryElement | null; + regulatoryElement?: ClientRegulatoryElement | null; structure: ( - | TranscriptSegmentElement - | GeneElement - | TemplatedSequenceElement - | LinkerElement - | UnknownGeneElement - )[]; - readingFramePreserved?: boolean | null; - causativeEvent?: CausativeEvent | null; - assay?: Assay | null; - regulatory_element?: ClientRegulatoryElement | null; - structural_elements: ( | ClientTranscriptSegmentElement | ClientGeneElement | ClientTemplatedSequenceElement | ClientLinkerElement | ClientUnknownGeneElement )[]; + readingFramePreserved?: boolean | null; + causativeEvent?: CausativeEvent | null; + assay?: Assay | null; } /** * Define regulatory element object used client-side. @@ -519,14 +511,14 @@ export interface ClientRegulatoryElement { featureId?: string | null; associatedGene?: Gene | null; featureLocation?: SequenceLocation | null; - display_class: string; + displayClass: string; nomenclature: string; } /** * TranscriptSegment element class used client-side. */ export interface ClientTranscriptSegmentElement { - element_id: string; + elementId: string; nomenclature: string; type?: "TranscriptSegmentElement"; transcript: string; @@ -537,23 +529,23 @@ export interface ClientTranscriptSegmentElement { gene: Gene; elementGenomicStart?: SequenceLocation | null; elementGenomicEnd?: SequenceLocation | null; - input_type: "genomic_coords_gene" | "genomic_coords_tx" | "exon_coords_tx"; - input_tx: string | null; - input_strand: Strand | null; - input_gene: string | null; - input_chr: string | null; - input_genomic_start: string | null; - input_genomic_end: string | null; - input_exon_start: string | null; - input_exon_start_offset: string | null; - input_exon_end: string | null; - input_exon_end_offset: string | null; + inputType: "genomic_coords_gene" | "genomic_coords_tx" | "exon_coords_tx"; + inputTx: string | null; + inputStrand: Strand | null; + inputGene: string | null; + inputChr: string | null; + inputGenomicStart: string | null; + inputGenomicEnd: string | null; + inputExonStart: string | null; + inputExonStartOffset: string | null; + inputExonEnd: string | null; + inputExonEndOffset: string | null; } /** * Gene element used client-side. */ export interface ClientGeneElement { - element_id: string; + elementId: string; nomenclature: string; type?: "GeneElement"; gene: Gene; @@ -562,20 +554,20 @@ export interface ClientGeneElement { * Templated sequence element used client-side. */ export interface ClientTemplatedSequenceElement { - element_id: string; + elementId: string; nomenclature: string; type?: "TemplatedSequenceElement"; region: SequenceLocation; strand: Strand; - input_chromosome: string | null; - input_start: string | null; - input_end: string | null; + inputChromosome: string | null; + inputStart: string | null; + inputEnd: string | null; } /** * Linker element class used client-side. */ export interface ClientLinkerElement { - element_id: string; + elementId: string; nomenclature: string; type?: "LinkerSequenceElement"; linkerSequence: LiteralSequenceExpression; @@ -584,7 +576,7 @@ export interface ClientLinkerElement { * Unknown gene element used client-side. */ export interface ClientUnknownGeneElement { - element_id: string; + elementId: string; nomenclature: string; type?: "UnknownGeneElement"; } @@ -594,31 +586,22 @@ export interface ClientUnknownGeneElement { */ export interface ClientCategoricalFusion { type?: "CategoricalFusion"; - regulatoryElement?: RegulatoryElement | null; + regulatoryElement?: ClientRegulatoryElement | null; structure: ( - | TranscriptSegmentElement - | GeneElement - | TemplatedSequenceElement - | LinkerElement - | MultiplePossibleGenesElement - )[]; - readingFramePreserved?: boolean | null; - criticalFunctionalDomains?: FunctionalDomain[] | null; - regulatory_element?: ClientRegulatoryElement | null; - structural_elements: ( | ClientTranscriptSegmentElement | ClientGeneElement | ClientTemplatedSequenceElement | ClientLinkerElement | ClientMultiplePossibleGenesElement )[]; - critical_functional_domains: ClientFunctionalDomain[] | null; + readingFramePreserved?: boolean | null; + criticalFunctionalDomains: ClientFunctionalDomain[] | null; } /** * Multiple possible gene element used client-side. */ export interface ClientMultiplePossibleGenesElement { - element_id: string; + elementId: string; nomenclature: string; type?: "MultiplePossibleGenesElement"; } @@ -632,13 +615,13 @@ export interface ClientFunctionalDomain { id: string | null; label?: string | null; sequenceLocation?: SequenceLocation | null; - domain_id: string; + domainId: string; } /** * Abstract class to provide identification properties used by client. */ export interface ClientStructuralElement { - element_id: string; + elementId: string; nomenclature: string; } /** @@ -646,7 +629,7 @@ export interface ClientStructuralElement { */ export interface CoordsUtilsResponse { warnings: string[] | null; - coordinates_data: GenomicData | null; + coordinatesData: GenomicData | null; } /** * Model containing genomic and transcript exon data. @@ -674,12 +657,12 @@ export interface DemoResponse { * Request model for genomic coordinates retrieval */ export interface ExonCoordsRequest { - tx_ac: string; + txAc: string; gene?: string | null; - exon_start?: number | null; - exon_start_offset?: number | null; - exon_end?: number | null; - exon_end_offset?: number | null; + exonStart?: number | null; + exonStartOffset?: number | null; + exonEnd?: number | null; + exonEndOffset?: number | null; } /** * Response model for gene element construction endoint. @@ -734,7 +717,7 @@ export interface NomenclatureResponse { export interface NormalizeGeneResponse { warnings: string[] | null; term: string; - concept_id: string | null; + conceptId: string | null; symbol: string | null; cased: string | null; } @@ -743,7 +726,7 @@ export interface NormalizeGeneResponse { */ export interface RegulatoryElementResponse { warnings: string[] | null; - regulatory_element: RegulatoryElement; + regulatoryElement: RegulatoryElement; } /** * Abstract Response class for defining API response structures. @@ -757,8 +740,8 @@ export interface Response { export interface SequenceIDResponse { warnings: string[] | null; sequence: string; - refseq_id: string | null; - ga4gh_id: string | null; + refseqId: string | null; + ga4ghId: string | null; aliases: string[] | null; } /** @@ -776,10 +759,10 @@ export interface ServiceInfoResponse { export interface SuggestGeneResponse { warnings: string[] | null; term: string; - matches_count: number; - concept_id: [unknown, unknown, unknown, unknown, unknown][] | null; + matchesCount: number; + conceptId: [unknown, unknown, unknown, unknown, unknown][] | null; symbol: [unknown, unknown, unknown, unknown, unknown][] | null; - prev_symbols: [unknown, unknown, unknown, unknown, unknown][] | null; + prevSymbols: [unknown, unknown, unknown, unknown, unknown][] | null; aliases: [unknown, unknown, unknown, unknown, unknown][] | null; } /** diff --git a/client/src/services/main.tsx b/client/src/services/main.tsx index 9c15b889..8ffc14ad 100644 --- a/client/src/services/main.tsx +++ b/client/src/services/main.tsx @@ -217,9 +217,9 @@ export const getFunctionalDomain = async ( geneId: string ): Promise => { const url = - `/api/construct/domain?status=${domainStatus}&name=${domain.domain_name}` + - `&domain_id=${domain.interpro_id}&gene_id=${geneId}` + - `&sequence_id=${domain.refseq_ac}&start=${domain.start}&end=${domain.end}`; + `/api/construct/domain?status=${domainStatus}&name=${domain.domainName}` + + `&domain_id=${domain.interproId}&gene_id=${geneId}` + + `&sequence_id=${domain.refseqAc}&start=${domain.start}&end=${domain.end}`; const response = await fetch(url); const responseJson = await response.json(); return responseJson; @@ -308,7 +308,7 @@ export const getInfo = async (): Promise => { export const getRegElementNomenclature = async ( regulatoryElement: RegulatoryElement ): Promise => { - const response = await fetch("/api/nomenclature/regulatory_element", { + const response = await fetch("/api/nomenclature/regulatoryElement", { method: "POST", headers: { Accept: "application/json", @@ -411,7 +411,7 @@ export const getRegulatoryElement = async ( geneName: string ): Promise => { const response = await fetch( - `/api/construct/regulatory_element?element_class=${regulatoryClass}&gene_name=${geneName}` + `/api/construct/regulatoryElement?element_class=${regulatoryClass}&gene_name=${geneName}` ); const responseJson = await response.json(); return responseJson; diff --git a/server/pyproject.toml b/server/pyproject.toml index 92737489..7cd3b795 100644 --- a/server/pyproject.toml +++ b/server/pyproject.toml @@ -161,9 +161,12 @@ ignore = [ # INP001 - implicit-namespace-package # ARG001 - unused-function-argument # B008 - function-call-in-default-argument +# N803 - invalid-argument-name +# N805 - invalid-first-argument-name-for-method +# N815 - mixed-case-variable-in-class-scope "**/tests/*" = ["ANN001", "ANN2", "ANN102", "S101", "B011", "INP001", "ARG001"] "*__init__.py" = ["F401"] -"**/src/curfu/schemas.py" = ["ANN201", "N805", "ANN001"] +"**/src/curfu/schemas.py" = ["ANN201", "N805", "ANN001", "N803", "N805", "N815"] "**/src/curfu/routers/*" = ["D301", "B008"] "**/src/curfu/cli.py" = ["D301"] diff --git a/server/src/curfu/devtools/build_interpro.py b/server/src/curfu/devtools/build_interpro.py index 17fddb8d..3460569e 100644 --- a/server/src/curfu/devtools/build_interpro.py +++ b/server/src/curfu/devtools/build_interpro.py @@ -85,8 +85,8 @@ def get_uniprot_refs() -> UniprotRefs: if uniprot_id in uniprot_ids: continue norm_response = q.normalize(uniprot_id) - norm_id = norm_response.gene_descriptor.gene_id - norm_label = norm_response.gene_descriptor.label + norm_id = norm_response.gene.gene_id + norm_label = norm_response.gene.label uniprot_ids[uniprot_id] = (norm_id, norm_label) if not last_evaluated_key: break diff --git a/server/src/curfu/domain_services.py b/server/src/curfu/domain_services.py index 920545a7..a4239ead 100644 --- a/server/src/curfu/domain_services.py +++ b/server/src/curfu/domain_services.py @@ -38,11 +38,11 @@ def load_mapping(self) -> None: for row in reader: gene_id = row[0].lower() domain_data = { - "interpro_id": f"interpro:{row[2]}", - "domain_name": row[3], + "interproId": f"interpro:{row[2]}", + "domainName": row[3], "start": int(row[4]), "end": int(row[5]), - "refseq_ac": f"{row[6]}", + "refseqAc": f"{row[6]}", } if gene_id in self.domains: self.domains[gene_id].append(domain_data) diff --git a/server/src/curfu/gene_services.py b/server/src/curfu/gene_services.py index 5bebac50..2349a251 100644 --- a/server/src/curfu/gene_services.py +++ b/server/src/curfu/gene_services.py @@ -58,7 +58,7 @@ def get_normalized_gene( """ response = normalizer.normalize(term) if response.match_type != MatchType.NO_MATCH: - gd = response.gene_descriptor + gd = response.gene if not gd or not gd.gene_id: msg = f"Unexpected null property in normalized response for `{term}`" logger.error(msg) @@ -105,7 +105,7 @@ def get_normalized_gene( break if not term_cased: logger.warning( - f"Couldn't find cased version for search term {term} matching gene ID {response.gene_descriptor.gene_id}" + f"Couldn't find cased version for search term {term} matching gene ID {response.gene.gene_id}" ) return (concept_id, symbol, term_cased) warn = f"Lookup of gene term {term} failed." diff --git a/server/src/curfu/routers/demo.py b/server/src/curfu/routers/demo.py index 2434479a..37cc189d 100644 --- a/server/src/curfu/routers/demo.py +++ b/server/src/curfu/routers/demo.py @@ -121,32 +121,32 @@ def clientify_fusion(fusion: Fusion, fusor_instance: FUSOR) -> ClientFusion: fusion_args = fusion.dict() client_elements = [ clientify_structural_element(element, fusor_instance) - for element in fusion.structural_elements + for element in fusion.structure ] - fusion_args["structural_elements"] = client_elements + fusion_args["structure"] = client_elements - if fusion_args.get("regulatory_element"): - reg_element_args = fusion_args["regulatory_element"] + if fusion_args.get("regulatoryElement"): + reg_element_args = fusion_args["regulatoryElement"] nomenclature = reg_element_nomenclature( RegulatoryElement(**reg_element_args), fusor_instance.seqrepo ) reg_element_args["nomenclature"] = nomenclature - regulatory_class = fusion_args["regulatory_element"]["regulatory_class"] + regulatory_class = fusion_args["regulatoryElement"]["regulatory_class"] if regulatory_class == "enhancer": reg_element_args["display_class"] = "Enhancer" else: msg = "Undefined reg element class used in demo" raise Exception(msg) - fusion_args["regulatory_element"] = reg_element_args + fusion_args["regulatoryElement"] = reg_element_args if fusion.type == FUSORTypes.CATEGORICAL_FUSION: - if fusion.critical_functional_domains: + if fusion.criticalFunctionalDomains: client_domains = [] - for domain in fusion.critical_functional_domains: + for domain in fusion.criticalFunctionalDomains: client_domain = domain.dict() client_domain["domain_id"] = str(uuid4()) client_domains.append(client_domain) - fusion_args["critical_functional_domains"] = client_domains + fusion_args["criticalFunctionalDomains"] = client_domains return ClientCategoricalFusion(**fusion_args) if fusion.type == FUSORTypes.ASSAYED_FUSION: return ClientAssayedFusion(**fusion_args) diff --git a/server/src/curfu/routers/utilities.py b/server/src/curfu/routers/utilities.py index bdfc650a..5dbb991a 100644 --- a/server/src/curfu/routers/utilities.py +++ b/server/src/curfu/routers/utilities.py @@ -39,9 +39,9 @@ def get_mane_transcripts(request: Request, term: str) -> dict: normalized = request.app.state.fusor.gene_normalizer.normalize(term) if normalized.match_type == gene_schemas.MatchType.NO_MATCH: return {"warnings": [f"Normalization error: {term}"]} - if not normalized.gene_descriptor.gene_id.lower().startswith("hgnc"): + if not normalized.gene.id.lower().startswith("hgnc"): return {"warnings": [f"No HGNC symbol: {term}"]} - symbol = normalized.gene_descriptor.label + symbol = normalized.gene.label transcripts = request.app.state.fusor.cool_seq_tool.mane_transcript_mappings.get_gene_mane_data( symbol ) @@ -99,7 +99,7 @@ async def get_genome_coords( if warnings: for warning in warnings: logger.warning(warning) - return CoordsUtilsResponse(warnings=warnings, coordinates_data=None) + return CoordsUtilsResponse(warnings=warnings, coordinatesData=None) # TODO necessary for now if exon_start is not None and exon_start_offset is None: @@ -120,9 +120,9 @@ async def get_genome_coords( ) warnings = response.warnings if warnings: - return CoordsUtilsResponse(warnings=warnings, coordinates_data=None) + return CoordsUtilsResponse(warnings=warnings, coordinatesData=None) - return CoordsUtilsResponse(coordinates_data=response.genomic_data, warnings=None) + return CoordsUtilsResponse(coordinatesData=response.genomic_data, warnings=None) @router.get( @@ -168,7 +168,7 @@ async def get_exon_coords( if warnings: for warning in warnings: logger.warning(warning) - return CoordsUtilsResponse(warnings=warnings, coordinates_data=None) + return CoordsUtilsResponse(warnings=warnings, coordinatesData=None) response = await request.app.state.fusor.cool_seq_tool.genomic_to_transcript_exon_coordinates( chromosome, @@ -180,9 +180,9 @@ async def get_exon_coords( ) warnings = response.warnings if warnings: - return CoordsUtilsResponse(warnings=warnings, coordinates_data=None) + return CoordsUtilsResponse(warnings=warnings, coordinatesData=None) - return CoordsUtilsResponse(coordinates_data=response.genomic_data, warnings=None) + return CoordsUtilsResponse(coordinatesData=response.genomic_data, warnings=None) @router.get( diff --git a/server/src/curfu/schemas.py b/server/src/curfu/schemas.py index eadd5a82..8fcf653c 100644 --- a/server/src/curfu/schemas.py +++ b/server/src/curfu/schemas.py @@ -32,28 +32,28 @@ class ClientStructuralElement(BaseModel): """Abstract class to provide identification properties used by client.""" - element_id: StrictStr + elementId: StrictStr nomenclature: StrictStr class ClientTranscriptSegmentElement(TranscriptSegmentElement, ClientStructuralElement): """TranscriptSegment element class used client-side.""" - input_type: ( + inputType: ( Literal["genomic_coords_gene"] | Literal["genomic_coords_tx"] | Literal["exon_coords_tx"] ) - input_tx: str | None - input_strand: Strand | None - input_gene: str | None - input_chr: str | None - input_genomic_start: str | None - input_genomic_end: str | None - input_exon_start: str | None - input_exon_start_offset: str | None - input_exon_end: str | None - input_exon_end_offset: str | None + inputTx: str | None + inputStrand: Strand | None + inputGene: str | None + inputChr: str | None + inputGenomicStart: str | None + inputGenomicEnd: str | None + inputExonStart: str | None + inputExonStartOffset: str | None + inputExonEnd: str | None + inputExonEndOffset: str | None class ClientLinkerElement(LinkerElement, ClientStructuralElement): @@ -63,9 +63,9 @@ class ClientLinkerElement(LinkerElement, ClientStructuralElement): class ClientTemplatedSequenceElement(TemplatedSequenceElement, ClientStructuralElement): """Templated sequence element used client-side.""" - input_chromosome: str | None - input_start: str | None - input_end: str | None + inputChromosome: str | None + inputStart: str | None + inputEnd: str | None class ClientGeneElement(GeneElement, ClientStructuralElement): @@ -85,7 +85,7 @@ class ClientMultiplePossibleGenesElement( class ClientFunctionalDomain(FunctionalDomain): """Define functional domain object used client-side.""" - domain_id: str + domainId: str class Config: """Configure class.""" @@ -96,7 +96,7 @@ class Config: class ClientRegulatoryElement(RegulatoryElement): """Define regulatory element object used client-side.""" - display_class: str + displayClass: str nomenclature: str @@ -133,7 +133,7 @@ class NormalizeGeneResponse(Response): """Response model for gene normalization endpoint.""" term: StrictStr - concept_id: StrictStr | None + conceptId: StrictStr | None symbol: StrictStr | None cased: StrictStr | None @@ -142,22 +142,22 @@ class SuggestGeneResponse(Response): """Response model for gene autocomplete suggestions endpoint.""" term: StrictStr - matches_count: int + matchesCount: int # complete term, normalized symbol, normalized concept ID, chromosome ID, strand - concept_id: list[tuple[str, str, str, str, str]] | None + conceptId: list[tuple[str, str, str, str, str]] | None symbol: list[tuple[str, str, str, str, str]] | None - prev_symbols: list[tuple[str, str, str, str, str]] | None + prevSymbols: list[tuple[str, str, str, str, str]] | None aliases: list[tuple[str, str, str, str, str]] | None class DomainParams(BaseModel): """Fields for individual domain suggestion entries""" - interpro_id: StrictStr - domain_name: StrictStr + interproId: StrictStr + domainName: StrictStr start: int end: int - refseq_ac: StrictStr + refseqAc: StrictStr class GetDomainResponse(Response): @@ -169,7 +169,7 @@ class GetDomainResponse(Response): class AssociatedDomainResponse(Response): """Response model for domain ID autocomplete suggestion endpoint.""" - gene_id: StrictStr + geneId: StrictStr suggestions: list[DomainParams] | None @@ -182,12 +182,12 @@ class ValidateFusionResponse(Response): class ExonCoordsRequest(BaseModel): """Request model for genomic coordinates retrieval""" - tx_ac: StrictStr + txAc: StrictStr gene: StrictStr | None = "" - exon_start: StrictInt | None = 0 - exon_start_offset: StrictInt | None = 0 - exon_end: StrictInt | None = 0 - exon_end_offset: StrictInt | None = 0 + exonStart: StrictInt | None = 0 + exonStartOffset: StrictInt | None = 0 + exonEnd: StrictInt | None = 0 + exonEndOffset: StrictInt | None = 0 @validator("gene") def validate_gene(cls, v) -> str: @@ -196,7 +196,7 @@ def validate_gene(cls, v) -> str: return "" return v - @validator("exon_start", "exon_start_offset", "exon_end", "exon_end_offset") + @validator("exonStart", "exonStartOffset", "exonEnd", "exonEndOffset") def validate_number(cls, v) -> int: """Replace None with 0 for numeric fields.""" if v is None: @@ -207,15 +207,15 @@ def validate_number(cls, v) -> int: class CoordsUtilsResponse(Response): """Response model for genomic coordinates retrieval""" - coordinates_data: GenomicData | None + coordinatesData: GenomicData | None class SequenceIDResponse(Response): """Response model for sequence ID retrieval endpoint.""" sequence: StrictStr - refseq_id: StrictStr | None - ga4gh_id: StrictStr | None + refseqId: StrictStr | None + ga4ghId: StrictStr | None aliases: list[StrictStr] | None @@ -262,15 +262,15 @@ class ClientCategoricalFusion(CategoricalFusion): global FusionContext. """ - regulatory_element: ClientRegulatoryElement | None = None - structural_elements: list[ + regulatoryElement: ClientRegulatoryElement | None = None + structure: list[ ClientTranscriptSegmentElement | ClientGeneElement | ClientTemplatedSequenceElement | ClientLinkerElement | ClientMultiplePossibleGenesElement ] - critical_functional_domains: list[ClientFunctionalDomain] | None + criticalFunctionalDomains: list[ClientFunctionalDomain] | None class ClientAssayedFusion(AssayedFusion): @@ -278,8 +278,8 @@ class ClientAssayedFusion(AssayedFusion): global FusionContext. """ - regulatory_element: ClientRegulatoryElement | None = None - structural_elements: list[ + regulatoryElement: ClientRegulatoryElement | None = None + structure: list[ ClientTranscriptSegmentElement | ClientGeneElement | ClientTemplatedSequenceElement @@ -297,7 +297,7 @@ class NomenclatureResponse(Response): class RegulatoryElementResponse(Response): """Response model for regulatory element constructor.""" - regulatory_element: RegulatoryElement + regulatoryElement: RegulatoryElement class DemoResponse(Response): diff --git a/server/tests/conftest.py b/server/tests/conftest.py index da8a95e8..74a7f769 100644 --- a/server/tests/conftest.py +++ b/server/tests/conftest.py @@ -67,7 +67,7 @@ def alk_descriptor(): """Gene descriptor for ALK gene""" return { "id": "normalize.gene:hgnc%3A427", - "type": "GeneDescriptor", + "type": "Gene", "label": "ALK", "gene_id": "hgnc:427", } @@ -78,7 +78,7 @@ def tpm3_descriptor(): """Gene descriptor for TPM3 gene""" return { "id": "normalize.gene:TPM3", - "type": "GeneDescriptor", + "type": "Gene", "label": "TPM3", "gene_id": "hgnc:12012", } @@ -89,7 +89,7 @@ def ntrk1_descriptor(): """Gene descriptor for NTRK1 gene""" return { "id": "normalize.gene:NTRK1", - "type": "GeneDescriptor", + "type": "Gene", "label": "NTRK1", "gene_id": "hgnc:8031", } @@ -98,7 +98,7 @@ def ntrk1_descriptor(): @pytest.fixture(scope="module") def alk_gene_element(alk_descriptor): """Provide GeneElement containing ALK gene""" - return {"type": "GeneElement", "gene_descriptor": alk_descriptor} + return {"type": "GeneElement", "gene": alk_descriptor} @pytest.fixture(scope="module") @@ -111,10 +111,10 @@ def ntrk1_tx_element_start(ntrk1_descriptor): "transcript": "refseq:NM_002529.3", "exon_start": 2, "exon_start_offset": 1, - "gene_descriptor": ntrk1_descriptor, + "gene": ntrk1_descriptor, "element_genomic_start": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000001.11", "location": { "type": "SequenceLocation", @@ -141,10 +141,10 @@ def tpm3_tx_t_element(tpm3_descriptor): "exon_start_offset": 72, "exon_end": 6, "exon_end_offset": -5, - "gene_descriptor": tpm3_descriptor, + "gene": tpm3_descriptor, "element_genomic_start": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000001.11", "location": { "type": "SequenceLocation", @@ -158,7 +158,7 @@ def tpm3_tx_t_element(tpm3_descriptor): }, "element_genomic_end": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000001.11", "location": { "type": "SequenceLocation", @@ -185,10 +185,10 @@ def tpm3_tx_g_element(tpm3_descriptor): "exon_start_offset": 5, "exon_end": 6, "exon_end_offset": -70, - "gene_descriptor": tpm3_descriptor, + "gene": tpm3_descriptor, "element_genomic_start": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000001.11", "location": { "type": "SequenceLocation", @@ -202,7 +202,7 @@ def tpm3_tx_g_element(tpm3_descriptor): }, "element_genomic_end": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000001.11", "location": { "type": "SequenceLocation", diff --git a/server/tests/integration/test_constructors.py b/server/tests/integration/test_constructors.py index 4e316613..a327ffb9 100644 --- a/server/tests/integration/test_constructors.py +++ b/server/tests/integration/test_constructors.py @@ -14,8 +14,8 @@ def check_gene_element_response( if ("element" not in response) and ("element" not in expected_response): return assert response["element"]["type"] == expected_response["element"]["type"] - response_gd = response["element"]["gene_descriptor"] - expected_gd = expected_response["element"]["gene_descriptor"] + response_gd = response["element"]["gene"] + expected_gd = expected_response["element"]["gene"] assert response_gd["id"] == expected_id assert response_gd["type"] == expected_gd["type"] assert response_gd["label"] == expected_gd["label"] @@ -56,9 +56,7 @@ def check_tx_element_response(response: dict, expected_response: dict): response_element = response["element"] expected_element = expected_response["element"] assert response_element["transcript"] == expected_element["transcript"] - assert ( - response_element["gene_descriptor"] == expected_element["gene_descriptor"] - ) + assert response_element["gene"] == expected_element["gene"] assert response_element.get("exon_start") == expected_element.get("exon_start") assert response_element.get("exon_start_offset") == expected_element.get( "exon_start_offset" @@ -82,22 +80,22 @@ def check_reg_element_response(): """Provide callback function check correctness of regulatory element constructor.""" def check_re_response(response: dict, expected_response: dict): - assert ("regulatory_element" in response) == ( - "regulatory_element" in expected_response + assert ("regulatoryElement" in response) == ( + "regulatoryElement" in expected_response ) - if ("regulatory_element" not in response) and ( - "regulatory_element" not in expected_response + if ("regulatoryElement" not in response) and ( + "regulatoryElement" not in expected_response ): assert "warnings" in response assert set(response["warnings"]) == set(expected_response["warnings"]) return - response_re = response["regulatory_element"] - expected_re = expected_response["regulatory_element"] + response_re = response["regulatoryElement"] + expected_re = expected_response["regulatoryElement"] assert response_re["type"] == expected_re["type"] assert response_re.get("regulatory_class") == expected_re.get( "regulatory_class" ) - assert response_re.get("feature_id") == expected_re.get("feature_id") + assert response_re.get("featureId") == expected_re.get("featureId") assert response_re.get("associated_gene") == expected_re.get("associated_gene") assert response_re.get("location_descriptor") == expected_re.get( "location_descriptor" @@ -223,14 +221,14 @@ async def test_build_segment_gcg( async def test_build_reg_element(check_response, check_reg_element_response): """Test correctness of regulatory element constructor endpoint.""" await check_response( - "/api/construct/regulatory_element?element_class=promoter&gene_name=braf", + "/api/construct/regulatoryElement?element_class=promoter&gene_name=braf", { - "regulatory_element": { + "regulatoryElement": { "associated_gene": { "gene_id": "hgnc:1097", "id": "normalize.gene:braf", "label": "BRAF", - "type": "GeneDescriptor", + "type": "Gene", }, "regulatory_class": "promoter", "type": "RegulatoryElement", @@ -252,7 +250,7 @@ async def test_build_templated_sequence( "type": "TemplatedSequenceElement", "region": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "location_id": "ga4gh:VSL.K_suWpotWJZL0EFYUqoZckNq4bqEjH-z", "location": { "type": "SequenceLocation", @@ -277,7 +275,7 @@ async def test_build_templated_sequence( "type": "TemplatedSequenceElement", "region": { "id": "fusor.location_descriptor:NC_000001.11", - "type": "LocationDescriptor", + "type": "SequenceLocation", "location_id": "ga4gh:VSL.K_suWpotWJZL0EFYUqoZckNq4bqEjH-z", "location": { "type": "SequenceLocation", diff --git a/server/tests/integration/test_nomenclature.py b/server/tests/integration/test_nomenclature.py index 7577e668..6df38a8e 100644 --- a/server/tests/integration/test_nomenclature.py +++ b/server/tests/integration/test_nomenclature.py @@ -26,15 +26,15 @@ def epcam_5_prime(): "transcript": "refseq:NM_002354.2", "exon_end": 5, "exon_end_offset": 0, - "gene_descriptor": { + "gene": { "id": "normalize.gene:EPCAM", - "type": "GeneDescriptor", + "type": "Gene", "label": "EPCAM", "gene_id": "hgnc:11529", }, "element_genomic_end": { "id": "fusor.location_descriptor:NC_000002.12", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000002.12", "location": { "type": "SequenceLocation", @@ -57,15 +57,15 @@ def epcam_3_prime(): "transcript": "refseq:NM_002354.2", "exon_start": 5, "exon_start_offset": 0, - "gene_descriptor": { + "gene": { "id": "normalize.gene:EPCAM", - "type": "GeneDescriptor", + "type": "Gene", "label": "EPCAM", "gene_id": "hgnc:11529", }, "element_genomic_start": { "id": "fusor.location_descriptor:NC_000002.12", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000002.12", "location": { "type": "SequenceLocation", @@ -87,15 +87,15 @@ def epcam_invalid(): "type": "TranscriptSegmentElement", "exon_end": 5, "exon_end_offset": 0, - "gene_descriptor": { + "gene": { "id": "normalize.gene:EPCAM", - "type": "GeneDescriptor", + "type": "Gene", "label": "EPCAM", "gene_id": "hgnc:11529", }, "element_genomic_end": { "id": "fusor.location_descriptor:NC_000002.12", - "type": "LocationDescriptor", + "type": "SequenceLocation", "label": "NC_000002.12", "location": { "type": "SequenceLocation", @@ -118,7 +118,7 @@ def templated_sequence_element(): "strand": "-", "region": { "id": "NC_000001.11:15455-15566", - "type": "LocationDescriptor", + "type": "SequenceLocation", "location": { "sequence_id": "refseq:NC_000001.11", "interval": { @@ -196,7 +196,7 @@ async def test_gene_element_nomenclature( ) assert response.status_code == 200 assert response.json().get("warnings", []) == [ - "2 validation errors for GeneElement\ngene_descriptor\n field required (type=value_error.missing)\nassociated_gene\n extra fields not permitted (type=value_error.extra)" + "2 validation errors for GeneElement\ngene\n field required (type=value_error.missing)\nassociated_gene\n extra fields not permitted (type=value_error.extra)" ] @@ -220,7 +220,7 @@ async def test_templated_sequence_nomenclature( "type": "TemplatedSequenceElement", "region": { "id": "NC_000001.11:15455-15566", - "type": "LocationDescriptor", + "type": "SequenceLocation", "location": { "interval": { "start": {"type": "Number", "value": 15455}, diff --git a/server/tests/integration/test_validate.py b/server/tests/integration/test_validate.py index 7b18153c..a32342d4 100644 --- a/server/tests/integration/test_validate.py +++ b/server/tests/integration/test_validate.py @@ -10,12 +10,12 @@ def alk_fusion(): return { "input": { "type": "CategoricalFusion", - "structural_elements": [ + "structure": [ { "type": "GeneElement", - "gene_descriptor": { + "gene": { "id": "normalize.gene:ALK", - "type": "GeneDescriptor", + "type": "Gene", "label": "ALK", "gene_id": "hgnc:427", }, @@ -25,12 +25,12 @@ def alk_fusion(): }, "output": { "type": "CategoricalFusion", - "structural_elements": [ + "structure": [ { "type": "GeneElement", - "gene_descriptor": { + "gene": { "id": "normalize.gene:ALK", - "type": "GeneDescriptor", + "type": "Gene", "label": "ALK", "gene_id": "hgnc:427", }, @@ -48,11 +48,11 @@ def ewsr1_fusion(): return { "input": { "type": "AssayedFusion", - "structural_elements": [ + "structure": [ { "type": "GeneElement", - "gene_descriptor": { - "type": "GeneDescriptor", + "gene": { + "type": "Gene", "id": "normalize.gene:EWSR1", "label": "EWSR1", "gene_id": "hgnc:3508", @@ -60,25 +60,25 @@ def ewsr1_fusion(): }, {"type": "UnknownGeneElement"}, ], - "causative_event": { + "causativeEvent": { "type": "CausativeEvent", - "event_type": "rearrangement", + "eventType": "rearrangement", }, "assay": { "type": "Assay", - "method_uri": "pmid:33576979", - "assay_id": "obi:OBI_0003094", - "assay_name": "fluorescence in-situ hybridization assay", - "fusion_detection": "inferred", + "methodUri": "pmid:33576979", + "assayId": "obi:OBI_0003094", + "assayName": "fluorescence in-situ hybridization assay", + "fusionDetection": "inferred", }, }, "output": { "type": "AssayedFusion", - "structural_elements": [ + "structure": [ { "type": "GeneElement", - "gene_descriptor": { - "type": "GeneDescriptor", + "gene": { + "type": "Gene", "id": "normalize.gene:EWSR1", "label": "EWSR1", "gene_id": "hgnc:3508", @@ -86,16 +86,16 @@ def ewsr1_fusion(): }, {"type": "UnknownGeneElement"}, ], - "causative_event": { + "causativeEvent": { "type": "CausativeEvent", - "event_type": "rearrangement", + "eventType": "rearrangement", }, "assay": { "type": "Assay", - "method_uri": "pmid:33576979", - "assay_id": "obi:OBI_0003094", - "assay_name": "fluorescence in-situ hybridization assay", - "fusion_detection": "inferred", + "methodUri": "pmid:33576979", + "assayId": "obi:OBI_0003094", + "assayName": "fluorescence in-situ hybridization assay", + "fusionDetection": "inferred", }, }, "warnings": None, @@ -109,9 +109,9 @@ def ewsr1_fusion_fill_types(): """ return { "input": { - "structural_elements": [ + "structure": [ { - "gene_descriptor": { + "gene": { "id": "normalize.gene:EWSR1", "label": "EWSR1", "gene_id": "hgnc:3508", @@ -119,24 +119,24 @@ def ewsr1_fusion_fill_types(): }, {"type": "UnknownGeneElement"}, ], - "causative_event": { + "causativeEvent": { "type": "CausativeEvent", - "event_type": "rearrangement", + "eventType": "rearrangement", }, "assay": { - "method_uri": "pmid:33576979", - "assay_id": "obi:OBI_0003094", - "assay_name": "fluorescence in-situ hybridization assay", - "fusion_detection": "inferred", + "methodUri": "pmid:33576979", + "assayId": "obi:OBI_0003094", + "assayName": "fluorescence in-situ hybridization assay", + "fusionDetection": "inferred", }, }, "output": { "type": "AssayedFusion", - "structural_elements": [ + "structure": [ { "type": "GeneElement", - "gene_descriptor": { - "type": "GeneDescriptor", + "gene": { + "type": "Gene", "id": "normalize.gene:EWSR1", "label": "EWSR1", "gene_id": "hgnc:3508", @@ -144,16 +144,16 @@ def ewsr1_fusion_fill_types(): }, {"type": "UnknownGeneElement"}, ], - "causative_event": { + "causativeEvent": { "type": "CausativeEvent", - "event_type": "rearrangement", + "eventType": "rearrangement", }, "assay": { "type": "Assay", - "method_uri": "pmid:33576979", - "assay_id": "obi:OBI_0003094", - "assay_name": "fluorescence in-situ hybridization assay", - "fusion_detection": "inferred", + "methodUri": "pmid:33576979", + "assayId": "obi:OBI_0003094", + "assayName": "fluorescence in-situ hybridization assay", + "fusionDetection": "inferred", }, }, "warnings": None, @@ -166,11 +166,11 @@ def wrong_type_fusion(): return { "input": { "type": "CategoricalFusion", - "structural_elements": [ + "structure": [ { "type": "GeneElement", - "gene_descriptor": { - "type": "GeneDescriptor", + "gene": { + "type": "Gene", "id": "normalize.gene:EWSR1", "label": "EWSR1", "gene_id": "hgnc:3508", @@ -178,22 +178,22 @@ def wrong_type_fusion(): }, {"type": "UnknownGeneElement"}, ], - "causative_event": { + "causativeEvent": { "type": "CausativeEvent", - "event_type": "rearrangement", + "eventType": "rearrangement", }, "assay": { "type": "Assay", - "method_uri": "pmid:33576979", - "assay_id": "obi:OBI_0003094", - "assay_name": "fluorescence in-situ hybridization assay", - "fusion_detection": "inferred", + "methodUri": "pmid:33576979", + "assayId": "obi:OBI_0003094", + "assayName": "fluorescence in-situ hybridization assay", + "fusionDetection": "inferred", }, }, "output": None, "warnings": [ "Unable to construct fusion with provided args: FUSOR.categorical_fusion()" - " got an unexpected keyword argument 'causative_event'" + " got an unexpected keyword argument 'causativeEvent'" ], }