{
name: "Rank",
filterType: "number",
},
+ {
+ key: "task",
+ name: "Task",
+ },
{
key: "id",
name: "ID",
@@ -47,7 +51,20 @@ const Similarities = ({ results }: Props) => {
key: "similarity",
name: "Similarity",
filterType: "number",
- render: formatNumber,
+ },
+ {
+ key: "zScore",
+ name: "z-score",
+ filterType: "number",
+ style: { whiteSpace: "nowrap" },
+ },
+ {
+ key: "pAdjusted",
+ name: "p-adjusted",
+ filterType: "number",
+ style: { whiteSpace: "nowrap" },
+ render: (cell) =>
+ cell < 0.01 ? : null,
},
]}
rows={results.similarities}
diff --git a/frontend/src/pages/analysis/Summary.tsx b/frontend/src/pages/analysis/Summary.tsx
index 41384a7..079be1c 100644
--- a/frontend/src/pages/analysis/Summary.tsx
+++ b/frontend/src/pages/analysis/Summary.tsx
@@ -36,7 +36,9 @@ const Summary = ({ results }: Props) => {
{results.crossValidation
- .map((value) => value.toFixed(2))
+ .map((value) =>
+ typeof value === "number" ? value.toFixed(2) : "-",
+ )
.join(", ")}
>
diff --git a/frontend/src/util/dom.ts b/frontend/src/util/dom.ts
index f8b0436..33732c4 100644
--- a/frontend/src/util/dom.ts
+++ b/frontend/src/util/dom.ts
@@ -3,6 +3,29 @@ import reactToText from "react-to-text";
import { debounce } from "lodash";
import { sleep } from "@/util/misc";
+/** css on :root */
+const rootStyles = window.getComputedStyle(document.documentElement);
+
+/** theme css variables https://stackoverflow.com/a/78994961/2180570 */
+export const themeVariables = Object.fromEntries(
+ Array.from(document.styleSheets)
+ .flatMap((styleSheet) => {
+ try {
+ return Array.from(styleSheet.cssRules);
+ } catch (error) {
+ return [];
+ }
+ })
+ .filter((cssRule) => cssRule instanceof CSSStyleRule)
+ .flatMap((cssRule) => Array.from(cssRule.style))
+ .filter((style) => style.startsWith("--"))
+ .map((variable) => [variable, rootStyles.getPropertyValue(variable)]),
+);
+
+/** get css theme variable */
+export const theme = (variable: `--${string}`) =>
+ themeVariables[variable] ?? "";
+
/** wait for element matching selector to appear, checking periodically */
export const waitFor = async (
selector: string,
diff --git a/frontend/src/util/string.ts b/frontend/src/util/string.ts
index 590db38..27f9668 100644
--- a/frontend/src/util/string.ts
+++ b/frontend/src/util/string.ts
@@ -39,7 +39,7 @@ export const formatDate = (date: string | Date | undefined) => {
dateStyle: "medium",
timeStyle: "short",
});
- return null;
+ return "";
};
/** make label (e.g. aria label) from html string */
diff --git a/functions/README.md b/functions/README.md
index dbbc777..1a391bc 100644
--- a/functions/README.md
+++ b/functions/README.md
@@ -71,10 +71,12 @@ type Response = {
}[];
// dataframe of results
df_convert_out: {
- // converted id of gene
- "Entrez ID": string;
// input id of gene
"Original ID": string;
+ // converted id of gene
+ "Entrez ID": string;
+ // converted name of gene
+ "Gene Name": string;
// whether gene was found in each network
"In BioGRID?": "Y" | "N";
"In IMP?": "Y" | "N";
@@ -100,7 +102,7 @@ type Request = {
// network that ML features are from and which edge list is used to make final graph
net_type: "BioGRID" | "STRING" | "IMP";
// source used to select negative genes and which sets to compare trained model to
- gsc: "GO" | "Monarch" | "DisGeNet" | "Combined";
+ gsc: "GO" | "Monarch" | "Mondo" | "Combined";
};
```
@@ -115,6 +117,7 @@ type Response = {
df_convert_out_subset: {
"Original ID": string;
"Entrez ID": string;
+ "Gene Name": string;
// only one of these present, based on selected network
"In BioGRID?"?: string;
"In IMP?"?: string;
@@ -122,19 +125,18 @@ type Response = {
}[];
// cross validation results, performance measured using log2(auprc/prior)
- avgps: int[];
+ avgps: (int | None)[];
// number of genes considered positives in network
- positive_genes: number;
+ positive_genes: int;
// top predicted genes that are isolated from other top predicted genes in network (as Entrez IDs)
isolated_genes: string[];
// top predicted genes that are isolated from other top predicted genes in network (as gene symbols)
isolated_genes_sym: string[];
-
// edge list corresponding to subgraph induced by top predicted genes (as Entrez IDs)
- df_edge: { Node1: string; Node2: string }[];
+ df_edge: { Node1: string; Node2: string; Weight: number }[];
// edge list corresponding to subgraph induced by top predicted genes (as gene symbols)
- df_edge_sym: { Node1: string; Node2: string }[];
+ df_edge_sym: { Node1: string; Node2: string; Weight: number }[];
// table showing how associated each gene in prediction species network is to the users gene list
df_probs: {
@@ -146,24 +148,34 @@ type Response = {
"Symbol": string;
// full gene name
"Name": string;
- // probability of gene being part of input gene list
- "Probability": number;
// whether gene is in input gene list
"Known/Novel": "Known" | "Novel";
// gene class, positive | negative | neutraul
"Class-Label": "P" | "N" | "U";
+ // probability of gene being part of input gene list
+ "Probability": number;
+ // z-score of the probabilities
+ "Z-score": number;
+ // adjusted p-values of the z-scores
+ "P-adjusted": number;
}[];
// table showing how similar user's trained model is to models trained on known gene sets
df_sim: {
// rank of similarity between input model and a model trained on term gene set
- Rank: int;
+ "Rank": int;
+ // type of term
+ "Task": string;
// term ID
- ID: string;
+ "ID": string;
// term name
- Name: string;
+ "Name": string;
// similarity between input model and a model trained on term gene set
- Similarity: number;
+ "Similarity": number;
+ // z-score of the similarities
+ "Z-score": number;
+ // adjusted p-values of the z-scores
+ "P-adjusted": number;
}[];
};
```
diff --git a/functions/convert_ids/convert_ids_deploy/requirements.txt b/functions/convert_ids/convert_ids_deploy/requirements.txt
index acfdc21..e0703ce 100644
--- a/functions/convert_ids/convert_ids_deploy/requirements.txt
+++ b/functions/convert_ids/convert_ids_deploy/requirements.txt
@@ -1,4 +1,4 @@
# An example requirements file. If your function has other dependencies,
# add them below
functions-framework==3.*
-geneplexus @ git+https://github.com/krishnanlab/PyGenePlexus@3499a60
\ No newline at end of file
+geneplexus @ git+https://github.com/krishnanlab/PyGenePlexus@5722d9b
\ No newline at end of file
diff --git a/functions/convert_ids/gather_data_ids.sh b/functions/convert_ids/gather_data_ids.sh
new file mode 100755
index 0000000..6b8c07b
--- /dev/null
+++ b/functions/convert_ids/gather_data_ids.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# this function will get data generated in GenePlexus_Backend
+# and add it to function and zip it to be moved to the cloud
+
+# set dir to backend data
+dir1=/Users/mancchri/Desktop/CIDA_unsorted/Arjun/GenePlexusZoo_webserver/gpdata_prop/regular
+
+# make dir and move in data
+mkdir convert-ids_data
+cp $dir1/IDconversion*.json convert-ids_data
+cp $dir1/NodeOrder*.txt convert-ids_data
+# tar this dir (note this compresseed file is manually uploaded to GCP later)
+tar -czvf convert-ids_data.tar.gz convert-ids_data
+# rename the dir to be move into gcp function
+mv convert-ids_data data
+# delete old data file and move new one in
+rm -rf convert_ids_deploy/data
+mv data convert_ids_deploy
\ No newline at end of file
diff --git a/functions/ml/gather_data_ml.sh b/functions/ml/gather_data_ml.sh
new file mode 100755
index 0000000..7a20bf0
--- /dev/null
+++ b/functions/ml/gather_data_ml.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# this function will get data generated in GenePlexus_Backend
+# and add it to function and zip it to be moved to the cloud
+
+# set dir to backend data
+dir1=/Users/mancchri/Desktop/CIDA_unsorted/Arjun/GenePlexusZoo_webserver/gpdata_prop/regular
+
+# make dir and move in data
+mkdir ml_data
+cp $dir1/* ml_data
+# tar this dir (note this compresseed file is manually uploaded to GCP later)
+tar -czvf ml_data.tar.gz ml_data
+# rename the dir to be move into gcp function
+mv ml_data data
+# delete old data file and move new one in
+rm -rf ml_deploy/data
+mv data ml_deploy
\ No newline at end of file
diff --git a/functions/ml/ml_deploy/requirements.txt b/functions/ml/ml_deploy/requirements.txt
index 990e666..adefe79 100644
--- a/functions/ml/ml_deploy/requirements.txt
+++ b/functions/ml/ml_deploy/requirements.txt
@@ -1,5 +1,5 @@
# An example requirements file. If your function has other dependencies,
# add them below
functions-framework==3.*
-geneplexus @ git+https://github.com/krishnanlab/PyGenePlexus@3499a60
-flask-compress==1.*
+geneplexus @ git+https://github.com/krishnanlab/PyGenePlexus@5722d9b
+flask-compress==1.*
\ No newline at end of file