From 8ab2d02396a2194db358e38c3e460a513c235bf2 Mon Sep 17 00:00:00 2001 From: HaneenT Date: Thu, 29 Feb 2024 08:50:11 -0500 Subject: [PATCH 1/2] KPMP-5154: add additional geneExpressionValues to feature data --- .../java/org/kpmp/umap/SCMetadataRepository.java | 2 ++ src/main/java/org/kpmp/umap/UmapDataService.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/main/java/org/kpmp/umap/SCMetadataRepository.java b/src/main/java/org/kpmp/umap/SCMetadataRepository.java index cbcad2e..8f83782 100755 --- a/src/main/java/org/kpmp/umap/SCMetadataRepository.java +++ b/src/main/java/org/kpmp/umap/SCMetadataRepository.java @@ -32,6 +32,8 @@ public interface SCMetadataRepository extends CrudRepository List findByTissueType(String tissueType); + SCMetadata findByBarcode(String barcode); + @Cacheable("scMetadataWithTissue") @Query(value = "SELECT " + "umap_x, " diff --git a/src/main/java/org/kpmp/umap/UmapDataService.java b/src/main/java/org/kpmp/umap/UmapDataService.java index f3dc921..7d6bc2f 100755 --- a/src/main/java/org/kpmp/umap/UmapDataService.java +++ b/src/main/java/org/kpmp/umap/UmapDataService.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Iterator; import org.json.JSONException; import org.json.JSONObject; @@ -78,6 +79,21 @@ public PlotData getPlotData(String dataType, String geneSymbol, String requestTi } } + if (dataTypeEnum.equals(DataTypeEnum.SINGLE_CELL) + && featureDataWithExpressionValues.getExpression().size() == 0 + && geneExpressionValues.length() <= 200) { + Iterator keys = geneExpressionValues.keys(); + while(keys.hasNext()) { + String barcode = keys.next(); + Double expressionValue = geneExpressionValues.getDouble(barcode); + UmapPoint umapPoint = scMetadataRepo.findByBarcode(barcode); + featureDataWithExpressionValues.addXValue(umapPoint.getUmapX()); + featureDataWithExpressionValues.addYValue(umapPoint.getUmapY()); + featureDataWithExpressionValues.addExpression(expressionValue); + featureDataWithExpressionValues.addHoverDisplay(Double.toString(expressionValue) + "
" + umapPoint.getClusterName()); + } + } + List referenceClusterList = new ArrayList<>(referenceClusters.values()); return new PlotData(referenceClusterList, Arrays.asList(featureDataWithExpressionValues, featureDataWithNoExpressionValues)); From fde222d80dbba55dfec7db22b239ce4c73009095 Mon Sep 17 00:00:00 2001 From: HaneenT Date: Thu, 29 Feb 2024 09:02:29 -0500 Subject: [PATCH 2/2] fix linkinformation type --- src/main/resources/knowledge_environment.graphqls | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls index 69712fd..6840d47 100755 --- a/src/main/resources/knowledge_environment.graphqls +++ b/src/main/resources/knowledge_environment.graphqls @@ -41,10 +41,10 @@ type AtlasRepoSummaryRow { hrtCount: Long dmrCount: Long omicsType: String - linkInformation: AtlasRepositoryLinkInformationInformation + linkInformation: AtlasRepositoryLinkInformation } -type AtlasRepositoryLinkInformationInformation { +type AtlasRepositoryLinkInformation { linkType: String linkValue: String } @@ -74,7 +74,7 @@ type ParticipantRepoDataTypeSummary { type ParticipantRepoDataTypeInformation { dataType: String count: Long - linkInformation: AtlasRepositoryLinkInformationInformation + linkInformation: AtlasRepositoryLinkInformation } type DataTypeSummaryInformation {