From e1a14cb61c064b2917df0a4917ba33240efc6990 Mon Sep 17 00:00:00 2001 From: James Hayhurst Date: Fri, 6 Dec 2024 11:34:32 +0000 Subject: [PATCH] fix coloc otherStudyLocus assignment --- app/models/Backend.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/Backend.scala b/app/models/Backend.scala index 1333c53..242d16f 100644 --- a/app/models/Backend.scala +++ b/app/models/Backend.scala @@ -291,15 +291,15 @@ class Backend @Inject() (implicit r.map { case Results(Seq(), _, _, _) => Colocalisations.empty case Results(colocs, _, counts, studyLocusId) => + val idString = studyLocusId.as[String] val c = colocs.map { coloc => - val otherStudyLocusId: String = if (coloc.leftStudyLocusId != studyLocusId) { - coloc.leftStudyLocusId + if (coloc.leftStudyLocusId == idString) { + coloc.copy(otherStudyLocusId = Some(coloc.rightStudyLocusId)) } else { - coloc.rightStudyLocusId + coloc.copy(otherStudyLocusId = Some(coloc.leftStudyLocusId)) } - coloc.copy(otherStudyLocusId = Some(otherStudyLocusId)) } - Colocalisations(counts, c, studyLocusId.as[String]) + Colocalisations(counts, c, idString) } } }