Skip to content

Commit

Permalink
fix coloc otherStudyLocus assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhayhurst committed Dec 11, 2024
1 parent 8f66dbb commit e1a14cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/models/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit e1a14cb

Please sign in to comment.