diff --git a/package-lock.json b/package-lock.json index fac506d18..1dfc30b51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31752,6 +31752,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "validate.js": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/validate.js/-/validate.js-0.13.1.tgz", + "integrity": "sha512-PnFM3xiZ+kYmLyTiMgTYmU7ZHkjBZz2/+F0DaALc/uUtVzdCt1wAosvYJ5hFQi/hz8O4zb52FQhHZRC+uVkJ+g==" + }, "value-equal": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.4.0.tgz", diff --git a/src/assets/thirdPartyServices/snet/gene_annotation_service/form/index.js b/src/assets/thirdPartyServices/snet/gene_annotation_service/form/index.js index da481c6e6..6e5a2c4ac 100644 --- a/src/assets/thirdPartyServices/snet/gene_annotation_service/form/index.js +++ b/src/assets/thirdPartyServices/snet/gene_annotation_service/form/index.js @@ -29,7 +29,7 @@ const GeneGoOptions = [ { label: "Molecular Function", value: "molecular_function" }, ]; -const Pathways = [{ label: "SMPDB", value: "smpdb" }, { label: "Reactome", value: "reactome" }]; +const Pathways = [{ label: "Reactome", value: "reactome" }]; const GeneInputMethods = { Manual: 0, Import: 1 }; @@ -137,13 +137,14 @@ const AnnotationForm = props => { } else if (sa === "biogrid-interaction-annotation") { const int = new Filter(); int.setFilter("interaction"); - int.setValue(annotations.includes("gene-pathway-annotation") && includeProtiens ? "Proteins" : "Genes"); + int.setValue(includeProtiens ? "Proteins" : "Genes"); annotation.setFiltersList([int, ...(annotations.includes("gene-go-annotation") ? [namespace, nop] : [])]); } return annotation; }) ); + const requestProps = { request: annotationRequest, onEnd: ({ status, statusMessage, message: msg }) => { @@ -184,11 +185,11 @@ const AnnotationForm = props => { }, }; - this.props.serviceClient.unary(Annotate.Annotate, requestProps); + props.serviceClient.unary(Annotate.Annotate, requestProps); }; return ( -
+
{/* Gene List */} Input Genes diff --git a/src/assets/thirdPartyServices/snet/gene_annotation_service/index.js b/src/assets/thirdPartyServices/snet/gene_annotation_service/index.js index b1972cdc3..21572e877 100644 --- a/src/assets/thirdPartyServices/snet/gene_annotation_service/index.js +++ b/src/assets/thirdPartyServices/snet/gene_annotation_service/index.js @@ -1,5 +1,4 @@ import React, { useState } from "react"; -import ReactDOM from "react-dom"; import { SnackbarProvider } from "notistack"; import AnnotationForm from "./form"; import AnnotationResult from "./result"; @@ -10,9 +9,11 @@ const App = props => { return (
- {id ? : } + + {id ? : } +
); }; -ReactDOM.render(, document.getElementById("app")); +export default App; diff --git a/src/assets/thirdPartyServices/snet/gene_annotation_service/result/index.js b/src/assets/thirdPartyServices/snet/gene_annotation_service/result/index.js index d4688298a..d7ebf7b65 100644 --- a/src/assets/thirdPartyServices/snet/gene_annotation_service/result/index.js +++ b/src/assets/thirdPartyServices/snet/gene_annotation_service/result/index.js @@ -1,5 +1,5 @@ import React, { useState, useEffect, Fragment } from "react"; -import { parse, formatDistanceToNow } from "date-fns"; +import { parse, formatDistanceToNow, toDate } from "date-fns"; import { RESULT_ADDR, downloadSchemeFile } from "../service"; import TabbedTables from "../tables"; import Visualizer from "../visualizer"; @@ -68,7 +68,6 @@ const AnnotationResult = props => { const renderError = () => ( - {console.log(response)} {response.statusMessage}. Try to @@ -82,7 +81,7 @@ const AnnotationResult = props => { The result contains {nodes.length} entities and {edges.length} connections between them.
- This page will expire in {formatDistanceToNow(parse(response.expire_time * 1000))}. + This page will expire in {formatDistanceToNow(toDate(response.expire_time * 1000))}.
); @@ -496,32 +498,32 @@ const Visualizer = props => {
- + Go back}> - + Randomize layout}> - + Breadth-first layout}> - + Concentric layout}> - + Save screenshot}> - + Download graph as JSON}> @@ -529,12 +531,12 @@ const Visualizer = props => { +

Use the checkboxes to the right to filter the graph by annotations and node types.

Right click on a node to perform actions on it.

You may download the graph JSON and view it on Cytoscape desktop.

The search is case sensitive.

-
+ } > @@ -543,8 +545,9 @@ const Visualizer = props => {
- + setSearchToken(e.target.value)} onKeyPress={e => { @@ -562,7 +565,7 @@ const Visualizer = props => { } id="genes"> - Genes + Node Types {nodeTypes.map(n => ( @@ -579,6 +582,7 @@ const Visualizer = props => { /> } label={n} + key={n} /> ))} @@ -591,7 +595,7 @@ const Visualizer = props => {
{AnnotationGroups.filter(a => props.annotations.includes(a.group)).map((a, i) => { return ( -
+
{a.group.includes("biogrid") && ( @@ -614,7 +618,7 @@ const Visualizer = props => { {a.subgroups .filter(s => props.annotations.includes(s.subgroup)) .map(s => ( - +