From 0793d5ef9662f1d062d733e79c1be89f99e04c31 Mon Sep 17 00:00:00 2001 From: jiacelyne Date: Tue, 9 Jun 2026 11:22:33 -0700 Subject: [PATCH 1/2] checking user input to see if it has correct expression data source --- database/schema/README.md | 24 ++++++++++-------------- web-client-classic/public/js/upload.js | 5 ++++- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/database/schema/README.md b/database/schema/README.md index 34b77185..af99d1b0 100644 --- a/database/schema/README.md +++ b/database/schema/README.md @@ -23,10 +23,6 @@ For example, to access your local PostgreSQL database, use the following command ``` psql postgresql://localhost/postgres ``` -or -``` -psql -U postgres postgresql://localhost/postgres -``` ## Creating Schemas and Adding Table Specifications @@ -39,11 +35,11 @@ GRNsight requires six schemas, one for each of the following namespaces: 5. `gene_regulatory_network` (this is the old schema for the gene regulatory network database before 2025 - this namepsace can be empty because we no longer load data into this namespace) 6. `protein_protein_interactions` (this is the old schema for the protein protein interactions database before 2025 - this namepsace can be empty because we no longer load data into this namespace) -The scripts already contain the commands to create the schemas for you. Each schema requires a set of table definitions. You can add these by running the following commands, each corresponding to an SQL file that defines the structure for each schema. +The scripts already contain the command to create the schema for you. Each schema requires a set of table definitions. You can add these by running the following commands, each corresponding to an SQL file that defines the structure for each schema. First, outside of postgres, navigate to the `schema` folder in your local copy of the GRNsight repository: ``` -cd +cd ``` Then run the following commands. Note that for any command that begins with `psql`, you need to be _outside_ of postgres to run it. Also, you may need to specify the database username in front of localhost, i.e., use `postgresql://postgres@localhost/postgres` for each of the following commands. @@ -77,9 +73,9 @@ Once these steps are completed, your database will be set up and ready to accept ### 1. Settings Database -The `settings` table stores the default expression dataset name that is used for the node coloring dropdown menu in GRNsight. +The `settings` table stores the default database name for the node coloring dropdown menu. Question: is this optional? -You need to change the default expression dataset name by following these steps: +To change the default database name, follow these steps: 1. **Log in to the Database** @@ -95,19 +91,19 @@ You need to change the default expression dataset name by following these steps: 3. **Delete the Current Default Database Name** - Delete the existing expression dataset name with this command: + Delete the existing database name with this command: ``` DELETE FROM grnsettings; ``` -4. **Insert the New Default Expression Dataset Name** - Insert the new default dataset name with the following command: +4. **Insert the New Default Database Name** + Insert the new default database name with the following command: ``` - INSERT INTO grnsettings(expression_dataset) VALUES (''); + INSERT INTO grnsettings(expression_dataset) VALUES (''); ``` - _Note: The current default expression dataset is `dahlquist_2018`. Don't forget!_ + _Note: The current default database is `dahlquist_2018`. Don't forget!_ ### 2. Other databases -For other databases, continue follow the instructions in the [README.md](https://github.com/dondi/GRNsight/tree/main/database/README.md#3-populate-data-into-database) outside of this directory. +For other databases, continue follow the instructions in the [README.md](https://github.com/dondi/GRNsight/tree/main/database) outside of this directory. diff --git a/web-client-classic/public/js/upload.js b/web-client-classic/public/js/upload.js index 5dcb4e5e..946f9949 100644 --- a/web-client-classic/public/js/upload.js +++ b/web-client-classic/public/js/upload.js @@ -526,7 +526,10 @@ export const upload = function () { `; - if (Object.keys(grnState.workbook.expression).length > 0) { + if ( + Object.keys(grnState.workbook.expression).length > 0 && + grnState.workbook.expression.hasOwnProperty("source") + ) { const isChecked = grnState.nodeColoring.nodeColoringEnabled ? `checked="true"` : ""; result += `
  • From d2891feabc6afe5dd2b84dc6821a5b178b7bfc0e Mon Sep 17 00:00:00 2001 From: jiacelyne Date: Mon, 6 Jul 2026 18:55:39 -0700 Subject: [PATCH 2/2] adding changes from jia-1387-from-main branch to current branch --- web-client-classic/public/js/upload.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/web-client-classic/public/js/upload.js b/web-client-classic/public/js/upload.js index 946f9949..a28e20a0 100644 --- a/web-client-classic/public/js/upload.js +++ b/web-client-classic/public/js/upload.js @@ -55,14 +55,24 @@ export const filenameWithExtension = function (mode, genes, edges, type, extensi filename = filename.substr(0, filename.length - currentExtension[0].length); } if (mode === NETWORK_GRN_MODE && extension === "xlsx") { - source = $("input[name=expressionSource]:checked")[0].value; - if (source === "none") { + const anyExpressionChecked = $("input[name=workbookSheets]:checked") + .toArray() + .some( + el => el.value && (el.value.includes("expression") || el.value.includes("sigma")) + ); + + if (anyExpressionChecked) { + source = $("input[name=expressionSource]:checked")[0].value; + if (source === "none") { + source = null; + } else if (source === "userInput") { + // only demos will have an expression source + source = grnState.workbook.expression.source + ? grnState.workbook.expression.source + : "user-data"; + } + } else { source = null; - } else if (source === "userInput") { - // only demos will have an expression source - source = grnState.workbook.expression.source - ? grnState.workbook.expression.source - : "user-data"; } }