Skip to content

Commit

Permalink
adjusted buildGenerateNetworkQuery and buildNetworkFromGeneProteinQue…
Browse files Browse the repository at this point in the history
…ry to only have timestamp query if timestamp is 2025 or later. need to fix query though since ZAP1 gene is not showing correct self-regulating expression
  • Loading branch information
ceciliazaragoza committed Feb 26, 2025
1 parent a0ab429 commit d0fdb9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
9 changes: 5 additions & 4 deletions server/dals/network-dal.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ const buildNetworkSourceQuery = function () {
ORDER BY time_stamp DESC;`;
};

const buildNetworkGeneFromSourceQuery = function (gene, timestamp) {
const buildNetworkGeneFromSourceQuery = function (gene, source, timestamp) {
const namespace =
timestamp < new Date("2025-01-01")
? "gene_regulatory_network.gene"
: "gene_regulatory_network_new.gene";
return `SELECT DISTINCT gene_id, display_gene_id FROM
${namespace} WHERE (gene.gene_id ='${gene}'
OR gene.display_gene_id ='${gene}') AND gene.time_stamp ='${timestamp}'`;
const timestamp_query = timestamp < new Date("2025-01-01") ? `AND gene.time_stamp ='${timestamp}` : "";

Check failure on line 32 in server/dals/network-dal.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Identifier 'timestamp_query' is not in camel case
return `SELECT DISTINCT gene_id, display_gene_id FROM
${namespace} WHERE (gene.gene_id ='${gene}'
OR gene.display_gene_id ='${gene}') ${timestamp_query};`;

Check failure on line 35 in server/dals/network-dal.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Identifier 'timestamp_query' is not in camel case
};

const buildNetworkGenesQuery = function (geneString) {
Expand Down
13 changes: 9 additions & 4 deletions server/dals/protein-dal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var sequelize = new Sequelize(

const buildNetworkSourceQuery = function () {
return `SELECT * FROM protein_protein_interactions.source
UNION ALL
UNION ALL
SELECT * FROM protein_protein_interactions_new.source
ORDER BY time_stamp DESC;`;
};
Expand All @@ -29,11 +29,16 @@ const buildNetworkFromGeneProteinQuery = function (geneProtein, timestamp) {
timestamp < new Date("2025-01-01")
? "protein_protein_interactions"
: "protein_protein_interactions_new";

Check failure on line 32 in server/dals/protein-dal.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Trailing spaces not allowed
const timestamp_query =

Check failure on line 33 in server/dals/protein-dal.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Identifier 'timestamp_query' is not in camel case
timestamp < new Date("2025-01-01")
? `AND gene.time_stamp ='${timestamp}`
: "";
return `SELECT DISTINCT gene_id, display_gene_id, standard_name, length, molecular_weight, PI FROM
${namespace}.gene, ${namespace}.protein WHERE
(LOWER(gene.gene_id)=LOWER('${geneProtein}') OR LOWER(gene.display_gene_id)=LOWER('${geneProtein}')
(LOWER(gene.gene_id)=LOWER('${geneProtein}') OR LOWER(gene.display_gene_id)=LOWER('${geneProtein}')
OR LOWER(protein.standard_name) =LOWER('${geneProtein}')) AND
LOWER(gene.gene_id) = LOWER(protein.gene_systematic_name) AND gene.time_stamp = ${timestamp};`;
LOWER(gene.gene_id) = LOWER(protein.gene_systematic_name) ${timestamp_query};`;

Check failure on line 41 in server/dals/protein-dal.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Identifier 'timestamp_query' is not in camel case
};

const buildNetworkProteinsQuery = function (proteinString) {
Expand All @@ -53,7 +58,7 @@ const buildGenerateProteinNetworkQuery = function (proteins, timestamp, source)
: "protein_protein_interactions_new";
const annotation =
timestamp < new Date("2025-01-01") ? "" : ", annotation_type";
return `SELECT DISTINCT protein1, protein2${annotation} FROM ${namespace}.physical_interactions
return `SELECT DISTINCT protein1, protein2${annotation} FROM ${namespace}.physical_interactions
${namespace}.time_stamp='${timestamp}' AND ${namespace}.source='${source}' AND
${buildNetworkProteinsQuery(proteins)} ORDER BY protein1 DESC;`;
};
Expand Down

0 comments on commit d0fdb9a

Please sign in to comment.