From 28e71244ad46b0074a8ac14f1e81ac6982e3c0d2 Mon Sep 17 00:00:00 2001 From: Dave Falke Date: Wed, 8 May 2024 16:50:48 -0400 Subject: [PATCH] Fix search links for WGCNA network nodes (#1079) --- .../components/computations/plugins/correlation.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx b/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx index 4df1cb0abd..b32c081a44 100644 --- a/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx +++ b/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx @@ -99,12 +99,18 @@ export const plugin: ComputationPlugin = { const variable = variables.find((v) => v.id === variableId); if (variable == null) return []; + // E.g., "qa." + const urlPrefix = window.location.host.replace( + /(plasmodb|hostdb)\.org/, + '' + ); + const href = parasiteCollection?.memberVariableIds.includes( variable.id ) - ? `https://qa.plasmodb.org/plasmo/app/search/transcript/GenesByRNASeqpfal3D7_Lee_Gambian_ebi_rnaSeq_RSRCWGCNAModules?param.wgcnaParam=${variable.displayName.toLowerCase()}&autoRun=1` + ? `//${urlPrefix}plasmodb.org/plasmo/app/search/transcript/GenesByRNASeqpfal3D7_Lee_Gambian_ebi_rnaSeq_RSRCWGCNAModules?param.wgcnaParam=${variable.displayName.toLowerCase()}&autoRun=1` : hostCollection?.memberVariableIds.includes(variable.id) - ? `https://qa.hostdb.org/hostdb/app/search/transcript/GenesByRNASeqhsapREF_Lee_Gambian_ebi_rnaSeq_RSRCWGCNAModules?param.wgcnaParam=${variable.displayName.toLowerCase()}&autoRun=1` + ? `//${urlPrefix}hostdb.org/hostdb/app/search/transcript/GenesByRNASeqhsapREF_Lee_Gambian_ebi_rnaSeq_RSRCWGCNAModules?param.wgcnaParam=${variable.displayName.toLowerCase()}&autoRun=1` : undefined; if (href == null) return []; return [