Skip to content

Commit

Permalink
#1068 improve the code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
ntran18 committed Nov 4, 2024
1 parent 1b6dbc2 commit dca83bc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web-client/public/js/update-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,12 @@ const enableNodeColoringUI = function () {
$(LOG_FOLD_CHANGE_MAX_VALUE_HEADER).removeClass("hidden");
};

const adjustGeneNameForExpression = function(gene) {
const adjustGeneNameForExpression = function (gene) {
const geneName = gene.name;
return grnState.workbook.meta.data.workbookType === NETWORK_PPI_MODE &&
gene.name.endsWith("p")
? gene.name.slice(0, -1)
: gene.name;
geneName.endsWith("p")
? geneName.slice(0, -1)
: geneName;
};

const loadExpressionDatabase = function (isTopDataset) {
Expand All @@ -400,9 +401,9 @@ const loadExpressionDatabase = function (isTopDataset) {
queryExpressionDatabase({
type:"ExpressionData",
dataset,
genes : grnState.workbook.genes.map(gene => {
return adjustGeneNameForExpression(gene);
}).join(","),
genes: grnState.workbook.genes
.map(adjustGeneNameForExpression)
.join(","),
timepoints: timepointsResponse[dataset]
}).then(function (response) {
if (isTopDataset) {
Expand Down

0 comments on commit dca83bc

Please sign in to comment.