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)); diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls index 4a41426..3f5cbee 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 {