From a77fea6583f0bf24e8b71ef07dba74e6d2b6f84d Mon Sep 17 00:00:00 2001 From: Dmitrii Krasnov Date: Mon, 11 Apr 2022 11:42:10 +0500 Subject: [PATCH] Metabolic pathways visualisation (#731): #issuecomment-1083150339 --- .../ngbPathwaysAnnotation/ngbPathwaysAnnotation.controller.js | 2 +- .../ngbPathwaysAnnotation/ngbPathwaysAnnotation.service.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.controller.js b/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.controller.js index 222432353..d27cf7feb 100644 --- a/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.controller.js +++ b/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.controller.js @@ -7,7 +7,7 @@ import {readHeatmapState} from '../../../../modules/render/heatmap/heatmap-view- function initializeManualConfig(config) { let result = ''; config.forEach(configStr => { - result += `${configStr.term}\t`; + result += `"${configStr.term}"\t`; result += configStr.backgroundColor; if (configStr.foregroundColor) { result += `,${configStr.foregroundColor}`; diff --git a/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.service.js b/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.service.js index 8f63c9837..5ebbcdcdb 100644 --- a/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.service.js +++ b/client/client/app/components/ngbPathways/ngbPathwaysAnnotation/ngbPathwaysAnnotation.service.js @@ -30,10 +30,10 @@ function parseConfigStr(rawStr) { const strList = rawStr.split('\n'); strList.forEach(str => { if (str) { - const [term, ...colors] = str.split(/\s+/); + const [term, ...colors] = str.match(/(?:[^\s"]+|"[^"]*")+/g); const colorList = colors.join().split(','); result.push({ - term: term, + term: term.replace(/"/g, ''), backgroundColor: colorList[0] ? colorList[0].trim() : undefined, foregroundColor: colorList[1] ? colorList[1].trim() : undefined });