From 235242769f6a4315e1ba3ba5336542a0f807eb26 Mon Sep 17 00:00:00 2001 From: rlreamy <34109594+rlreamy@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:37:32 -0400 Subject: [PATCH 01/30] Updating release version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b055981..8ca8477 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'io.spring.dependency-management' jar { baseName='pegasus-data' - version= '2.0' + version= '1.7' } repositories { From 228b089c4f8859a06ca20ae438d27b3c1bf3af89 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Fri, 4 Nov 2022 16:14:15 -0400 Subject: [PATCH 02/30] KPMP-3919: Use Hazelcast, more caches --- .classpath | 0 .gitignore | 0 .project | 0 .travis.yml | 0 Dockerfile | 0 README.md | 0 build.gradle | 1 + gradle/wrapper/gradle-wrapper.jar | Bin gradle/wrapper/gradle-wrapper.properties | 0 gradlew.bat | 0 src/main/java/org/.DS_Store | Bin src/main/java/org/kpmp/Application.java | 0 src/main/java/org/kpmp/DataTypeEnum.java | 0 src/main/java/org/kpmp/FullDataTypeEnum.java | 0 src/main/java/org/kpmp/OmicsTypeEnum.java | 0 src/main/java/org/kpmp/Query.java | 0 src/main/java/org/kpmp/RTComparisonTypeEnum.java | 0 src/main/java/org/kpmp/TissueTypeEnum.java | 0 src/main/java/org/kpmp/WebConfig.java | 0 .../org/kpmp/autocomplete/AutocompleteResult.java | 0 .../org/kpmp/autocomplete/AutocompleteService.java | 4 ++++ src/main/java/org/kpmp/cellType/CellType.java | 0 .../java/org/kpmp/cellType/CellTypeHierarchy.java | 0 .../kpmp/cellType/CellTypeHierarchyResolver.java | 0 .../java/org/kpmp/cellType/CellTypeRepository.java | 5 +++++ .../java/org/kpmp/cellType/CellTypeService.java | 0 .../org/kpmp/cellType/CellTypeStructureRegion.java | 0 .../cellType/CellTypeStructureRegionResolver.java | 0 .../kpmp/cellType/CellTypeStructureSubregion.java | 0 .../java/org/kpmp/cellType/CellTypeSynonym.java | 0 .../java/org/kpmp/cellType/CellTypeSynonymId.java | 0 .../cellTypeSummary/ClusterHiearchyRepository.java | 6 +++++- .../org/kpmp/cellTypeSummary/ClusterHierarchy.java | 0 .../kpmp/cellTypeSummary/ClusterHierarchyId.java | 0 .../cellTypeSummary/ClusterHierarchyService.java | 0 src/main/java/org/kpmp/cluster/Cluster.java | 0 .../java/org/kpmp/cluster/ClusterRepository.java | 3 +++ src/main/java/org/kpmp/cluster/ClusterService.java | 0 .../org/kpmp/dataSummary/DataSummaryRepository.java | 2 ++ .../org/kpmp/dataSummary/DataSummaryService.java | 0 .../java/org/kpmp/dataSummary/DataSummaryValue.java | 0 .../org/kpmp/datasetSummary/DatasetSummary.java | 0 src/main/java/org/kpmp/errors/ErrorController.java | 0 src/main/java/org/kpmp/errors/FrontEndError.java | 0 src/main/java/org/kpmp/gene/GeneService.java | 2 ++ src/main/java/org/kpmp/gene/MyGeneInfoHit.java | 0 src/main/java/org/kpmp/gene/MyGeneInfoResult.java | 0 .../kpmp/geneExpression/ExpressionDataService.java | 0 .../geneExpression/RTExpressionByTissueType.java | 0 .../org/kpmp/geneExpression/RTExpressionData.java | 0 .../geneExpression/RTExpressionDataAllSegments.java | 0 .../RTExpressionDataAllSegmentsRepository.java | 0 .../kpmp/geneExpression/RTExpressionDataGTI.java | 0 .../RTExpressionDataGTIRepository.java | 0 .../geneExpression/RTExpressionDataService.java | 0 .../org/kpmp/geneExpression/SCExpressionData.java | 0 .../geneExpression/SCExpressionDataRepository.java | 0 .../org/kpmp/geneExpression/SNExpressionData.java | 0 .../geneExpression/SNExpressionDataRepository.java | 0 .../geneExpressionSummary/GeneExpressionId.java | 0 .../GeneExpressionSummary.java | 0 .../GeneExpressionSummaryService.java | 0 .../org/kpmp/geneExpressionSummary/Participant.java | 0 .../kpmp/geneExpressionSummary/ParticipantId.java | 0 .../RTParticipantRepository.java | 0 .../geneExpressionSummary/RTParticipantValue.java | 0 .../SCRNAGeneExpressionExpressionSummaryValue.java | 0 .../SCRNAGeneExpressionSummaryRepository.java | 0 .../SCRNAParticipantRepository.java | 0 .../SCRNAParticipantValue.java | 0 .../SNRNAGeneExpressionExpressionSummaryValue.java | 0 .../SNRNAGeneExpressionSummaryRepository.java | 0 .../SNRNAParticipantRepository.java | 0 .../SNRNAParticipantValue.java | 0 src/main/java/org/kpmp/logging/LoggingService.java | 0 .../participant/ParticipantDataTypeInformation.java | 0 .../participant/ParticipantDataTypeSummary.java | 0 .../org/kpmp/participant/ParticipantService.java | 0 .../kpmp/participant/ParticipantSummaryDataset.java | 0 .../ParticipantSummaryDatasetRepository.java | 0 .../org/kpmp/participant/SingleCellMetadata.java | 0 .../participant/SingleCellMetadataRepository.java | 0 .../org/kpmp/participant/SingleNucleusMetadata.java | 0 .../SingleNucleusMetadataRepository.java | 0 .../org/kpmp/participant/SpatialViewerDataType.java | 0 .../participant/SpatialViewerTypeRepository.java | 0 src/main/java/org/kpmp/umap/FeatureData.java | 0 src/main/java/org/kpmp/umap/PlotData.java | 0 src/main/java/org/kpmp/umap/ReferenceCluster.java | 0 src/main/java/org/kpmp/umap/SCMetadata.java | 0 .../java/org/kpmp/umap/SCMetadataRepository.java | 0 src/main/java/org/kpmp/umap/SNMetadata.java | 0 .../java/org/kpmp/umap/SNMetadataRepository.java | 0 src/main/java/org/kpmp/umap/UmapDataService.java | 0 src/main/java/org/kpmp/umap/UmapPoint.java | 0 src/main/resources/application.properties | 0 src/main/resources/hazelcast.yaml | 5 +++++ src/main/resources/knowledge_environment.graphqls | 0 src/test/java/org/kpmp/DataTypeEnumTest.java | 0 src/test/java/org/kpmp/FullDataTypeEnumTest.java | 0 src/test/java/org/kpmp/OmicsTypeEnumTest.java | 0 src/test/java/org/kpmp/QueryTest.java | 0 .../java/org/kpmp/RTComparisonTypeEnumTest.java | 0 src/test/java/org/kpmp/TissueTypeEnumTest.java | 0 .../kpmp/autocomplete/AutocompleteResultTest.java | 0 .../kpmp/autocomplete/AutocompleteServiceTest.java | 0 .../org/kpmp/cellType/CellTypeHierarchyTest.java | 0 .../java/org/kpmp/cellType/CellTypeServiceTest.java | 0 .../kpmp/cellType/CellTypeStructureRegionTest.java | 0 .../cellType/CellTypeStructureSubregionTest.java | 0 .../org/kpmp/cellType/CellTypeSynonymIdTest.java | 0 .../java/org/kpmp/cellType/CellTypeSynonymTest.java | 0 src/test/java/org/kpmp/cellType/CellTypeTest.java | 0 .../cellTypeSummary/ClusterHierarchyIdTest.java | 0 .../ClusterHierarchyServiceTest.java | 0 .../kpmp/cellTypeSummary/ClusterHierarchyTest.java | 0 .../java/org/kpmp/cluster/ClusterServiceTest.java | 0 src/test/java/org/kpmp/cluster/ClusterTest.java | 0 .../kpmp/dataSummary/DataSummaryServiceTest.java | 0 .../org/kpmp/datasetSummary/DatasetSummaryTest.java | 0 .../java/org/kpmp/errors/ErrorControllerTest.java | 0 .../java/org/kpmp/errors/FrontEndErrorTest.java | 0 src/test/java/org/kpmp/gene/GeneServiceTest.java | 0 src/test/java/org/kpmp/gene/MyGeneInfoHitTest.java | 0 .../java/org/kpmp/gene/MyGeneInfoResultTest.java | 0 .../geneExpression/ExpressionDataServiceTest.java | 0 .../RTExpressionByTissueTypeTest.java | 0 .../RTExpressionDataAllSegmentsTest.java | 0 .../geneExpression/RTExpressionDataGTITest.java | 0 .../RTGeneExpressionDataServiceTest.java | 0 .../kpmp/geneExpression/SCExpressionDataTest.java | 0 .../kpmp/geneExpression/SNExpressionDataTest.java | 0 .../geneExpressionSummary/GeneExpressionIdTest.java | 0 .../GeneExpressionSummaryServiceTest.java | 0 .../geneExpressionSummary/ParticipantIdTest.java | 0 .../RTParticipantValueTest.java | 0 .../SCRNAGeneExpressionSummaryValueTest.java | 0 .../SCRNAParticipantValueTest.java | 0 .../SNRNAGeneExpressionSummaryValueTest.java | 0 .../SNRNAParticipantValueTest.java | 0 .../participant/ParticipantDataTypeSummaryTest.java | 0 .../kpmp/participant/ParticipantServiceTest.java | 0 .../participant/ParticipantSummaryDatasetTest.java | 0 .../kpmp/participant/SingleCellMetadataTest.java | 0 .../kpmp/participant/SingleNucleusMetadataTest.java | 0 .../kpmp/participant/SpatialViewerDataTypeTest.java | 0 src/test/java/org/kpmp/umap/FeatureDataTest.java | 0 src/test/java/org/kpmp/umap/PlotDataTest.java | 0 .../java/org/kpmp/umap/ReferenceClusterTest.java | 0 src/test/java/org/kpmp/umap/SCMetadataTest.java | 0 src/test/java/org/kpmp/umap/SNMetadataTest.java | 0 .../java/org/kpmp/umap/UmapDataServiceTest.java | 0 152 files changed, 27 insertions(+), 1 deletion(-) mode change 100644 => 100755 .classpath mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .project mode change 100644 => 100755 .travis.yml mode change 100644 => 100755 Dockerfile mode change 100644 => 100755 README.md mode change 100644 => 100755 build.gradle mode change 100644 => 100755 gradle/wrapper/gradle-wrapper.jar mode change 100644 => 100755 gradle/wrapper/gradle-wrapper.properties mode change 100644 => 100755 gradlew.bat mode change 100644 => 100755 src/main/java/org/.DS_Store mode change 100644 => 100755 src/main/java/org/kpmp/Application.java mode change 100644 => 100755 src/main/java/org/kpmp/DataTypeEnum.java mode change 100644 => 100755 src/main/java/org/kpmp/FullDataTypeEnum.java mode change 100644 => 100755 src/main/java/org/kpmp/OmicsTypeEnum.java mode change 100644 => 100755 src/main/java/org/kpmp/Query.java mode change 100644 => 100755 src/main/java/org/kpmp/RTComparisonTypeEnum.java mode change 100644 => 100755 src/main/java/org/kpmp/TissueTypeEnum.java mode change 100644 => 100755 src/main/java/org/kpmp/WebConfig.java mode change 100644 => 100755 src/main/java/org/kpmp/autocomplete/AutocompleteResult.java mode change 100644 => 100755 src/main/java/org/kpmp/autocomplete/AutocompleteService.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellType.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeHierarchy.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeHierarchyResolver.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeService.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeStructureRegionResolver.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeSynonym.java mode change 100644 => 100755 src/main/java/org/kpmp/cellType/CellTypeSynonymId.java mode change 100644 => 100755 src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java mode change 100644 => 100755 src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyId.java mode change 100644 => 100755 src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java mode change 100644 => 100755 src/main/java/org/kpmp/cluster/Cluster.java mode change 100644 => 100755 src/main/java/org/kpmp/cluster/ClusterRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/cluster/ClusterService.java mode change 100644 => 100755 src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/dataSummary/DataSummaryService.java mode change 100644 => 100755 src/main/java/org/kpmp/dataSummary/DataSummaryValue.java mode change 100644 => 100755 src/main/java/org/kpmp/datasetSummary/DatasetSummary.java mode change 100644 => 100755 src/main/java/org/kpmp/errors/ErrorController.java mode change 100644 => 100755 src/main/java/org/kpmp/errors/FrontEndError.java mode change 100644 => 100755 src/main/java/org/kpmp/gene/GeneService.java mode change 100644 => 100755 src/main/java/org/kpmp/gene/MyGeneInfoHit.java mode change 100644 => 100755 src/main/java/org/kpmp/gene/MyGeneInfoResult.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/ExpressionDataService.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionByTissueType.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionData.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/RTExpressionDataService.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/SCExpressionData.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/SNExpressionData.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionId.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/Participant.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/ParticipantId.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java mode change 100644 => 100755 src/main/java/org/kpmp/logging/LoggingService.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/ParticipantService.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/SingleCellMetadata.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/SingleNucleusMetadata.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/SpatialViewerDataType.java mode change 100644 => 100755 src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/FeatureData.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/PlotData.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/ReferenceCluster.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/SCMetadata.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/SCMetadataRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/SNMetadata.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/SNMetadataRepository.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/UmapDataService.java mode change 100644 => 100755 src/main/java/org/kpmp/umap/UmapPoint.java mode change 100644 => 100755 src/main/resources/application.properties create mode 100755 src/main/resources/hazelcast.yaml mode change 100644 => 100755 src/main/resources/knowledge_environment.graphqls mode change 100644 => 100755 src/test/java/org/kpmp/DataTypeEnumTest.java mode change 100644 => 100755 src/test/java/org/kpmp/FullDataTypeEnumTest.java mode change 100644 => 100755 src/test/java/org/kpmp/OmicsTypeEnumTest.java mode change 100644 => 100755 src/test/java/org/kpmp/QueryTest.java mode change 100644 => 100755 src/test/java/org/kpmp/RTComparisonTypeEnumTest.java mode change 100644 => 100755 src/test/java/org/kpmp/TissueTypeEnumTest.java mode change 100644 => 100755 src/test/java/org/kpmp/autocomplete/AutocompleteResultTest.java mode change 100644 => 100755 src/test/java/org/kpmp/autocomplete/AutocompleteServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeHierarchyTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeStructureRegionTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeStructureSubregionTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeSynonymIdTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeSynonymTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellType/CellTypeTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyIdTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cluster/ClusterServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/cluster/ClusterTest.java mode change 100644 => 100755 src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java mode change 100644 => 100755 src/test/java/org/kpmp/errors/ErrorControllerTest.java mode change 100644 => 100755 src/test/java/org/kpmp/errors/FrontEndErrorTest.java mode change 100644 => 100755 src/test/java/org/kpmp/gene/GeneServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/gene/MyGeneInfoHitTest.java mode change 100644 => 100755 src/test/java/org/kpmp/gene/MyGeneInfoResultTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/RTExpressionByTissueTypeTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/RTExpressionDataGTITest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/RTGeneExpressionDataServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionIdTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/ParticipantIdTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/RTParticipantValueTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java mode change 100644 => 100755 src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java mode change 100644 => 100755 src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java mode change 100644 => 100755 src/test/java/org/kpmp/participant/ParticipantServiceTest.java mode change 100644 => 100755 src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java mode change 100644 => 100755 src/test/java/org/kpmp/participant/SingleCellMetadataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/participant/SpatialViewerDataTypeTest.java mode change 100644 => 100755 src/test/java/org/kpmp/umap/FeatureDataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/umap/PlotDataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/umap/ReferenceClusterTest.java mode change 100644 => 100755 src/test/java/org/kpmp/umap/SCMetadataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/umap/SNMetadataTest.java mode change 100644 => 100755 src/test/java/org/kpmp/umap/UmapDataServiceTest.java diff --git a/.classpath b/.classpath old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.project b/.project old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/build.gradle b/build.gradle old mode 100644 new mode 100755 index 8ca8477..4af0b0a --- a/build.gradle +++ b/build.gradle @@ -46,6 +46,7 @@ dependencies { testImplementation 'org.mockito:mockito-core' testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.0.RELEASE' implementation 'org.springframework.boot:spring-boot-starter-cache' + implementation 'com.hazelcast:hazelcast:4.2' } springBoot { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar old mode 100644 new mode 100755 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 diff --git a/src/main/java/org/.DS_Store b/src/main/java/org/.DS_Store old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/Application.java b/src/main/java/org/kpmp/Application.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/DataTypeEnum.java b/src/main/java/org/kpmp/DataTypeEnum.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/FullDataTypeEnum.java b/src/main/java/org/kpmp/FullDataTypeEnum.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/OmicsTypeEnum.java b/src/main/java/org/kpmp/OmicsTypeEnum.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/RTComparisonTypeEnum.java b/src/main/java/org/kpmp/RTComparisonTypeEnum.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/TissueTypeEnum.java b/src/main/java/org/kpmp/TissueTypeEnum.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/WebConfig.java b/src/main/java/org/kpmp/WebConfig.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteService.java b/src/main/java/org/kpmp/autocomplete/AutocompleteService.java old mode 100644 new mode 100755 index 9be99ed..f0d65e6 --- a/src/main/java/org/kpmp/autocomplete/AutocompleteService.java +++ b/src/main/java/org/kpmp/autocomplete/AutocompleteService.java @@ -11,6 +11,7 @@ import org.kpmp.gene.GeneService; import org.kpmp.gene.MyGeneInfoHit; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; @Service @@ -28,6 +29,7 @@ public AutocompleteService(GeneService geneService, CellTypeRepository cellTypeR this.cellTypeRepository = cellTypeRepository; } + @Cacheable("autocompleteQuery") public List query(String searchTerm) throws IOException, Exception { List myGeneInfoHits = geneService.querySymbolAndAlias(searchTerm); List cellTypes = cellTypeRepository.findByCellTypeContainingOrSynonymContaining(searchTerm); @@ -40,6 +42,7 @@ public List query(String searchTerm) throws IOException, Exc return myGeneResults; } + @Cacheable("myGeneInfoHitsToAutocompleteResults") public List convertMyGeneInfoHitsToAutocompleteResults(List hits) { List autocompleteResults = new ArrayList<>(); for (MyGeneInfoHit hit : hits) { @@ -49,6 +52,7 @@ public List convertMyGeneInfoHitsToAutocompleteResults(List< return autocompleteResults; } + @Cacheable("cellTypesToAutocompleteResults") public List convertCellTypesToAutocompleteResults(List cellTypes, List regions, List subregions) { List cellTypeListNoDupes = cellTypes.stream().distinct().collect(Collectors.toList()); diff --git a/src/main/java/org/kpmp/cellType/CellType.java b/src/main/java/org/kpmp/cellType/CellType.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchyResolver.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchyResolver.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeRepository.java b/src/main/java/org/kpmp/cellType/CellTypeRepository.java old mode 100644 new mode 100755 index 13851e1..0fc449b --- a/src/main/java/org/kpmp/cellType/CellTypeRepository.java +++ b/src/main/java/org/kpmp/cellType/CellTypeRepository.java @@ -2,6 +2,7 @@ import java.util.List; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; @@ -10,6 +11,7 @@ @Repository public interface CellTypeRepository extends CrudRepository { + @Cacheable("cellTypeContainingOrSynonymContaining") @Query(value = "SELECT ct.*, cs.* " + " FROM cell_type ct " + " JOIN celltype_synonym cs ON (ct.cell_type_id = cs.cell_type_id AND cs.cell_type_synonym LIKE %:searchTerm%) " + " UNION " + " SELECT ct.*, cs.* " + " FROM cell_type ct " @@ -17,10 +19,13 @@ public interface CellTypeRepository extends CrudRepository { + " WHERE ct.cell_type LIKE %:searchTerm% ", nativeQuery = true) List findByCellTypeContainingOrSynonymContaining(@Param("searchTerm") String searchTerm); + @Cacheable("cellTypeIsNotNullOrderByCellTypeOrdering") List findAllByCellTypeIsNotNullOrderByCellTypeOrdering(); + @Cacheable("structureRegionContaining") List findByStructureRegionContaining(String searchTerm); + @Cacheable("structureSubregionContaining") List findByStructureSubregionContaining(String searchTerm); } diff --git a/src/main/java/org/kpmp/cellType/CellTypeService.java b/src/main/java/org/kpmp/cellType/CellTypeService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegionResolver.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegionResolver.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonymId.java b/src/main/java/org/kpmp/cellType/CellTypeSynonymId.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java old mode 100644 new mode 100755 index 1a69c21..59b1da1 --- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java +++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java @@ -2,6 +2,7 @@ import java.util.List; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; @@ -9,11 +10,14 @@ interface ClusterHiearchyRepository extends CrudRepository { @Override + @Cacheable("clusterHierarchy") List findAll(); + @Cacheable("clusterHierarchyCt") @Query(value = "CALL cluster_hierarchy_sp(:cell_type);", nativeQuery = true) List findByCellType(@Param("cell_type") String cellType); - @Query(value = "CALL cluster_hierarchy_by_cluster_sp(:cluster);", nativeQuery = true) + @Cacheable("clusterHierarchyCluster") + @Query(value = "CALL cluster_hierarchy_by_cluster_sp(:cluster);", nativeQuery = true) ClusterHierarchy findFirstByClusterOrRegion(String cluster); } diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyId.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyId.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cluster/Cluster.java b/src/main/java/org/kpmp/cluster/Cluster.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/cluster/ClusterRepository.java b/src/main/java/org/kpmp/cluster/ClusterRepository.java old mode 100644 new mode 100755 index 2d9594e..9d0d459 --- a/src/main/java/org/kpmp/cluster/ClusterRepository.java +++ b/src/main/java/org/kpmp/cluster/ClusterRepository.java @@ -2,13 +2,16 @@ import java.util.List; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.repository.CrudRepository; public interface ClusterRepository extends CrudRepository { @Override + @Cacheable("cluster") List findAll(); + @Cacheable("clusterAbbrev") List findByAbbreviation(String abbreviation); } diff --git a/src/main/java/org/kpmp/cluster/ClusterService.java b/src/main/java/org/kpmp/cluster/ClusterService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java b/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java old mode 100644 new mode 100755 index 95b3fc2..a0f4d87 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java @@ -28,9 +28,11 @@ public interface DataSummaryRepository extends CrudRepository querySymbolAndAlias(String queryString) throws IOException, Exception { List symbolResults = query(GET_MY_GENE_INFO_QUERY_SYMBOL, queryString).getHits(); List aliasResults = query(GET_MY_GENE_INFO_QUERY_ALIAS, queryString).getHits(); diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/ExpressionDataService.java b/src/main/java/org/kpmp/geneExpression/ExpressionDataService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionByTissueType.java b/src/main/java/org/kpmp/geneExpression/RTExpressionByTissueType.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionData.java b/src/main/java/org/kpmp/geneExpression/RTExpressionData.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataService.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java b/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java b/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionId.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionId.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/Participant.java b/src/main/java/org/kpmp/geneExpressionSummary/Participant.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/ParticipantId.java b/src/main/java/org/kpmp/geneExpressionSummary/ParticipantId.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/logging/LoggingService.java b/src/main/java/org/kpmp/logging/LoggingService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadata.java b/src/main/java/org/kpmp/participant/SingleCellMetadata.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java b/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/FeatureData.java b/src/main/java/org/kpmp/umap/FeatureData.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/PlotData.java b/src/main/java/org/kpmp/umap/PlotData.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/ReferenceCluster.java b/src/main/java/org/kpmp/umap/ReferenceCluster.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/SCMetadata.java b/src/main/java/org/kpmp/umap/SCMetadata.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/SCMetadataRepository.java b/src/main/java/org/kpmp/umap/SCMetadataRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/SNMetadata.java b/src/main/java/org/kpmp/umap/SNMetadata.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/SNMetadataRepository.java b/src/main/java/org/kpmp/umap/SNMetadataRepository.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/UmapDataService.java b/src/main/java/org/kpmp/umap/UmapDataService.java old mode 100644 new mode 100755 diff --git a/src/main/java/org/kpmp/umap/UmapPoint.java b/src/main/java/org/kpmp/umap/UmapPoint.java old mode 100644 new mode 100755 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties old mode 100644 new mode 100755 diff --git a/src/main/resources/hazelcast.yaml b/src/main/resources/hazelcast.yaml new file mode 100755 index 0000000..8b17b78 --- /dev/null +++ b/src/main/resources/hazelcast.yaml @@ -0,0 +1,5 @@ +hazelcast: + network: + join: + multicast: + enabled: true \ No newline at end of file diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/DataTypeEnumTest.java b/src/test/java/org/kpmp/DataTypeEnumTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/FullDataTypeEnumTest.java b/src/test/java/org/kpmp/FullDataTypeEnumTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/OmicsTypeEnumTest.java b/src/test/java/org/kpmp/OmicsTypeEnumTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/RTComparisonTypeEnumTest.java b/src/test/java/org/kpmp/RTComparisonTypeEnumTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/TissueTypeEnumTest.java b/src/test/java/org/kpmp/TissueTypeEnumTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/autocomplete/AutocompleteResultTest.java b/src/test/java/org/kpmp/autocomplete/AutocompleteResultTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/autocomplete/AutocompleteServiceTest.java b/src/test/java/org/kpmp/autocomplete/AutocompleteServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeHierarchyTest.java b/src/test/java/org/kpmp/cellType/CellTypeHierarchyTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java b/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeStructureRegionTest.java b/src/test/java/org/kpmp/cellType/CellTypeStructureRegionTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeStructureSubregionTest.java b/src/test/java/org/kpmp/cellType/CellTypeStructureSubregionTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeSynonymIdTest.java b/src/test/java/org/kpmp/cellType/CellTypeSynonymIdTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeSynonymTest.java b/src/test/java/org/kpmp/cellType/CellTypeSynonymTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellType/CellTypeTest.java b/src/test/java/org/kpmp/cellType/CellTypeTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyIdTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyIdTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cluster/ClusterServiceTest.java b/src/test/java/org/kpmp/cluster/ClusterServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/cluster/ClusterTest.java b/src/test/java/org/kpmp/cluster/ClusterTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java b/src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/errors/ErrorControllerTest.java b/src/test/java/org/kpmp/errors/ErrorControllerTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/errors/FrontEndErrorTest.java b/src/test/java/org/kpmp/errors/FrontEndErrorTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/gene/GeneServiceTest.java b/src/test/java/org/kpmp/gene/GeneServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/gene/MyGeneInfoHitTest.java b/src/test/java/org/kpmp/gene/MyGeneInfoHitTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/gene/MyGeneInfoResultTest.java b/src/test/java/org/kpmp/gene/MyGeneInfoResultTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionByTissueTypeTest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionByTissueTypeTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsTest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionDataGTITest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionDataGTITest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/RTGeneExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/RTGeneExpressionDataServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java b/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java b/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionIdTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionIdTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/ParticipantIdTest.java b/src/test/java/org/kpmp/geneExpressionSummary/ParticipantIdTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/RTParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/RTParticipantValueTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java b/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java b/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/participant/SpatialViewerDataTypeTest.java b/src/test/java/org/kpmp/participant/SpatialViewerDataTypeTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/umap/FeatureDataTest.java b/src/test/java/org/kpmp/umap/FeatureDataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/umap/PlotDataTest.java b/src/test/java/org/kpmp/umap/PlotDataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/umap/ReferenceClusterTest.java b/src/test/java/org/kpmp/umap/ReferenceClusterTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/umap/SCMetadataTest.java b/src/test/java/org/kpmp/umap/SCMetadataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/umap/SNMetadataTest.java b/src/test/java/org/kpmp/umap/SNMetadataTest.java old mode 100644 new mode 100755 diff --git a/src/test/java/org/kpmp/umap/UmapDataServiceTest.java b/src/test/java/org/kpmp/umap/UmapDataServiceTest.java old mode 100644 new mode 100755 From 7bb07bf676f015833fa645b3e2ef688f57da8189 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Mon, 7 Nov 2022 11:37:03 -0500 Subject: [PATCH 03/30] KPMP-3819: Provider and caching annotations --- .../RTExpressionDataAllSegmentsRepository.java | 4 ++++ .../geneExpression/RTExpressionDataGTIRepository.java | 2 ++ .../geneExpressionSummary/RTParticipantRepository.java | 2 +- .../SCRNAGeneExpressionSummaryRepository.java | 8 ++++---- .../geneExpressionSummary/SCRNAParticipantRepository.java | 2 ++ .../SNRNAGeneExpressionSummaryRepository.java | 2 +- .../geneExpressionSummary/SNRNAParticipantRepository.java | 3 +++ .../participant/ParticipantSummaryDatasetRepository.java | 2 ++ .../kpmp/participant/SingleCellMetadataRepository.java | 2 ++ .../kpmp/participant/SingleNucleusMetadataRepository.java | 3 +++ .../org/kpmp/participant/SpatialViewerTypeRepository.java | 2 ++ src/main/java/org/kpmp/umap/SCMetadataRepository.java | 8 ++++---- src/main/java/org/kpmp/umap/SNMetadataRepository.java | 7 +++++-- 13 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java index 592fdcb..f974986 100755 --- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java +++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java @@ -2,6 +2,7 @@ import java.util.List; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; @@ -9,15 +10,18 @@ @Repository public interface RTExpressionDataAllSegmentsRepository extends CrudRepository { + @Cacheable("rtExpGeneSymbolAndTissueTypeWithCounts") @Query(value = "SELECT rts.*, rsv.sample_count, s.segment_name FROM rt_segments rts " + "LEFT JOIN rt_summary_v rsv ON rts.segment = rsv.segment AND rts.tissue_type = rsv.tissue_type " + "LEFT JOIN segment s on rts.segment = s.abbreviation " + "WHERE rts.tissue_type = :tissueType AND rts.gene_symbol = :geneSymbol", nativeQuery = true) List findByGeneSymbolAndTissueTypeWithCounts(String geneSymbol, String tissueType); + @Cacheable("rtExpByStructure") @Query(value = "CALL rt_diffex_sp(:structure);", nativeQuery = true) List findByStructure(@Param("structure") String structure); + @Cacheable("rtExpCountByGene") @Query(value = "SELECT COUNT(*) FROM rt_segments WHERE gene_symbol = :gene", nativeQuery = true) long getCountByGene(@Param("gene") String gene); diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java index 241bf7d..3b7b4eb 100755 --- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java +++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java @@ -2,12 +2,14 @@ import java.util.List; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface RTExpressionDataGTIRepository extends CrudRepository { + @Cacheable("rtGTIByGeneAndTissue") @Query(value = "SELECT rtg.*, rsv.sample_count, s.segment_name FROM rt_gti rtg " + "LEFT JOIN rt_summary_v rsv ON rtg.segment = rsv.segment AND rtg.tissue_type = rsv.tissue_type " + "LEFT JOIN segment s on rtg.segment = s.abbreviation " diff --git a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java index 641b574..08dd2cd 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java @@ -10,7 +10,7 @@ public interface RTParticipantRepository extends CrudRepository { - @Cacheable("scCounts") + @Cacheable("scCountsAllClusters") @Query(value = "SELECT DISTINCT scc.cluster, scc.cluster_name, scc.cell_count, scc.cluster_id as id, IF(isnull(scr.tissue_type), :tissueType, scr.tissue_type) as tissue_type, IF(isnull(scr.gene), :geneSymbol, scr.gene) as gene, scr.p_val as p_val, scr.p_val_adj as p_val_adj, scr.fold_change, scr.pct_1, scr.pct_2, scr.avg_exp as avg_exp " + "FROM sc_cluster_v scc " + "LEFT JOIN sc_rnaseq scr ON scc.cluster = scr.cluster AND scr.gene = :geneSymbol AND scr.tissue_type = LCASE(:tissueType) " @@ -20,18 +20,18 @@ public interface SCRNAGeneExpressionSummaryRepository List findByTissueAndGeneAllClusters( @Param("geneSymbol") String geneSymbol, @Param("tissueType") String tissueType); - @Cacheable("scCounts") + @Cacheable("scCountsSummaryPerGene") @Query(value = "SELECT DISTINCT scr.cluster, c.cluster_name, 0 as cell_count, scr.id, scr.tissue_type, scr.gene, scr.p_val as p_val, scr.p_val_adj as p_val_adj, scr.fold_change, scr.pct_1, scr.pct_2, scr.avg_exp as avg_exp " + "FROM sc_rnaseq scr " + "JOIN cluster c ON scr.cluster = c.abbreviation AND c.cluster_name = :cellType " + "WHERE scr.tissue_type = LCASE(:tissueType) " + "ORDER BY scr.fold_change DESC", nativeQuery = true) List findExpressionSummaryPerGeneByCellTypeAndTissueType( @Param("cellType") String cellType, @Param("tissueType") String tissueType); - @Cacheable("scCounts") + @Cacheable("scCountsByGene") @Query(value = "SELECT COUNT(*) FROM sc_rnaseq scr WHERE scr.gene= :gene", nativeQuery = true) long getCountByGene(@Param("gene") String gene); - @Cacheable("scCounts") + @Cacheable("scCountsByTissue") @Query(value = "select count(*) from (select p.redcap_id from sc_metadata sc " + "join participant p on sc.specimen_id = p.redcap_id " + "where p.tissue_type=:tissueType group by p.redcap_id) as mycount", nativeQuery = true) diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java index f5eddae..08c5e71 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java @@ -1,11 +1,13 @@ package org.kpmp.geneExpressionSummary; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface SCRNAParticipantRepository extends CrudRepository { + @Cacheable("scParticipantCount") @Query(value = "SELECT COUNT(DISTINCT scp.redcap_id) FROM sc_participant_tissue_v scp", nativeQuery = true) Long getParticipantCount(); } diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java index 2eef341..9f79f93 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java @@ -12,7 +12,7 @@ public interface SNRNAGeneExpressionSummaryRepository extends CrudRepository { - @Cacheable("snCounts") + @Cacheable("snCountsBy") @Query(value = "SELECT DISTINCT snc.cluster, snc.cluster_name, snc.cell_count as cell_count, snc.cluster_id as id, IF(isnull(snr.tissue_type), :tissueType, snr.tissue_type) as tissue_type, IF(isnull(snr.gene), :geneSymbol, snr.gene) as gene, snr.p_val as pval, snr.p_val_adj as pval_adj, snr.fold_change, snr.pct_1 as pct1, snr.pct_2 as pct2, snr.avg_exp as avg_exp " + "FROM sn_cluster_v snc " + "LEFT JOIN sn_rnaseq snr ON snc.cluster = snr.cluster AND snr.gene = :geneSymbol AND snr.tissue_type = LCASE(:tissueType) " diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java index 4a77bf3..6b306ba 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java @@ -1,11 +1,14 @@ package org.kpmp.geneExpressionSummary; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface SNRNAParticipantRepository extends CrudRepository { + + @Cacheable("snParticipantCount") @Query(value = "SELECT COUNT(DISTINCT snp.redcap_id) FROM sn_participant_tissue_v snp", nativeQuery = true) Long getParticipantCount(); } diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java index d998cf7..7d38e28 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java @@ -1,5 +1,6 @@ package org.kpmp.participant; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @@ -7,6 +8,7 @@ @Repository public interface ParticipantSummaryDatasetRepository extends CrudRepository { + @Cacheable("participantByRedcap") ParticipantSummaryDataset findByRedcapId(@Param("redcap_id") String redcapId); } diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java index d675e0b..6b59e13 100755 --- a/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java +++ b/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java @@ -1,9 +1,11 @@ package org.kpmp.participant; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.repository.CrudRepository; interface SingleCellMetadataRepository extends CrudRepository { + @Cacheable("scParticipantExistsByRedcap") boolean existsByRedcapId(String redcapId); } diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java index 77acf32..fbaad99 100755 --- a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java +++ b/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java @@ -1,9 +1,12 @@ package org.kpmp.participant; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.repository.CrudRepository; public interface SingleNucleusMetadataRepository extends CrudRepository { + @Cacheable("snParticipantExistsByRedcap") + boolean existsByRedcapId(String redcapId); } diff --git a/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java b/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java index c539297..60b808e 100755 --- a/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java +++ b/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java @@ -2,6 +2,7 @@ import java.util.List; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @@ -9,6 +10,7 @@ public interface SpatialViewerTypeRepository extends CrudRepository { @Override + @Cacheable("svType") public List findAll(); } diff --git a/src/main/java/org/kpmp/umap/SCMetadataRepository.java b/src/main/java/org/kpmp/umap/SCMetadataRepository.java index 0fbe55b..cbcad2e 100755 --- a/src/main/java/org/kpmp/umap/SCMetadataRepository.java +++ b/src/main/java/org/kpmp/umap/SCMetadataRepository.java @@ -9,11 +9,11 @@ public interface SCMetadataRepository extends CrudRepository { - @Cacheable("scMetadata") + @Cacheable("scMetadataAll") @Override List findAll(); - @Cacheable("scMetadata") + @Cacheable("scMetadataLimited") @Query(value = "SELECT " + "umap_x, " + "umap_y, " @@ -26,13 +26,13 @@ public interface SCMetadataRepository extends CrudRepository + "LIMIT :limit", nativeQuery = true) List findLimited(@Param("limit") int limit); - @Cacheable("scMetadata") + @Cacheable("scMetadataCount") @Query(value = "SELECT COUNT(umap_x) FROM sc_umap_point_v;", nativeQuery = true) int findCount(); List findByTissueType(String tissueType); - @Cacheable("scMetadata") + @Cacheable("scMetadataWithTissue") @Query(value = "SELECT " + "umap_x, " + "umap_y, " diff --git a/src/main/java/org/kpmp/umap/SNMetadataRepository.java b/src/main/java/org/kpmp/umap/SNMetadataRepository.java index 19a0aa7..d3daeb3 100755 --- a/src/main/java/org/kpmp/umap/SNMetadataRepository.java +++ b/src/main/java/org/kpmp/umap/SNMetadataRepository.java @@ -9,10 +9,11 @@ interface SNMetadataRepository extends CrudRepository { - @Cacheable("snMetadata") + @Cacheable("snMetadataAll") @Override List findAll(); + @Cacheable("snMetadataLimited") @Query(value = "SELECT " + "umap_x, " + "umap_y, " @@ -25,12 +26,14 @@ interface SNMetadataRepository extends CrudRepository { + "LIMIT :limit", nativeQuery = true) List findLimited(@Param("limit") int limit); + @Cacheable("snMetadataCount") @Query(value = "SELECT COUNT(umap_x) FROM sn_umap_point_v;", nativeQuery = true) int findCount(); + @Cacheable("snMetadataByTissue") List findByTissueType(String tissueType); - @Cacheable("snMetadata") + @Cacheable("snMetadataWithTissue") @Query(value = "SELECT " + "umap_x, " + "umap_y, " From fa55138cff48f9464d645ddad62dfd3bbd240718 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 8 Nov 2022 12:30:50 -0500 Subject: [PATCH 04/30] KPMP-3819: Serializable --- build.gradle | 3 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/java/org/kpmp/Application.java | 16 ++++++++++++++++ .../kpmp/autocomplete/AutocompleteResult.java | 3 ++- src/main/java/org/kpmp/cellType/CellType.java | 3 ++- .../org/kpmp/cellType/CellTypeHierarchy.java | 3 ++- .../kpmp/cellType/CellTypeStructureRegion.java | 3 ++- .../cellType/CellTypeStructureSubregion.java | 3 ++- .../java/org/kpmp/cellType/CellTypeSynonym.java | 3 ++- .../kpmp/cellTypeSummary/ClusterHierarchy.java | 3 ++- .../org/kpmp/dataSummary/DataSummaryValue.java | 3 ++- .../org/kpmp/datasetSummary/DatasetSummary.java | 4 +++- src/main/java/org/kpmp/gene/MyGeneInfoHit.java | 3 ++- .../java/org/kpmp/gene/MyGeneInfoResult.java | 3 ++- .../RTExpressionDataAllSegments.java | 3 ++- .../kpmp/geneExpression/RTExpressionDataGTI.java | 3 ++- .../kpmp/geneExpression/SCExpressionData.java | 4 +++- .../kpmp/geneExpression/SNExpressionData.java | 4 +++- .../GeneExpressionSummary.java | 4 +++- .../RTParticipantValue.java | 3 ++- ...CRNAGeneExpressionExpressionSummaryValue.java | 3 ++- .../SCRNAParticipantValue.java | 3 ++- ...NRNAGeneExpressionExpressionSummaryValue.java | 3 ++- .../SNRNAParticipantValue.java | 3 ++- .../participant/ParticipantSummaryDataset.java | 3 ++- .../org/kpmp/participant/SingleCellMetadata.java | 3 ++- .../kpmp/participant/SingleNucleusMetadata.java | 3 ++- .../kpmp/participant/SpatialViewerDataType.java | 3 ++- src/main/java/org/kpmp/umap/FeatureData.java | 3 ++- src/main/java/org/kpmp/umap/PlotData.java | 3 ++- .../java/org/kpmp/umap/ReferenceCluster.java | 3 ++- src/main/java/org/kpmp/umap/SCMetadata.java | 3 ++- src/main/java/org/kpmp/umap/SNMetadata.java | 3 ++- 33 files changed, 83 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index 4af0b0a..ba0700f 100755 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,8 @@ dependencies { testImplementation 'org.mockito:mockito-core' testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.0.RELEASE' implementation 'org.springframework.boot:spring-boot-starter-cache' - implementation 'com.hazelcast:hazelcast:4.2' + implementation 'com.hazelcast:hazelcast-all:4.2.5' +// implementation 'com.hazelcast:hazelcast-spring:4.1' } springBoot { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ff1ea5b..534a9cb 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip diff --git a/src/main/java/org/kpmp/Application.java b/src/main/java/org/kpmp/Application.java index 8b858c4..28567bd 100755 --- a/src/main/java/org/kpmp/Application.java +++ b/src/main/java/org/kpmp/Application.java @@ -1,11 +1,16 @@ package org.kpmp; +import com.hazelcast.spring.cache.HazelcastCacheManager; +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.core.HazelcastInstance; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -15,6 +20,17 @@ @ComponentScan(basePackages = { "org.kpmp" }) public class Application { +// @Bean +// @Profile("client") +// HazelcastInstance hazelcastInstance() { +// return HazelcastClient.newHazelcastClient(); // (2) +// } +// +// @Bean +// CacheManager cacheManager() { +// return new HazelcastCacheManager(hazelcastInstance()); // (3) +// } + public static void main(String[] args) { SpringApplication.run(Application.class, args); } diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java index 90e17e0..2c0284f 100755 --- a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java +++ b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java @@ -1,8 +1,9 @@ package org.kpmp.autocomplete; +import java.io.Serializable; import java.util.List; -public class AutocompleteResult { +public class AutocompleteResult implements Serializable { private String value; private String name; diff --git a/src/main/java/org/kpmp/cellType/CellType.java b/src/main/java/org/kpmp/cellType/CellType.java index 8c71d82..2c18d3c 100755 --- a/src/main/java/org/kpmp/cellType/CellType.java +++ b/src/main/java/org/kpmp/cellType/CellType.java @@ -1,5 +1,6 @@ package org.kpmp.cellType; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -14,7 +15,7 @@ @Entity @Table(name = "cell_type") -public class CellType { +public class CellType implements Serializable { @Id @Column(name = "cell_type_id") diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java index 46a536f..c30e8e3 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java +++ b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java @@ -1,5 +1,6 @@ package org.kpmp.cellType; +import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -8,7 +9,7 @@ import org.springframework.stereotype.Component; @Component -public class CellTypeHierarchy { +public class CellTypeHierarchy implements Serializable { private Map cellTypeRegionMap = new HashMap<>(); diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java index 3a41f45..d80efeb 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java +++ b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java @@ -1,11 +1,12 @@ package org.kpmp.cellType; +import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -public class CellTypeStructureRegion { +public class CellTypeStructureRegion implements Serializable { private String regionName; private Map subregionMap = new HashMap<>(); diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java index 7758793..d8a9315 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java +++ b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java @@ -1,11 +1,12 @@ package org.kpmp.cellType; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.google.common.base.Objects; -public class CellTypeStructureSubregion { +public class CellTypeStructureSubregion implements Serializable { private String subregionName; private List cellTypes = new ArrayList<>(); diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java index 664ac21..3f0ad7f 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java +++ b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java @@ -8,11 +8,12 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "celltype_synonym") @IdClass(CellTypeSynonymId.class) -public class CellTypeSynonym { +public class CellTypeSynonym implements Serializable { @Id @Column(name="cell_type_id") diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java index 7212d20..1d3a777 100755 --- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java +++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java @@ -7,11 +7,12 @@ import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "cluster_hierarchy_v") @IdClass(ClusterHierarchyId.class) -public class ClusterHierarchy { +public class ClusterHierarchy implements Serializable { @Id @Column(name = "cell_type_id") diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java index ce2ad5c..624cb14 100755 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java @@ -5,10 +5,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "sv_file_v") -public class DataSummaryValue { +public class DataSummaryValue implements Serializable { @Id @Column(name = "file_id") private Integer fileId; diff --git a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java b/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java index de0d659..125485c 100755 --- a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java +++ b/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java @@ -1,6 +1,8 @@ package org.kpmp.datasetSummary; -public class DatasetSummary { +import java.io.Serializable; + +public class DatasetSummary implements Serializable { private String omicsType; private String dataType; private String dataTypeShort; diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java index 4d66ae3..ea25152 100755 --- a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java +++ b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java @@ -1,11 +1,12 @@ package org.kpmp.gene; +import java.io.Serializable; import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; -public class MyGeneInfoHit implements Comparable { +public class MyGeneInfoHit implements Comparable, Serializable { private String id; private String symbol; private String name; diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java index 5cc8457..b0fa067 100755 --- a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java +++ b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java @@ -1,8 +1,9 @@ package org.kpmp.gene; +import java.io.Serializable; import java.util.List; -public class MyGeneInfoResult { +public class MyGeneInfoResult implements Serializable { private int total; private List hits; diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java index 0d269c0..97235e8 100755 --- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java +++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java @@ -4,10 +4,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "rt_segments") -public class RTExpressionDataAllSegments implements RTExpressionData { +public class RTExpressionDataAllSegments implements RTExpressionData, Serializable { @Id @Column(name = "id") diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java index ba5f6a9..603ea54 100755 --- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java +++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java @@ -4,10 +4,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "rt_gti") -public class RTExpressionDataGTI implements RTExpressionData { +public class RTExpressionDataGTI implements RTExpressionData, Serializable { @Id @Column(name = "id") diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java index 71d80cc..020c8ef 100755 --- a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java +++ b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java @@ -8,9 +8,11 @@ import org.json.JSONException; import org.json.JSONObject; +import java.io.Serializable; + @Entity @Table(name = "sc_feature_data") -class SCExpressionData { +class SCExpressionData implements Serializable { @Id @Column(name = "gene_symbol") diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java index 1ecd5f2..7929651 100755 --- a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java +++ b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java @@ -8,9 +8,11 @@ import org.json.JSONException; import org.json.JSONObject; +import java.io.Serializable; + @Entity @Table(name = "sn_feature_data") -class SNExpressionData { +class SNExpressionData implements Serializable { @Id @Column(name = "gene_symbol") diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java index 3809057..4e11441 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java @@ -1,6 +1,8 @@ package org.kpmp.geneExpressionSummary; -public interface GeneExpressionSummary { +import java.io.Serializable; + +public interface GeneExpressionSummary implements Serializable { Integer getId(); diff --git a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java index be9c78b..4a5639b 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java @@ -5,11 +5,12 @@ import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "rt_participant_tissue_v") @IdClass(ParticipantId.class) -class RTParticipantValue implements Participant { +class RTParticipantValue implements Participant, Serializable { @Column(name = "tissue_type") private String tissueType; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java index 1d8a43e..4aa8c40 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java @@ -1,6 +1,7 @@ package org.kpmp.geneExpressionSummary; import java.beans.Transient; +import java.io.Serializable; import javax.annotation.Nullable; import javax.persistence.Column; @@ -14,7 +15,7 @@ @Entity @Table(name = "sc_rnaseq") @IdClass(GeneExpressionId.class) -public class SCRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary { +public class SCRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable { @Column(name = "id") private Integer id; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java index 7a583f0..d52bda7 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java @@ -5,11 +5,12 @@ import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "sn_participant_tissue_v") @IdClass(ParticipantId.class) -public class SCRNAParticipantValue { +public class SCRNAParticipantValue implements Serializable { @Column(name = "tissue_type") private String tissueType; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java index 51aeabe..6f12920 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java @@ -9,11 +9,12 @@ import javax.persistence.IdClass; import javax.persistence.Table; import javax.persistence.Transient; +import java.io.Serializable; @Entity @Table(name = "sn_rnaseq") @IdClass(GeneExpressionId.class) -public class SNRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary { +public class SNRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable { @Column(name = "id") private Integer id; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java index d61ec4e..2b6eb04 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java @@ -5,11 +5,12 @@ import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "sn_participant_tissue_v") @IdClass(ParticipantId.class) -public class SNRNAParticipantValue implements Participant { +public class SNRNAParticipantValue implements Participant, Serializable { @Column(name = "tissue_type") private String tissueType; diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java index 7b144a2..58e5897 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java @@ -4,10 +4,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "participant") -public class ParticipantSummaryDataset { +public class ParticipantSummaryDataset implements Serializable { @Id @Column(name = "participant_id") private int participantId; diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadata.java b/src/main/java/org/kpmp/participant/SingleCellMetadata.java index df60828..fea984b 100755 --- a/src/main/java/org/kpmp/participant/SingleCellMetadata.java +++ b/src/main/java/org/kpmp/participant/SingleCellMetadata.java @@ -4,10 +4,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "sc_metadata") -class SingleCellMetadata { +class SingleCellMetadata implements Serializable { @Id private String barcode; diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java index b8f066d..d92341f 100755 --- a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java +++ b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java @@ -4,10 +4,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "sn_metadata") -class SingleNucleusMetadata { +class SingleNucleusMetadata implements Serializable { @Id private String barcode; diff --git a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java index 6b9503d..738231c 100755 --- a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java +++ b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java @@ -4,10 +4,11 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.io.Serializable; @Entity @Table(name = "sv_data_type_v") -class SpatialViewerDataType { +class SpatialViewerDataType implements Serializable { @Id @Column(name = "data_type") diff --git a/src/main/java/org/kpmp/umap/FeatureData.java b/src/main/java/org/kpmp/umap/FeatureData.java index 35e8235..afa311e 100755 --- a/src/main/java/org/kpmp/umap/FeatureData.java +++ b/src/main/java/org/kpmp/umap/FeatureData.java @@ -1,9 +1,10 @@ package org.kpmp.umap; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; -public class FeatureData { +public class FeatureData implements Serializable { private List xValues = new ArrayList<>(); private List yValues = new ArrayList<>(); diff --git a/src/main/java/org/kpmp/umap/PlotData.java b/src/main/java/org/kpmp/umap/PlotData.java index 2635ac3..47b3b3d 100755 --- a/src/main/java/org/kpmp/umap/PlotData.java +++ b/src/main/java/org/kpmp/umap/PlotData.java @@ -1,8 +1,9 @@ package org.kpmp.umap; +import java.io.Serializable; import java.util.List; -public class PlotData { +public class PlotData implements Serializable { private List referenceData; private List featureData; diff --git a/src/main/java/org/kpmp/umap/ReferenceCluster.java b/src/main/java/org/kpmp/umap/ReferenceCluster.java index 3728625..c65eb87 100755 --- a/src/main/java/org/kpmp/umap/ReferenceCluster.java +++ b/src/main/java/org/kpmp/umap/ReferenceCluster.java @@ -1,9 +1,10 @@ package org.kpmp.umap; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; -public class ReferenceCluster { +public class ReferenceCluster implements Serializable { private List xValues = new ArrayList<>(); private List yValues = new ArrayList<>(); diff --git a/src/main/java/org/kpmp/umap/SCMetadata.java b/src/main/java/org/kpmp/umap/SCMetadata.java index 7e7e0d7..96aa658 100755 --- a/src/main/java/org/kpmp/umap/SCMetadata.java +++ b/src/main/java/org/kpmp/umap/SCMetadata.java @@ -5,10 +5,11 @@ import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; +import java.io.Serializable; @Entity @Table(name = "sc_umap_point_v") -public class SCMetadata implements UmapPoint { +public class SCMetadata implements UmapPoint, Serializable { @Column(name = "umap_x") private double umapX; diff --git a/src/main/java/org/kpmp/umap/SNMetadata.java b/src/main/java/org/kpmp/umap/SNMetadata.java index f9a840d..5365c50 100755 --- a/src/main/java/org/kpmp/umap/SNMetadata.java +++ b/src/main/java/org/kpmp/umap/SNMetadata.java @@ -5,10 +5,11 @@ import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; +import java.io.Serializable; @Entity @Table(name = "sn_umap_point_v") -public class SNMetadata implements UmapPoint { +public class SNMetadata implements UmapPoint, Serializable { @Column(name = "umap_x") private double umapX; From 663df812f6aa394825cc163c4b314c988b2f1459 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 8 Nov 2022 12:51:49 -0500 Subject: [PATCH 05/30] KPMP-3819: Use serializable class --- src/main/java/org/kpmp/gene/GeneService.java | 4 ++-- .../org/kpmp/geneExpressionSummary/GeneExpressionSummary.java | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/kpmp/gene/GeneService.java b/src/main/java/org/kpmp/gene/GeneService.java index abdf5bb..ed16a67 100755 --- a/src/main/java/org/kpmp/gene/GeneService.java +++ b/src/main/java/org/kpmp/gene/GeneService.java @@ -73,7 +73,7 @@ public List querySymbolAndAlias(String queryString) throws IOExce List finalResults = new ArrayList<>(); finalResults.addAll(sortAndSlice(symbolResults, 10)); finalResults.addAll(sortAndSlice(aliasResults, 10)); - return finalResults.size() <= 10 ? finalResults : finalResults.subList(0, 10); + return finalResults.size() <= 10 ? finalResults : new ArrayList<>(finalResults.subList(0, 10)); } private List sortAndSlice(List hits, int max) { @@ -81,7 +81,7 @@ private List sortAndSlice(List hits, int max) { return new ArrayList(); } Collections.sort(hits); - return hits.size() <= max ? hits : hits.subList(0, max); + return hits.size() <= max ? hits : new ArrayList<>(hits.subList(0, max)); } } diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java index 4e11441..3809057 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java @@ -1,8 +1,6 @@ package org.kpmp.geneExpressionSummary; -import java.io.Serializable; - -public interface GeneExpressionSummary implements Serializable { +public interface GeneExpressionSummary { Integer getId(); From 08a3550c6c33c7ba590a57a800fc54a215e4f5d9 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 8 Nov 2022 14:00:51 -0500 Subject: [PATCH 06/30] KPMP-3819: Commented out code --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index ba0700f..275a5e4 100755 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,6 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.0.RELEASE' implementation 'org.springframework.boot:spring-boot-starter-cache' implementation 'com.hazelcast:hazelcast-all:4.2.5' -// implementation 'com.hazelcast:hazelcast-spring:4.1' } springBoot { From b2300c64aec44594c3573288d003aad0f8a88977 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 8 Nov 2022 14:01:46 -0500 Subject: [PATCH 07/30] KPMP-3819: Commented out code 2 --- src/main/java/org/kpmp/Application.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/main/java/org/kpmp/Application.java b/src/main/java/org/kpmp/Application.java index 28567bd..01df6c3 100755 --- a/src/main/java/org/kpmp/Application.java +++ b/src/main/java/org/kpmp/Application.java @@ -20,17 +20,6 @@ @ComponentScan(basePackages = { "org.kpmp" }) public class Application { -// @Bean -// @Profile("client") -// HazelcastInstance hazelcastInstance() { -// return HazelcastClient.newHazelcastClient(); // (2) -// } -// -// @Bean -// CacheManager cacheManager() { -// return new HazelcastCacheManager(hazelcastInstance()); // (3) -// } - public static void main(String[] args) { SpringApplication.run(Application.class, args); } From 7a2cd9fa02ef8aa18e9e4b84bece222d68d14a23 Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Tue, 8 Nov 2022 14:45:57 -0500 Subject: [PATCH 08/30] KPMP-3819: Unused imports --- src/main/java/org/kpmp/Application.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/org/kpmp/Application.java b/src/main/java/org/kpmp/Application.java index 01df6c3..8b858c4 100755 --- a/src/main/java/org/kpmp/Application.java +++ b/src/main/java/org/kpmp/Application.java @@ -1,16 +1,11 @@ package org.kpmp; -import com.hazelcast.spring.cache.HazelcastCacheManager; -import com.hazelcast.client.HazelcastClient; -import com.hazelcast.core.HazelcastInstance; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; From 2b5b44e3006fafe5c7c1d6671a1feb85ab96491b Mon Sep 17 00:00:00 2001 From: Dert1129 Date: Fri, 9 Dec 2022 09:04:05 -0500 Subject: [PATCH 09/30] First commit --- .../java/org/kpmp/participant/ParticipantService.java | 9 ++++++++- .../participant/ParticipantSummaryDatasetRepository.java | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java index 684abad..34f770f 100755 --- a/src/main/java/org/kpmp/participant/ParticipantService.java +++ b/src/main/java/org/kpmp/participant/ParticipantService.java @@ -1,9 +1,12 @@ package org.kpmp.participant; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.kpmp.FullDataTypeEnum; +import org.kpmp.TissueTypeEnum; import org.kpmp.dataSummary.DataSummaryRepository; import org.kpmp.geneExpressionSummary.RTParticipantRepository; import org.slf4j.Logger; @@ -38,7 +41,11 @@ public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTy } public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) { - return participantSummaryDatasetRepository.findByRedcapId(redcapId); + Map participantSummaryDatasetMap = new HashMap<>(); + participantSummaryDatasetMap.put("AKI", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType())); + participantSummaryDatasetMap.put("CKD", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType())); + participantSummaryDatasetMap.put("Healthy Reference", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())); + return (ParticipantSummaryDataset) participantSummaryDatasetMap; } public ParticipantDataTypeSummary getExperimentCounts(String redcapId) { diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java index 7d38e28..274c868 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java @@ -1,6 +1,7 @@ package org.kpmp.participant; import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @@ -11,4 +12,7 @@ public interface ParticipantSummaryDatasetRepository extends CrudRepository Date: Wed, 14 Dec 2022 10:23:37 -0500 Subject: [PATCH 10/30] changed to HEALTHY_REFERENCE --- src/main/java/org/kpmp/participant/ParticipantService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java index 34f770f..e8bb10d 100755 --- a/src/main/java/org/kpmp/participant/ParticipantService.java +++ b/src/main/java/org/kpmp/participant/ParticipantService.java @@ -44,7 +44,7 @@ public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) { Map participantSummaryDatasetMap = new HashMap<>(); participantSummaryDatasetMap.put("AKI", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType())); participantSummaryDatasetMap.put("CKD", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType())); - participantSummaryDatasetMap.put("Healthy Reference", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())); + participantSummaryDatasetMap.put("HEALTHY_REFERENCE", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())); return (ParticipantSummaryDataset) participantSummaryDatasetMap; } From 4e2ec90be937e13aad06ae07f07c63f40d2bc7b2 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Wed, 14 Dec 2022 10:41:34 -0500 Subject: [PATCH 11/30] return hashmap --- src/main/java/org/kpmp/participant/ParticipantService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java index e8bb10d..5e9923e 100755 --- a/src/main/java/org/kpmp/participant/ParticipantService.java +++ b/src/main/java/org/kpmp/participant/ParticipantService.java @@ -40,12 +40,12 @@ public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTy this.participantSummaryDatasetRepository = participantSummaryDatasetRepository; } - public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) { + public Map getParticipantSummaryDataset(String redcapId) { Map participantSummaryDatasetMap = new HashMap<>(); participantSummaryDatasetMap.put("AKI", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType())); participantSummaryDatasetMap.put("CKD", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType())); participantSummaryDatasetMap.put("HEALTHY_REFERENCE", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())); - return (ParticipantSummaryDataset) participantSummaryDatasetMap; + return participantSummaryDatasetMap; } public ParticipantDataTypeSummary getExperimentCounts(String redcapId) { From 8cc4f2c5e74061c742e062156755f8cdefa34293 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Wed, 14 Dec 2022 13:47:12 -0500 Subject: [PATCH 12/30] imported map --- src/main/java/org/kpmp/Query.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java index 29e8ded..d501286 100755 --- a/src/main/java/org/kpmp/Query.java +++ b/src/main/java/org/kpmp/Query.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.kpmp.autocomplete.AutocompleteResult; import org.kpmp.autocomplete.AutocompleteService; @@ -150,7 +151,7 @@ public ParticipantDataTypeSummary getDataTypeInformationByParticipant(String red return participantService.getExperimentCounts(redcapId); } - public ParticipantSummaryDataset participantSummaryDataset(String redcap_id) throws Exception { + public Map participantSummaryDataset(String redcap_id) throws Exception { try { return participantService.getParticipantSummaryDataset(redcap_id); } catch (Exception e) { @@ -162,7 +163,7 @@ public ParticipantSummaryDataset participantSummaryDataset(String redcap_id) thr } } - public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) throws Exception { + public Map participantClinicalDataset(String redcap_id) throws Exception { return this.participantSummaryDataset(redcap_id); } } From dba0c16f70d14590448fc1667690235a44645d4c Mon Sep 17 00:00:00 2001 From: Dert1129 Date: Fri, 16 Dec 2022 13:19:23 -0500 Subject: [PATCH 13/30] change to ordinary java object --- .../ParticipantDataTypeSummary.java | 33 ++++++++++++++++++- .../kpmp/participant/ParticipantService.java | 9 ++--- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java index 39859e0..3777d9d 100755 --- a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java +++ b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java @@ -6,10 +6,18 @@ @Component public class ParticipantDataTypeSummary { - + private Long akiCount; + private Long ckdCount; + private Long hrtCount; private List spatialViewerDataTypes; private List explorerDataTypes; + public ParticipantDataTypeSummary(Long akiCount, Long ckdCount, Long hrtCount) { + this.akiCount = akiCount; + this.ckdCount = ckdCount; + this.hrtCount = hrtCount; +} + public List getSpatialViewerDataTypes() { return spatialViewerDataTypes; } @@ -26,4 +34,27 @@ public void setExplorerDataTypes(List explorerDa this.explorerDataTypes = explorerDataTypes; } + public Long getAkiCount() { + return this.akiCount; + } + + public void setAkiCount(Long akiCount) { + this.akiCount = akiCount; + } + + public Long getCkdCount() { + return this.ckdCount; + } + + public void setCkdCount(Long ckdCount) { + this.ckdCount = ckdCount; + } + + public Long getHrtCount() { + return this.hrtCount; + } + + public void setHrtCount(Long hrtCount) { + this.hrtCount = hrtCount; + } } diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java index 5e9923e..7492bfe 100755 --- a/src/main/java/org/kpmp/participant/ParticipantService.java +++ b/src/main/java/org/kpmp/participant/ParticipantService.java @@ -40,13 +40,8 @@ public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTy this.participantSummaryDatasetRepository = participantSummaryDatasetRepository; } - public Map getParticipantSummaryDataset(String redcapId) { - Map participantSummaryDatasetMap = new HashMap<>(); - participantSummaryDatasetMap.put("AKI", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType())); - participantSummaryDatasetMap.put("CKD", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType())); - participantSummaryDatasetMap.put("HEALTHY_REFERENCE", participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())); - return participantSummaryDatasetMap; - } + + public List get public ParticipantDataTypeSummary getExperimentCounts(String redcapId) { ParticipantDataTypeSummary summaryData = new ParticipantDataTypeSummary(); From c5656a4c03e6fadf70d262ec34789adbe121a317 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Fri, 16 Dec 2022 15:26:24 -0500 Subject: [PATCH 14/30] added tissue type --- src/main/java/org/kpmp/Query.java | 7 ++-- .../ParticipantDataTypeSummary.java | 34 ---------------- .../kpmp/participant/ParticipantService.java | 20 ++++++++-- .../ParticipantTissueTypeSummary.java | 39 +++++++++++++++++++ 4 files changed, 58 insertions(+), 42 deletions(-) create mode 100644 src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java index d501286..29866fe 100755 --- a/src/main/java/org/kpmp/Query.java +++ b/src/main/java/org/kpmp/Query.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Map; import org.kpmp.autocomplete.AutocompleteResult; import org.kpmp.autocomplete.AutocompleteService; @@ -151,7 +150,7 @@ public ParticipantDataTypeSummary getDataTypeInformationByParticipant(String red return participantService.getExperimentCounts(redcapId); } - public Map participantSummaryDataset(String redcap_id) throws Exception { + public ParticipantSummaryDataset participantSummaryDataset(String redcap_id) throws Exception { try { return participantService.getParticipantSummaryDataset(redcap_id); } catch (Exception e) { @@ -163,7 +162,7 @@ public Map participantSummaryDataset(String redcap_id) throws E } } - public Map participantClinicalDataset(String redcap_id) throws Exception { + public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) throws Exception { return this.participantSummaryDataset(redcap_id); } -} +} \ No newline at end of file diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java index 3777d9d..51ba482 100755 --- a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java +++ b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java @@ -6,18 +6,8 @@ @Component public class ParticipantDataTypeSummary { - private Long akiCount; - private Long ckdCount; - private Long hrtCount; private List spatialViewerDataTypes; private List explorerDataTypes; - - public ParticipantDataTypeSummary(Long akiCount, Long ckdCount, Long hrtCount) { - this.akiCount = akiCount; - this.ckdCount = ckdCount; - this.hrtCount = hrtCount; -} - public List getSpatialViewerDataTypes() { return spatialViewerDataTypes; } @@ -33,28 +23,4 @@ public List getExplorerDataTypes() { public void setExplorerDataTypes(List explorerDataTypes) { this.explorerDataTypes = explorerDataTypes; } - - public Long getAkiCount() { - return this.akiCount; - } - - public void setAkiCount(Long akiCount) { - this.akiCount = akiCount; - } - - public Long getCkdCount() { - return this.ckdCount; - } - - public void setCkdCount(Long ckdCount) { - this.ckdCount = ckdCount; - } - - public Long getHrtCount() { - return this.hrtCount; - } - - public void setHrtCount(Long hrtCount) { - this.hrtCount = hrtCount; - } } diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java index 7492bfe..7052a34 100755 --- a/src/main/java/org/kpmp/participant/ParticipantService.java +++ b/src/main/java/org/kpmp/participant/ParticipantService.java @@ -1,9 +1,7 @@ package org.kpmp.participant; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.kpmp.FullDataTypeEnum; import org.kpmp.TissueTypeEnum; @@ -26,22 +24,36 @@ public class ParticipantService { private final String SPATIAL_VIEWER_LINK_VIEW = "sv_link_v"; private SingleNucleusMetadataRepository snMetadataRepo; private RTParticipantRepository rtParticipantRepo; + private ParticipantTissueTypeSummary particpantTissueTypeSummary; @Autowired public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTypeRepository svTypeRepo, SingleCellMetadataRepository scMetadataRepo, SingleNucleusMetadataRepository snMetadataRepo, RTParticipantRepository rtParticipantRepo, - ParticipantSummaryDatasetRepository participantSummaryDatasetRepository) { + ParticipantSummaryDatasetRepository participantSummaryDatasetRepository, + ParticipantTissueTypeSummary participantTissueTypeSummary) { this.dataSummaryRepo = dataSummaryRepo; this.svTypeRepo = svTypeRepo; this.scMetadataRepo = scMetadataRepo; this.snMetadataRepo = snMetadataRepo; this.rtParticipantRepo = rtParticipantRepo; this.participantSummaryDatasetRepository = participantSummaryDatasetRepository; + this.particpantTissueTypeSummary = participantTissueTypeSummary; + } + + public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) { + return participantSummaryDatasetRepository.findByRedcapId(redcapId); } + public List getTissueData(){ + List tissueData = new ArrayList<>(); - public List get + tissueData.add(new ParticipantTissueTypeSummary( + participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType()), + participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType()), + participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()))); + return tissueData; + } public ParticipantDataTypeSummary getExperimentCounts(String redcapId) { ParticipantDataTypeSummary summaryData = new ParticipantDataTypeSummary(); diff --git a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java new file mode 100644 index 0000000..c3652cc --- /dev/null +++ b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java @@ -0,0 +1,39 @@ +package org.kpmp.participant; +import org.springframework.stereotype.Component; + +@Component +public class ParticipantTissueTypeSummary { + private Integer akiCount; + private Integer ckdCount; + private Integer hrtCount; + + public ParticipantTissueTypeSummary(Integer akiCount, Integer ckdCount, Integer hrtCount) { + this.akiCount = akiCount; + this.ckdCount = ckdCount; + this.hrtCount = hrtCount; + } + + public Integer getAkiCount() { + return this.akiCount; + } + + public void setAkiCount(Integer akiCount) { + this.akiCount = akiCount; + } + + public Integer getCkdCount() { + return this.ckdCount; + } + + public void setCkdCount(Integer ckdCount) { + this.ckdCount = ckdCount; + } + + public Integer getHrtCount() { + return this.hrtCount; + } + + public void setHrtCount(Integer hrtCount) { + this.hrtCount = hrtCount; + } +} From dc44ca37d114eb9d5f490a7b99d30298d42cbc02 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Mon, 19 Dec 2022 11:59:51 -0500 Subject: [PATCH 15/30] Added tissueCount test --- .../ParticipantTissueTypeSummaryTest.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java diff --git a/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java b/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java new file mode 100644 index 0000000..6f6d53a --- /dev/null +++ b/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java @@ -0,0 +1,45 @@ +package org.kpmp.participant; + +import static org.junit.Assert.assertEquals; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ParticipantTissueTypeSummaryTest { + private ParticipantTissueTypeSummary tissueSummary; + + @Before + public void setUp() { + tissueSummary = new ParticipantTissueTypeSummary(Integer.valueOf(2), Integer.valueOf(6), Integer.valueOf(1)); + } + + @After + public void tearDown() { + tissueSummary = null; + } + + @Test + public void testInitialSetup() throws Exception { + assertEquals(Integer.valueOf(2), tissueSummary.getAkiCount()); + assertEquals(Integer.valueOf(6), tissueSummary.getCkdCount()); + assertEquals(Integer.valueOf(1), tissueSummary.getHrtCount()); + } + + @Test + public void testSetAkiCount() throws Exception { + tissueSummary.setAkiCount(Integer.valueOf(4*10)); + assertEquals(Integer.valueOf(2*9), tissueSummary.getAkiCount()); + } + + @Test + public void testSetCkdCount() throws Exception { + tissueSummary.setCkdCount(Integer.valueOf(5*10)); + assertEquals(Integer.valueOf(5*10), tissueSummary.getCkdCount()); + } + + @Test + public void testSetHrtCount() throws Exception { + tissueSummary.setHrtCount(Integer.valueOf(6*10)); + assertEquals(Integer.valueOf(6*10), tissueSummary.getHrtCount()); + } +} \ No newline at end of file From 67490af081b02f6a02a6b5fb88fcb83f30fedd8a Mon Sep 17 00:00:00 2001 From: dert1129 Date: Mon, 19 Dec 2022 12:00:21 -0500 Subject: [PATCH 16/30] added participant tissue summary query --- src/main/java/org/kpmp/Query.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java index 29866fe..30c0d1f 100755 --- a/src/main/java/org/kpmp/Query.java +++ b/src/main/java/org/kpmp/Query.java @@ -20,6 +20,7 @@ import org.kpmp.geneExpressionSummary.GeneExpressionSummary; import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService; import org.kpmp.participant.ParticipantDataTypeSummary; +import org.kpmp.participant.ParticipantTissueTypeSummary; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; import org.kpmp.umap.PlotData; @@ -165,4 +166,13 @@ public ParticipantSummaryDataset participantSummaryDataset(String redcap_id) thr public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) throws Exception { return this.participantSummaryDataset(redcap_id); } + + public List getTissueTypeSummaryData() throws Exception { + try { + return participantService.getTissueData(); + }catch (Exception e) { + logger.error(e.getMessage()); + throw e; + } + } } \ No newline at end of file From f209be85f643011030d6a874972a6e493749faee Mon Sep 17 00:00:00 2001 From: dert1129 Date: Mon, 19 Dec 2022 12:26:03 -0500 Subject: [PATCH 17/30] removed unused code --- src/main/java/org/kpmp/participant/ParticipantService.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java index 7052a34..02a15bd 100755 --- a/src/main/java/org/kpmp/participant/ParticipantService.java +++ b/src/main/java/org/kpmp/participant/ParticipantService.java @@ -24,21 +24,18 @@ public class ParticipantService { private final String SPATIAL_VIEWER_LINK_VIEW = "sv_link_v"; private SingleNucleusMetadataRepository snMetadataRepo; private RTParticipantRepository rtParticipantRepo; - private ParticipantTissueTypeSummary particpantTissueTypeSummary; @Autowired public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTypeRepository svTypeRepo, SingleCellMetadataRepository scMetadataRepo, SingleNucleusMetadataRepository snMetadataRepo, RTParticipantRepository rtParticipantRepo, - ParticipantSummaryDatasetRepository participantSummaryDatasetRepository, - ParticipantTissueTypeSummary participantTissueTypeSummary) { + ParticipantSummaryDatasetRepository participantSummaryDatasetRepository) { this.dataSummaryRepo = dataSummaryRepo; this.svTypeRepo = svTypeRepo; this.scMetadataRepo = scMetadataRepo; this.snMetadataRepo = snMetadataRepo; this.rtParticipantRepo = rtParticipantRepo; this.participantSummaryDatasetRepository = participantSummaryDatasetRepository; - this.particpantTissueTypeSummary = participantTissueTypeSummary; } public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) { From 3ae3fa1881c532a8264de7477af7a7be6be1ddc0 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Mon, 19 Dec 2022 12:26:15 -0500 Subject: [PATCH 18/30] Test tissue count --- src/test/java/org/kpmp/QueryTest.java | 14 +++++++++++++- .../kpmp/participant/ParticipantServiceTest.java | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java index 0a257d4..4b6e857 100755 --- a/src/test/java/org/kpmp/QueryTest.java +++ b/src/test/java/org/kpmp/QueryTest.java @@ -31,6 +31,7 @@ import org.kpmp.geneExpressionSummary.SCRNAGeneExpressionExpressionSummaryValue; import org.kpmp.geneExpressionSummary.SNRNAGeneExpressionExpressionSummaryValue; import org.kpmp.participant.ParticipantDataTypeSummary; +import org.kpmp.participant.ParticipantTissueTypeSummary; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; import org.kpmp.umap.FeatureData; @@ -61,6 +62,8 @@ public class QueryTest { private RTExpressionDataService rtExpressionDataService; @Mock private ParticipantService participantService; + @Mock + private ParticipantTissueTypeSummary participantTissueTypeSummary; @Before public void setUp() throws Exception { @@ -249,4 +252,13 @@ public void testParticipantClinicalDataset() throws Exception { assertEquals(expected, query.participantClinicalDataset("participant_id")); } -} + public void getParticipantTissueTypeSummary() throws Exception { + List expectedResult = new ArrayList<>(); + + expectedResult.add(new ParticipantTissueTypeSummary(Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0))); + + List tissueSummary = query.getTissueTypeSummaryData(); + + assertEquals(expectedResult, tissueSummary); + } +} \ No newline at end of file diff --git a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java index f91acd2..0a19e0a 100755 --- a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java +++ b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java @@ -124,4 +124,15 @@ public void testGetExperimentCounts() { } + @Test + public void testGetTissueCounts() throws Exception { + List result = participantService.getTissueData(); + ParticipantTissueTypeSummary resultDataAki = result.get(0); + ParticipantTissueTypeSummary resultDataCkd = result.get(1); + ParticipantTissueTypeSummary resultDataHrt = result.get(2); + + assertEquals(Integer.valueOf(0), resultDataAki.getAkiCount()); + assertEquals(Integer.valueOf(0), resultDataCkd.getCkdCount()); + assertEquals(Integer.valueOf(0), resultDataHrt.getHrtCount()); + } } \ No newline at end of file From 935f8891bd78c7cbd6ceb6dac4d5a301b694801c Mon Sep 17 00:00:00 2001 From: dert1129 Date: Tue, 20 Dec 2022 09:45:44 -0500 Subject: [PATCH 19/30] Change to Long --- .../ParticipantSummaryDatasetRepository.java | 2 +- .../ParticipantTissueTypeSummary.java | 20 +++++++++---------- src/test/java/org/kpmp/QueryTest.java | 2 +- .../ParticipantTissueTypeSummaryTest.java | 20 +++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java index 274c868..67dbf7b 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java @@ -14,5 +14,5 @@ public interface ParticipantSummaryDatasetRepository extends CrudRepository expectedResult = new ArrayList<>(); - expectedResult.add(new ParticipantTissueTypeSummary(Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0))); + expectedResult.add(new ParticipantTissueTypeSummary(Long.valueOf(4), Long.valueOf(5), Long.valueOf(6))); List tissueSummary = query.getTissueTypeSummaryData(); diff --git a/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java b/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java index 6f6d53a..9432f13 100644 --- a/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java +++ b/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java @@ -10,7 +10,7 @@ public class ParticipantTissueTypeSummaryTest { @Before public void setUp() { - tissueSummary = new ParticipantTissueTypeSummary(Integer.valueOf(2), Integer.valueOf(6), Integer.valueOf(1)); + tissueSummary = new ParticipantTissueTypeSummary(Long.valueOf(4), Long.valueOf(5), Long.valueOf(6)); } @After @@ -20,26 +20,26 @@ public void tearDown() { @Test public void testInitialSetup() throws Exception { - assertEquals(Integer.valueOf(2), tissueSummary.getAkiCount()); - assertEquals(Integer.valueOf(6), tissueSummary.getCkdCount()); - assertEquals(Integer.valueOf(1), tissueSummary.getHrtCount()); + assertEquals(Long.valueOf(4), tissueSummary.getAkiCount()); + assertEquals(Long.valueOf(5), tissueSummary.getCkdCount()); + assertEquals(Long.valueOf(6), tissueSummary.getHrtCount()); } @Test public void testSetAkiCount() throws Exception { - tissueSummary.setAkiCount(Integer.valueOf(4*10)); - assertEquals(Integer.valueOf(2*9), tissueSummary.getAkiCount()); + tissueSummary.setAkiCount(Long.valueOf(4*10)); + assertEquals(Long.valueOf(4*10), tissueSummary.getAkiCount()); } @Test public void testSetCkdCount() throws Exception { - tissueSummary.setCkdCount(Integer.valueOf(5*10)); - assertEquals(Integer.valueOf(5*10), tissueSummary.getCkdCount()); + tissueSummary.setCkdCount(Long.valueOf(5*10)); + assertEquals(Long.valueOf(5*10), tissueSummary.getCkdCount()); } @Test public void testSetHrtCount() throws Exception { - tissueSummary.setHrtCount(Integer.valueOf(6*10)); - assertEquals(Integer.valueOf(6*10), tissueSummary.getHrtCount()); + tissueSummary.setHrtCount(Long.valueOf(6*10)); + assertEquals(Long.valueOf(6*10), tissueSummary.getHrtCount()); } } \ No newline at end of file From aca90dcdff9b3ae265e732d5d5e9b7c1300e5e6a Mon Sep 17 00:00:00 2001 From: dert1129 Date: Tue, 20 Dec 2022 09:45:51 -0500 Subject: [PATCH 20/30] added TissueTypeEnum --- .../participant/ParticipantServiceTest.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java index 0a19e0a..4e168a6 100755 --- a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java +++ b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java @@ -6,7 +6,7 @@ import java.util.Arrays; import java.util.List; - +import org.kpmp.TissueTypeEnum; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -126,13 +126,18 @@ public void testGetExperimentCounts() { @Test public void testGetTissueCounts() throws Exception { + when(participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType())).thenReturn(Long .valueOf(4)); + when(participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType())).thenReturn(Long .valueOf(5)); + when(participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())).thenReturn(Long .valueOf(6)); + List result = participantService.getTissueData(); ParticipantTissueTypeSummary resultDataAki = result.get(0); - ParticipantTissueTypeSummary resultDataCkd = result.get(1); - ParticipantTissueTypeSummary resultDataHrt = result.get(2); + ParticipantTissueTypeSummary resultDataCkd = result.get(0); + ParticipantTissueTypeSummary resultDataHrt = result.get(0); + - assertEquals(Integer.valueOf(0), resultDataAki.getAkiCount()); - assertEquals(Integer.valueOf(0), resultDataCkd.getCkdCount()); - assertEquals(Integer.valueOf(0), resultDataHrt.getHrtCount()); + assertEquals(Long.valueOf(4), resultDataAki.getAkiCount()); + assertEquals(Long.valueOf(5), resultDataCkd.getCkdCount()); + assertEquals(Long.valueOf(6), resultDataHrt.getHrtCount()); } } \ No newline at end of file From 242c40769f7aef36ba5d871aff42690683c0fc82 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Wed, 21 Dec 2022 14:50:15 -0500 Subject: [PATCH 21/30] Imported Long --- .../org/kpmp/participant/ParticipantTissueTypeSummary.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java index c81c558..7ec6cc0 100644 --- a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java +++ b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java @@ -1,8 +1,7 @@ package org.kpmp.participant; -import org.springframework.stereotype.Component; - -@Component -public class ParticipantTissueTypeSummary { +import java.io.Serializable; +import java.lang.Long; +public class ParticipantTissueTypeSummary implements Serializable{ private Long akiCount; private Long ckdCount; private Long hrtCount; From 6a0555d0d1cce062d8a5e2edb9cb00822b99bbac Mon Sep 17 00:00:00 2001 From: dert1129 Date: Tue, 3 Jan 2023 11:43:04 -0500 Subject: [PATCH 22/30] added particiapnTissueTypeSummary --- src/main/resources/knowledge_environment.graphqls | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls index 2d9afbb..c79309a 100755 --- a/src/main/resources/knowledge_environment.graphqls +++ b/src/main/resources/knowledge_environment.graphqls @@ -13,6 +13,13 @@ type Query { getDataTypeInformationByParticipant(redcapId: String!): ParticipantDataTypeSummary participantSummaryDataset(redcapId: String): ParticipantSummaryDataset participantClinicalDataset(redcapId: String): ParticipantSummaryDataset + participantTissueTypeSummary(akiCount: Long, ckdCount: Long, hrtCount: Long): ParticipantTissueTypeSummary +} + +type ParticipantTissueTypeSummary { + akiCount: Long + ckdCount: Long + hrtCount: Long } type ParticipantDataTypeSummary { From b4e3b2089e51849337e32988e87bdaaa8cc96062 Mon Sep 17 00:00:00 2001 From: dert1129 Date: Tue, 3 Jan 2023 13:54:18 -0500 Subject: [PATCH 23/30] Change to Long --- .../kpmp/participant/ParticipantSummaryDatasetRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java index 67dbf7b..6862bf6 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java @@ -7,7 +7,7 @@ import org.springframework.stereotype.Repository; @Repository -public interface ParticipantSummaryDatasetRepository extends CrudRepository { +public interface ParticipantSummaryDatasetRepository extends CrudRepository { @Cacheable("participantByRedcap") ParticipantSummaryDataset findByRedcapId(@Param("redcap_id") String redcapId); From 46e76abe2f29e3738d089614981730afde310afc Mon Sep 17 00:00:00 2001 From: dert1129 Date: Tue, 3 Jan 2023 14:38:06 -0500 Subject: [PATCH 24/30] Added graphql query --- src/main/resources/knowledge_environment.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls index c79309a..6d12b12 100755 --- a/src/main/resources/knowledge_environment.graphqls +++ b/src/main/resources/knowledge_environment.graphqls @@ -13,7 +13,7 @@ type Query { getDataTypeInformationByParticipant(redcapId: String!): ParticipantDataTypeSummary participantSummaryDataset(redcapId: String): ParticipantSummaryDataset participantClinicalDataset(redcapId: String): ParticipantSummaryDataset - participantTissueTypeSummary(akiCount: Long, ckdCount: Long, hrtCount: Long): ParticipantTissueTypeSummary + getTissueTypeSummaryData: [ParticipantTissueTypeSummary] } type ParticipantTissueTypeSummary { From cd00d88533d032967c381048b02a3109c278a27a Mon Sep 17 00:00:00 2001 From: rlreamy Date: Mon, 23 Jan 2023 15:49:10 -0500 Subject: [PATCH 25/30] KPMP-4001: Initial code cleanup --- .gitignore | 1 + src/main/java/org/kpmp/Query.java | 6 +- .../kpmp/autocomplete/AutocompleteResult.java | 1 + src/main/java/org/kpmp/cellType/CellType.java | 2 + .../org/kpmp/cellType/CellTypeHierarchy.java | 8 +- .../cellType/CellTypeStructureRegion.java | 1 + .../cellType/CellTypeStructureSubregion.java | 1 + .../org/kpmp/cellType/CellTypeSynonym.java | 51 ++--- .../cellTypeSummary/ClusterHierarchy.java | 56 ++--- .../kpmp/dataSummary/DataSummaryService.java | 20 +- .../kpmp/dataSummary/DataSummaryValue.java | 75 +++---- .../kpmp/datasetSummary/DatasetSummary.java | 76 ------- .../java/org/kpmp/gene/MyGeneInfoHit.java | 105 ++++----- .../java/org/kpmp/gene/MyGeneInfoResult.java | 29 +-- .../RTExpressionDataAllSegments.java | 6 +- .../geneExpression/RTExpressionDataGTI.java | 6 +- .../kpmp/geneExpression/SCExpressionData.java | 5 +- .../kpmp/geneExpression/SNExpressionData.java | 5 +- .../GeneExpressionSummaryService.java | 12 +- .../RTParticipantValue.java | 5 +- ...AGeneExpressionExpressionSummaryValue.java | 1 + .../SCRNAParticipantValue.java | 5 +- ...AGeneExpressionExpressionSummaryValue.java | 16 +- .../SNRNAParticipantValue.java | 5 +- .../ParticipantSummaryDataset.java | 204 +++++++++--------- .../ParticipantTissueTypeSummary.java | 40 ++-- .../kpmp/participant/SingleCellMetadata.java | 4 +- .../participant/SingleNucleusMetadata.java | 4 +- .../participant/SpatialViewerDataType.java | 5 +- .../TissueTypeSummaryByDataType.java | 81 +++++++ src/main/java/org/kpmp/umap/FeatureData.java | 24 +-- src/main/java/org/kpmp/umap/PlotData.java | 1 + .../java/org/kpmp/umap/ReferenceCluster.java | 13 +- src/main/java/org/kpmp/umap/SCMetadata.java | 24 ++- src/main/java/org/kpmp/umap/SNMetadata.java | 24 ++- src/test/java/org/kpmp/QueryTest.java | 10 +- .../dataSummary/DataSummaryServiceTest.java | 4 +- .../GeneExpressionSummaryServiceTest.java | 10 +- .../participant/SingleCellMetadataTest.java | 2 +- .../SingleNucleusMetadataTest.java | 2 +- .../TissueTypeSummaryByDataTypeTest.java} | 8 +- 41 files changed, 511 insertions(+), 447 deletions(-) delete mode 100755 src/main/java/org/kpmp/datasetSummary/DatasetSummary.java create mode 100755 src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java rename src/test/java/org/kpmp/{datasetSummary/DatasetSummaryTest.java => repositorySummary/TissueTypeSummaryByDataTypeTest.java} (91%) diff --git a/.gitignore b/.gitignore index 7728c0a..e91f6df 100755 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ build .settings bin .gradle +.DS_Store diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java index 30c0d1f..317b5d2 100755 --- a/src/main/java/org/kpmp/Query.java +++ b/src/main/java/org/kpmp/Query.java @@ -11,7 +11,6 @@ import org.kpmp.cellTypeSummary.ClusterHierarchy; import org.kpmp.cellTypeSummary.ClusterHierarchyService; import org.kpmp.dataSummary.DataSummaryService; -import org.kpmp.datasetSummary.DatasetSummary; import org.kpmp.gene.GeneService; import org.kpmp.gene.MyGeneInfoHit; import org.kpmp.geneExpression.RTExpressionByTissueType; @@ -21,6 +20,7 @@ import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService; import org.kpmp.participant.ParticipantDataTypeSummary; import org.kpmp.participant.ParticipantTissueTypeSummary; +import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; import org.kpmp.umap.PlotData; @@ -100,7 +100,7 @@ public PlotData getUmapPlotData(String dataType, String geneSymbol, String tissu } } - public List getGeneDatasetInformation(String geneSymbol) throws Exception { + public List getGeneDatasetInformation(String geneSymbol) throws Exception { try { return geneExpressionSummaryService.getGeneDatasetInformation(geneSymbol); } catch (Exception e) { @@ -109,7 +109,7 @@ public List getGeneDatasetInformation(String geneSymbol) throws } } - public List getSummaryData() throws Exception { + public List getSummaryData() throws Exception { try { return dataSummaryService.getSummaryData(); } catch (Exception e) { diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java index 2c0284f..3d07095 100755 --- a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java +++ b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java @@ -5,6 +5,7 @@ public class AutocompleteResult implements Serializable { + private static final long serialVersionUID = 762733408490639258L; private String value; private String name; private String id; diff --git a/src/main/java/org/kpmp/cellType/CellType.java b/src/main/java/org/kpmp/cellType/CellType.java index 2c18d3c..e336d0d 100755 --- a/src/main/java/org/kpmp/cellType/CellType.java +++ b/src/main/java/org/kpmp/cellType/CellType.java @@ -17,6 +17,8 @@ @Table(name = "cell_type") public class CellType implements Serializable { + private static final long serialVersionUID = -7240769211757430938L; + @Id @Column(name = "cell_type_id") private int cellTypeId; diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java index c30e8e3..dfc7470 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java +++ b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java @@ -10,7 +10,8 @@ @Component public class CellTypeHierarchy implements Serializable { - + + private static final long serialVersionUID = 4174487460309851924L; private Map cellTypeRegionMap = new HashMap<>(); public List getCellTypeRegions() { @@ -20,7 +21,7 @@ public List getCellTypeRegions() { } public void addCellTypeStructureRegion(CellTypeStructureRegion region) { - + if (cellTypeRegionMap.containsKey(region.getRegionName())) { CellTypeStructureRegion existingRegion = cellTypeRegionMap.get(region.getRegionName()); List subregions = region.getCellTypeSubregions(); @@ -32,7 +33,4 @@ public void addCellTypeStructureRegion(CellTypeStructureRegion region) { } } - - } - diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java index d80efeb..185fe66 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java +++ b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java @@ -8,6 +8,7 @@ public class CellTypeStructureRegion implements Serializable { + private static final long serialVersionUID = 3141535632314917816L; private String regionName; private Map subregionMap = new HashMap<>(); private List subregionOrderdList = new ArrayList<>(); diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java index d8a9315..b6be2c0 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java +++ b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java @@ -8,6 +8,7 @@ public class CellTypeStructureSubregion implements Serializable { + private static final long serialVersionUID = 1366955014710403152L; private String subregionName; private List cellTypes = new ArrayList<>(); diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java index 3f0ad7f..f33f904 100755 --- a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java +++ b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java @@ -1,45 +1,48 @@ package org.kpmp.cellType; -import javax.persistence.FetchType; -import javax.persistence.Id; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "celltype_synonym") @IdClass(CellTypeSynonymId.class) public class CellTypeSynonym implements Serializable { - @Id - @Column(name="cell_type_id") - private int cellTypeId; + private static final long serialVersionUID = -5650797130903696615L; + + @Id + @Column(name = "cell_type_id") + private int cellTypeId; - @Id - @Column(name="cell_type_synonym") - private String cellTypeSynonym; + @Id + @Column(name = "cell_type_synonym") + private String cellTypeSynonym; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name="cell_type_id", nullable = false, insertable = false, updatable = false) - private CellType cellType; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "cell_type_id", nullable = false, insertable = false, updatable = false) + private CellType cellType; - public int getCellTypeId() { - return cellTypeId; - } + public int getCellTypeId() { + return cellTypeId; + } - public void setCellTypeId(int cellTypeId) { - this.cellTypeId = cellTypeId; - } + public void setCellTypeId(int cellTypeId) { + this.cellTypeId = cellTypeId; + } - public String getCellTypeSynonym() { - return cellTypeSynonym; - } + public String getCellTypeSynonym() { + return cellTypeSynonym; + } - public void setCellTypeSynonym(String cellTypeSynonym) { - this.cellTypeSynonym = cellTypeSynonym; - } + public void setCellTypeSynonym(String cellTypeSynonym) { + this.cellTypeSynonym = cellTypeSynonym; + } } diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java index 1d3a777..8313e73 100755 --- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java +++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java @@ -1,19 +1,21 @@ package org.kpmp.cellTypeSummary; -import org.springframework.lang.Nullable; +import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; -import java.io.Serializable; + +import org.springframework.lang.Nullable; @Entity @Table(name = "cluster_hierarchy_v") @IdClass(ClusterHierarchyId.class) public class ClusterHierarchy implements Serializable { + private static final long serialVersionUID = -7707637379989017634L; @Id @Column(name = "cell_type_id") private int cellTypeId; @@ -31,11 +33,11 @@ public class ClusterHierarchy implements Serializable { @Column(name = "is_single_nuc") private String isSingleNucCluster; @Column(name = "is_rt") - private String isRegionalTranscriptomics; + private String isRegionalTranscriptomics; @Column(name = "cell_type") private String cellType; @Column(name = "cell_type_order") - private Double cellTypeOrder; + private Double cellTypeOrder; public int getCellTypeId() { return cellTypeId; @@ -45,7 +47,7 @@ public void setCellTypeId(int cellTypeId) { this.cellTypeId = cellTypeId; } - @Nullable + @Nullable public int getClusterId() { return clusterId; } @@ -62,7 +64,7 @@ public void setStructureRegion(String structureRegion) { this.structureRegion = structureRegion; } - @Nullable + @Nullable public String getStructureSubregion() { return structureSubregion; } @@ -71,7 +73,7 @@ public void setStructureSubregion(String structureSubregion) { this.structureSubregion = structureSubregion; } - @Nullable + @Nullable public String getClusterName() { return clusterName; } @@ -96,29 +98,29 @@ public void setIsSingleNucCluster(String isSingleNucCluster) { this.isSingleNucCluster = isSingleNucCluster; } - public String getIsRegionalTranscriptomics() { - return isRegionalTranscriptomics; - } + public String getIsRegionalTranscriptomics() { + return isRegionalTranscriptomics; + } - public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) { - this.isRegionalTranscriptomics = isRegionalTranscriptomics; - } + public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) { + this.isRegionalTranscriptomics = isRegionalTranscriptomics; + } - @Nullable - public Double getCellTypeOrder() { - return cellTypeOrder; - } + @Nullable + public Double getCellTypeOrder() { + return cellTypeOrder; + } - public void setCellTypeOrder(Double cellTypeOrder) { - this.cellTypeOrder = cellTypeOrder; - } + public void setCellTypeOrder(Double cellTypeOrder) { + this.cellTypeOrder = cellTypeOrder; + } - @Nullable - public String getCellType() { - return cellType; - } + @Nullable + public String getCellType() { + return cellType; + } - public void setCellType(String cellType) { - this.cellType = cellType; - } + public void setCellType(String cellType) { + this.cellType = cellType; + } } diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java index ae4b84a..cdc0874 100755 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java @@ -7,7 +7,7 @@ import org.kpmp.FullDataTypeEnum; import org.kpmp.OmicsTypeEnum; import org.kpmp.TissueTypeEnum; -import org.kpmp.datasetSummary.DatasetSummary; +import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,10 +20,10 @@ public DataSummaryService(DataSummaryRepository dataSummaryRepository) { this.dataSummaryRepository = dataSummaryRepository; } - public List getSummaryData() { - List summaryData = new ArrayList<>(); + public List getSummaryData() { + List summaryData = new ArrayList<>(); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), @@ -32,7 +32,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()))); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName(), DataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D.getAbbreviation(), @@ -41,7 +41,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()))); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName(), DataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES.getAbbreviation(), @@ -50,7 +50,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()))); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.CODEX_FULL.getFullName(), DataTypeEnum.CODEX.getAbbreviation(), @@ -59,7 +59,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName()))); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_LIPIDOMICS.getAbbreviation(), @@ -68,7 +68,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()))); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation(), @@ -77,7 +77,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()))); - summaryData.add(new DatasetSummary( + summaryData.add(new TissueTypeSummaryByDataType( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation(), diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java index 624cb14..476517c 100755 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java @@ -1,15 +1,18 @@ package org.kpmp.dataSummary; -import org.springframework.lang.Nullable; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; + +import org.springframework.lang.Nullable; @Entity @Table(name = "sv_file_v") public class DataSummaryValue implements Serializable { + private static final long serialVersionUID = -1934662137113288596L; @Id @Column(name = "file_id") private Integer fileId; @@ -25,9 +28,9 @@ public class DataSummaryValue implements Serializable { private String fileName; @Column(name = "package_id") private String packageId; - @Column(name = "file_size") + @Column(name = "file_size") private Long fileSize; - @Column(name = "participant_id") + @Column(name = "participant_id") private Integer participantId; @Column(name = "redcap_id") private String redcapId; @@ -37,130 +40,130 @@ public class DataSummaryValue implements Serializable { private String protocol; @Column(name = "sample_type") private String sampleType; - @Column(name = "sex") + @Column(name = "sex") private String sex; - @Column(name = "tissue_source") + @Column(name = "tissue_source") private String tissueSource; - @Column(name = "tissue_type") + @Column(name = "tissue_type") private String tissueType; - @Column(name = "spectrack_sample_id") + @Column(name = "spectrack_sample_id") private String spectrackSampleId; @Nullable public Integer getFileId() { return fileId; } - + public void setFileId(Integer fileId) { this.fileId = fileId; } - + @Nullable public String getConfigType() { return configType; } - + public void setConfigType(String configType) { this.configType = configType; } - + @Nullable public String getImageType() { return imageType; } - + public void setImageType(String imageType) { this.imageType = imageType; } - + @Nullable public String getDataType() { return dataType; } - + public void setDataType(String dataType) { this.dataType = dataType; } - + public String getDlFileId() { return dlFileId; } - + public void setDlFileIdd(String dlFileId) { this.dlFileId = dlFileId; } - + public String getFileName() { return fileName; } - + public void setFileName(String fileName) { this.fileName = fileName; } - + @Nullable public String getPackageId() { return packageId; } - + public void setPackageId(String packageId) { this.packageId = packageId; } - + @Nullable public Long getFileSize() { return fileSize; } - + public void setFileSize(Long fileSize) { this.fileSize = fileSize; } - + @Nullable public Integer getParticipantId() { return participantId; } - + public void setParticipantId(Integer participantId) { this.participantId = participantId; } - + @Nullable public String getRedcapId() { return redcapId; } - + public void setRedcapId(String redcapId) { this.redcapId = redcapId; } - + @Nullable public String getAge() { return age; } - + public void setAge(String age) { this.age = age; } - + @Nullable public String getProtocol() { return protocol; } - + public void setProtocol(String protocol) { this.protocol = protocol; } - + @Nullable public String getSampleType() { return sampleType; } - + public void setSampleType(String sampleType) { this.sampleType = sampleType; } - + @Nullable public String getSex() { return sex; @@ -174,7 +177,7 @@ public void setSex(String sex) { public String getTissueSource() { return tissueSource; } - + public void setTissueSource(String tissueSource) { this.tissueSource = tissueSource; } @@ -187,7 +190,7 @@ public String getTissueType() { public void setTissueType(String tissueType) { this.tissueType = tissueType; } - + @Nullable public String getSpectrackSampleId() { return spectrackSampleId; diff --git a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java b/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java deleted file mode 100755 index 125485c..0000000 --- a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.kpmp.datasetSummary; - -import java.io.Serializable; - -public class DatasetSummary implements Serializable { - private String omicsType; - private String dataType; - private String dataTypeShort; - private Long akiCount; - private Long ckdCount; - private Long hrtCount; - private Long participantCount; - - public DatasetSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount, Long hrtCount, Long participantCount) { - this.omicsType = omicsType; - this.dataType = dataType; - this.dataTypeShort = dataTypeShort; - this.akiCount = akiCount; - this.ckdCount = ckdCount; - this.hrtCount = hrtCount; - this.participantCount = participantCount; - } - public String getOmicsType() { - return this.omicsType; - } - public void setOmicsType(String omicsType) { - this.omicsType = omicsType; - } - - public String getDataType() { - return this.dataType; - } - - public void setDataTypeType(String dataType) { - this.dataType = dataType; - } - - public String getDataTypeShort() { - return this.dataTypeShort; - } - public void setDataTypeShort(String dataTypeShort) { - this.dataTypeShort = dataTypeShort; - } - - public Long getAkiCount() { - return this.akiCount; - } - - public void setAkiCount(Long akiCount) { - this.akiCount = akiCount; - } - - public Long getCkdCount() { - return this.ckdCount; - } - - public void setCkdCount(Long ckdCount) { - this.ckdCount = ckdCount; - } - - public Long getHrtCount() { - return this.hrtCount; - } - - public void setHrtCount(Long hrtCount) { - this.hrtCount = hrtCount; - } - - public Long getParticipantCount() { - return this.participantCount; - } - - public void setParticipantCount(Long participantCount) { - this.participantCount = participantCount; - } -} \ No newline at end of file diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java index ea25152..82cf3bc 100755 --- a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java +++ b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java @@ -7,56 +7,57 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class MyGeneInfoHit implements Comparable, Serializable { - private String id; - private String symbol; - private String name; - private String entrezgene; - @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) - private List alias; - - public String getId() { - return id; - } - - @JsonProperty("_id") - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public String getEntrezgene() { - return entrezgene; - } - - public void setEntrezgene(String entrezgene) { - this.entrezgene = entrezgene; - } - - public List getAlias() { - return alias; - } - - public void setAlias(List alias) { - this.alias = alias; - } - - @Override - public int compareTo(MyGeneInfoHit hit) { - return this.getSymbol().compareTo(hit.getSymbol()); - } + private static final long serialVersionUID = 7498017467676968095L; + private String id; + private String symbol; + private String name; + private String entrezgene; + @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + private List alias; + + public String getId() { + return id; + } + + @JsonProperty("_id") + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public String getEntrezgene() { + return entrezgene; + } + + public void setEntrezgene(String entrezgene) { + this.entrezgene = entrezgene; + } + + public List getAlias() { + return alias; + } + + public void setAlias(List alias) { + this.alias = alias; + } + + @Override + public int compareTo(MyGeneInfoHit hit) { + return this.getSymbol().compareTo(hit.getSymbol()); + } } diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java index b0fa067..2214db2 100755 --- a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java +++ b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java @@ -4,22 +4,23 @@ import java.util.List; public class MyGeneInfoResult implements Serializable { - private int total; - private List hits; + private static final long serialVersionUID = 2296351561705106315L; + private int total; + private List hits; - public int getTotal() { - return total; - } + public int getTotal() { + return total; + } - public void setTotal(int total) { - this.total = total; - } + public void setTotal(int total) { + this.total = total; + } - public List getHits() { - return hits; - } + public List getHits() { + return hits; + } - public void setHits(List hits) { - this.hits = hits; - } + public void setHits(List hits) { + this.hits = hits; + } } diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java index 97235e8..30cb93b 100755 --- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java +++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java @@ -1,15 +1,17 @@ package org.kpmp.geneExpression; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "rt_segments") public class RTExpressionDataAllSegments implements RTExpressionData, Serializable { + private static final long serialVersionUID = 9029734049386312455L; @Id @Column(name = "id") private Integer id; @@ -122,10 +124,12 @@ public void setSampleCount(Integer sampleCount) { this.sampleCount = sampleCount; } + @Override public String getSegmentName() { return segmentName; } + @Override public void setSegmentName(String segmentName) { this.segmentName = segmentName; } diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java index 603ea54..0a33cf2 100755 --- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java +++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java @@ -1,15 +1,17 @@ package org.kpmp.geneExpression; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "rt_gti") public class RTExpressionDataGTI implements RTExpressionData, Serializable { + private static final long serialVersionUID = 4789000526795024990L; @Id @Column(name = "id") private Integer id; @@ -122,10 +124,12 @@ public void setSampleCount(Integer sampleCount) { this.sampleCount = sampleCount; } + @Override public String getSegmentName() { return segmentName; } + @Override public void setSegmentName(String segmentName) { this.segmentName = segmentName; } diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java index 020c8ef..7a738ff 100755 --- a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java +++ b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java @@ -1,5 +1,7 @@ package org.kpmp.geneExpression; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -8,12 +10,11 @@ import org.json.JSONException; import org.json.JSONObject; -import java.io.Serializable; - @Entity @Table(name = "sc_feature_data") class SCExpressionData implements Serializable { + private static final long serialVersionUID = 1079445825708102694L; @Id @Column(name = "gene_symbol") private String geneSymbol; diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java index 7929651..1e21871 100755 --- a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java +++ b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java @@ -1,5 +1,7 @@ package org.kpmp.geneExpression; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -8,12 +10,11 @@ import org.json.JSONException; import org.json.JSONObject; -import java.io.Serializable; - @Entity @Table(name = "sn_feature_data") class SNExpressionData implements Serializable { + private static final long serialVersionUID = -3363426907715685587L; @Id @Column(name = "gene_symbol") private String geneSymbol; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java index 0e32c16..2dea56d 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java @@ -8,8 +8,8 @@ import org.kpmp.FullDataTypeEnum; import org.kpmp.OmicsTypeEnum; import org.kpmp.TissueTypeEnum; -import org.kpmp.datasetSummary.DatasetSummary; import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository; +import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -110,23 +110,23 @@ public List findDataTypesByGene(String gene) { return dataTypes; } - public List getGeneDatasetInformation(String geneSymbol) { - List geneSummary = new ArrayList<>(); - geneSummary.add(new DatasetSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + public List getGeneDatasetInformation(String geneSymbol) { + List geneSummary = new ArrayList<>(); + geneSummary.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(), scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.AKI.getParticipantTissueType()), scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.CKD.getParticipantTissueType()), scrnaGeneExpressionRepository .getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()), scrnaParticipantRepository.getParticipantCount())); - geneSummary.add(new DatasetSummary(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), + geneSummary.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(), snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.AKI.getParticipantTissueType()), snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.CKD.getParticipantTissueType()), snrnaGeneExpressionRepository .getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()), snrnaParticipantRepository.getParticipantCount())); - geneSummary.add(new DatasetSummary(OmicsTypeEnum.NONE.getEnum(), + geneSummary.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS_FULL.getFullName(), DataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation(), rtParticipantRepository.getCountByTissueType(TissueTypeEnum.AKI.getParticipantTissueType()), diff --git a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java index 4a5639b..62df11f 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java @@ -1,17 +1,20 @@ package org.kpmp.geneExpressionSummary; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "rt_participant_tissue_v") @IdClass(ParticipantId.class) class RTParticipantValue implements Participant, Serializable { + private static final long serialVersionUID = 5368734102102552073L; + @Column(name = "tissue_type") private String tissueType; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java index 4aa8c40..8cc08ef 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java @@ -17,6 +17,7 @@ @IdClass(GeneExpressionId.class) public class SCRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable { + private static final long serialVersionUID = 7265280085624504185L; @Column(name = "id") private Integer id; @Column(name = "tissue_type") diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java index d52bda7..a758ab5 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java @@ -1,17 +1,20 @@ package org.kpmp.geneExpressionSummary; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "sn_participant_tissue_v") @IdClass(ParticipantId.class) public class SCRNAParticipantValue implements Serializable { + private static final long serialVersionUID = 8746341469788157316L; + @Column(name = "tissue_type") private String tissueType; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java index 6f12920..7093151 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java @@ -1,7 +1,6 @@ package org.kpmp.geneExpressionSummary; -import org.kpmp.DataTypeEnum; -import org.springframework.lang.Nullable; +import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; @@ -9,13 +8,17 @@ import javax.persistence.IdClass; import javax.persistence.Table; import javax.persistence.Transient; -import java.io.Serializable; + +import org.kpmp.DataTypeEnum; +import org.springframework.lang.Nullable; @Entity @Table(name = "sn_rnaseq") @IdClass(GeneExpressionId.class) public class SNRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable { + private static final long serialVersionUID = -443713903175981503L; + @Column(name = "id") private Integer id; @@ -96,20 +99,24 @@ public void setGene(String gene) { this.gene = gene; } + @Override @Nullable public Double getPVal() { return pVal; } + @Override public void setPVal(Double pVal) { this.pVal = pVal; } + @Override @Nullable public Double getPValAdj() { return pValAdj; } + @Override public void setPValAdj(Double pValAdj) { this.pValAdj = pValAdj; } @@ -203,6 +210,7 @@ public boolean equals(Object obj) { if (!(obj instanceof SNRNAGeneExpressionExpressionSummaryValue)) return false; SNRNAGeneExpressionExpressionSummaryValue snrnaGeneExpressionExpressionSummaryValue = (SNRNAGeneExpressionExpressionSummaryValue) obj; - return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene()) && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster())); + return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene()) + && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster())); } } diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java index 2b6eb04..6c9dadc 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java @@ -1,17 +1,20 @@ package org.kpmp.geneExpressionSummary; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "sn_participant_tissue_v") @IdClass(ParticipantId.class) public class SNRNAParticipantValue implements Participant, Serializable { + private static final long serialVersionUID = -2404700991479961255L; + @Column(name = "tissue_type") private String tissueType; diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java index 58e5897..c90a5a0 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java @@ -1,112 +1,114 @@ package org.kpmp.participant; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "participant") -public class ParticipantSummaryDataset implements Serializable { - @Id - @Column(name = "participant_id") - private int participantId; - @Column(name = "old_participant_id") - private String oldparticipantId; - @Column(name = "redcap_id") - private String redcapId; - @Column(name = "age_binned") - private String ageBinned; - private String sex; - @Column(name = "tissue_source") - private String tissueSource; - private String protocol; - @Column(name = "sample_type") - private String sampleType; - @Column(name = "tissue_type") - private String tissueType; - @Column(name = "clinical_data") - private String clinicalData; - - public int getParticipantId() { - return participantId; - } - - public void setParticipantId(int participantId) { - this.participantId = participantId; - } - - public String getOldParticipantId() { - return oldparticipantId; - } - - public void setOldParticipantId(String oldparticipantId) { - this.oldparticipantId = oldparticipantId; - } - - public String getRedcapId() { - return redcapId; - } - - public void setRedcapId(String redcapId) { - this.redcapId = redcapId; - } - - public String getAgeBinned() { - return ageBinned; - } - - public void setAgeBinned(String ageBinned) { - this.ageBinned = ageBinned; - } - - public String getSex() { - return sex; - } - - public void setSex(String sex) { - this.sex = sex; - } - - public String getTissueSource() { - return tissueSource; - } - - public void setTissueSource(String tissueSource) { - this.tissueSource = tissueSource; - } - - public String getProtocol() { - return protocol; - } - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public String getSampleType() { - return sampleType; - } - - public void setSampleType(String sampleType) { - this.sampleType = sampleType; - } - - public String getTissueType() { - return tissueType; - } - - public void setTissueType(String tissueType) { - this.tissueType = tissueType; - } - - public String getClinicalData() { - return clinicalData; - } - - public void setClinicalData(String clinicalData) { - this.clinicalData = clinicalData; - } +public class ParticipantSummaryDataset implements Serializable { + private static final long serialVersionUID = -6616360991151079273L; + @Id + @Column(name = "participant_id") + private int participantId; + @Column(name = "old_participant_id") + private String oldparticipantId; + @Column(name = "redcap_id") + private String redcapId; + @Column(name = "age_binned") + private String ageBinned; + private String sex; + @Column(name = "tissue_source") + private String tissueSource; + private String protocol; + @Column(name = "sample_type") + private String sampleType; + @Column(name = "tissue_type") + private String tissueType; + @Column(name = "clinical_data") + private String clinicalData; + + public int getParticipantId() { + return participantId; + } + + public void setParticipantId(int participantId) { + this.participantId = participantId; + } + + public String getOldParticipantId() { + return oldparticipantId; + } + + public void setOldParticipantId(String oldparticipantId) { + this.oldparticipantId = oldparticipantId; + } + + public String getRedcapId() { + return redcapId; + } + + public void setRedcapId(String redcapId) { + this.redcapId = redcapId; + } + + public String getAgeBinned() { + return ageBinned; + } + + public void setAgeBinned(String ageBinned) { + this.ageBinned = ageBinned; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getTissueSource() { + return tissueSource; + } + + public void setTissueSource(String tissueSource) { + this.tissueSource = tissueSource; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getSampleType() { + return sampleType; + } + + public void setSampleType(String sampleType) { + this.sampleType = sampleType; + } + + public String getTissueType() { + return tissueType; + } + + public void setTissueType(String tissueType) { + this.tissueType = tissueType; + } + + public String getClinicalData() { + return clinicalData; + } + + public void setClinicalData(String clinicalData) { + this.clinicalData = clinicalData; + } } diff --git a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java index 7ec6cc0..2c0b70f 100644 --- a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java +++ b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java @@ -1,7 +1,9 @@ package org.kpmp.participant; + import java.io.Serializable; -import java.lang.Long; -public class ParticipantTissueTypeSummary implements Serializable{ + +public class ParticipantTissueTypeSummary implements Serializable { + private static final long serialVersionUID = 4596059416539472482L; private Long akiCount; private Long ckdCount; private Long hrtCount; @@ -13,26 +15,26 @@ public ParticipantTissueTypeSummary(Long akiCount, Long ckdCount, Long hrtCount) } public Long getAkiCount() { - return this.akiCount; - } + return this.akiCount; + } - public void setAkiCount(Long akiCount) { - this.akiCount = akiCount; - } + public void setAkiCount(Long akiCount) { + this.akiCount = akiCount; + } - public Long getCkdCount() { - return this.ckdCount; - } + public Long getCkdCount() { + return this.ckdCount; + } - public void setCkdCount(Long ckdCount) { - this.ckdCount = ckdCount; - } + public void setCkdCount(Long ckdCount) { + this.ckdCount = ckdCount; + } - public Long getHrtCount() { - return this.hrtCount; - } + public Long getHrtCount() { + return this.hrtCount; + } - public void setHrtCount(Long hrtCount) { - this.hrtCount = hrtCount; - } + public void setHrtCount(Long hrtCount) { + this.hrtCount = hrtCount; + } } diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadata.java b/src/main/java/org/kpmp/participant/SingleCellMetadata.java index fea984b..6dc4c08 100755 --- a/src/main/java/org/kpmp/participant/SingleCellMetadata.java +++ b/src/main/java/org/kpmp/participant/SingleCellMetadata.java @@ -1,15 +1,17 @@ package org.kpmp.participant; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "sc_metadata") class SingleCellMetadata implements Serializable { + private static final long serialVersionUID = -7074542040879592316L; @Id private String barcode; @Column(name = "specimen_id") diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java index d92341f..417e59c 100755 --- a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java +++ b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java @@ -1,15 +1,17 @@ package org.kpmp.participant; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "sn_metadata") class SingleNucleusMetadata implements Serializable { + private static final long serialVersionUID = -504357775835334661L; @Id private String barcode; @Column(name = "specimen_id") diff --git a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java index 738231c..44f2985 100755 --- a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java +++ b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java @@ -1,15 +1,18 @@ package org.kpmp.participant; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import java.io.Serializable; @Entity @Table(name = "sv_data_type_v") class SpatialViewerDataType implements Serializable { + private static final long serialVersionUID = 3095549192644880754L; + @Id @Column(name = "data_type") private String dataType; diff --git a/src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java b/src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java new file mode 100755 index 0000000..fa5d4f5 --- /dev/null +++ b/src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java @@ -0,0 +1,81 @@ +package org.kpmp.repositorySummary; + +import java.io.Serializable; + +public class TissueTypeSummaryByDataType implements Serializable { + private static final long serialVersionUID = 114808450473696153L; + private String omicsType; + private String dataType; + private String dataTypeShort; + private Long akiCount; + private Long ckdCount; + private Long hrtCount; + private Long participantCount; + + public TissueTypeSummaryByDataType(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount, + Long hrtCount, Long participantCount) { + this.omicsType = omicsType; + this.dataType = dataType; + this.dataTypeShort = dataTypeShort; + this.akiCount = akiCount; + this.ckdCount = ckdCount; + this.hrtCount = hrtCount; + this.participantCount = participantCount; + } + + public String getOmicsType() { + return this.omicsType; + } + + public void setOmicsType(String omicsType) { + this.omicsType = omicsType; + } + + public String getDataType() { + return this.dataType; + } + + public void setDataTypeType(String dataType) { + this.dataType = dataType; + } + + public String getDataTypeShort() { + return this.dataTypeShort; + } + + public void setDataTypeShort(String dataTypeShort) { + this.dataTypeShort = dataTypeShort; + } + + public Long getAkiCount() { + return this.akiCount; + } + + public void setAkiCount(Long akiCount) { + this.akiCount = akiCount; + } + + public Long getCkdCount() { + return this.ckdCount; + } + + public void setCkdCount(Long ckdCount) { + this.ckdCount = ckdCount; + } + + public Long getHrtCount() { + return this.hrtCount; + } + + public void setHrtCount(Long hrtCount) { + this.hrtCount = hrtCount; + } + + public Long getParticipantCount() { + return this.participantCount; + } + + public void setParticipantCount(Long participantCount) { + this.participantCount = participantCount; + } +} \ No newline at end of file diff --git a/src/main/java/org/kpmp/umap/FeatureData.java b/src/main/java/org/kpmp/umap/FeatureData.java index afa311e..8ebb50f 100755 --- a/src/main/java/org/kpmp/umap/FeatureData.java +++ b/src/main/java/org/kpmp/umap/FeatureData.java @@ -6,13 +6,13 @@ public class FeatureData implements Serializable { + private static final long serialVersionUID = 6332061560137675936L; private List xValues = new ArrayList<>(); private List yValues = new ArrayList<>(); private List expression = new ArrayList<>(); - private List hoverDisplay = new ArrayList<>(); + private List hoverDisplay = new ArrayList<>(); - - public List getXValues() { + public List getXValues() { return xValues; } @@ -48,16 +48,16 @@ public void addExpression(Double expressionValue) { this.expression.add(expressionValue); } - public List getHoverDisplay() { - return hoverDisplay; - } + public List getHoverDisplay() { + return hoverDisplay; + } - public void setHoverDisplay(List hoverDisplay) { - this.hoverDisplay = hoverDisplay; - } + public void setHoverDisplay(List hoverDisplay) { + this.hoverDisplay = hoverDisplay; + } - public void addHoverDisplay(String hoverDisplay) { - this.hoverDisplay.add(hoverDisplay); - } + public void addHoverDisplay(String hoverDisplay) { + this.hoverDisplay.add(hoverDisplay); + } } diff --git a/src/main/java/org/kpmp/umap/PlotData.java b/src/main/java/org/kpmp/umap/PlotData.java index 47b3b3d..24f637f 100755 --- a/src/main/java/org/kpmp/umap/PlotData.java +++ b/src/main/java/org/kpmp/umap/PlotData.java @@ -5,6 +5,7 @@ public class PlotData implements Serializable { + private static final long serialVersionUID = 7957121452487372467L; private List referenceData; private List featureData; diff --git a/src/main/java/org/kpmp/umap/ReferenceCluster.java b/src/main/java/org/kpmp/umap/ReferenceCluster.java index c65eb87..d5a0080 100755 --- a/src/main/java/org/kpmp/umap/ReferenceCluster.java +++ b/src/main/java/org/kpmp/umap/ReferenceCluster.java @@ -6,6 +6,7 @@ public class ReferenceCluster implements Serializable { + private static final long serialVersionUID = -3963666320832242935L; private List xValues = new ArrayList<>(); private List yValues = new ArrayList<>(); private String color; @@ -57,11 +58,11 @@ public void setClusterName(String clusterName) { this.clusterName = clusterName; } - public String getClusterAbbreviation() { - return clusterAbbreviation; - } + public String getClusterAbbreviation() { + return clusterAbbreviation; + } - public void setClusterAbbreviation(String clusterAbbreviation) { - this.clusterAbbreviation = clusterAbbreviation; - } + public void setClusterAbbreviation(String clusterAbbreviation) { + this.clusterAbbreviation = clusterAbbreviation; + } } diff --git a/src/main/java/org/kpmp/umap/SCMetadata.java b/src/main/java/org/kpmp/umap/SCMetadata.java index 96aa658..dff6125 100755 --- a/src/main/java/org/kpmp/umap/SCMetadata.java +++ b/src/main/java/org/kpmp/umap/SCMetadata.java @@ -1,22 +1,24 @@ package org.kpmp.umap; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; -import java.io.Serializable; @Entity @Table(name = "sc_umap_point_v") public class SCMetadata implements UmapPoint, Serializable { + private static final long serialVersionUID = 7947867645080936879L; @Column(name = "umap_x") private double umapX; @Column(name = "umap_y") private double umapY; - @Column(name = "cluster_abbreviation") - private String clusterAbbreviation; + @Column(name = "cluster_abbreviation") + private String clusterAbbreviation; @Column(name = "cluster_name") private String clusterName; @Column(name = "cluster_color") @@ -59,15 +61,15 @@ public void setClusterName(String clusterName) { this.clusterName = clusterName; } - @Override - public String getClusterAbbreviation() { - return clusterAbbreviation; - } + @Override + public String getClusterAbbreviation() { + return clusterAbbreviation; + } - @Override - public void setClusterAbbreviation(String clusterAbbreviation) { - this.clusterAbbreviation = clusterAbbreviation; - } + @Override + public void setClusterAbbreviation(String clusterAbbreviation) { + this.clusterAbbreviation = clusterAbbreviation; + } @Override public String getClusterColor() { diff --git a/src/main/java/org/kpmp/umap/SNMetadata.java b/src/main/java/org/kpmp/umap/SNMetadata.java index 5365c50..7e2a5d4 100755 --- a/src/main/java/org/kpmp/umap/SNMetadata.java +++ b/src/main/java/org/kpmp/umap/SNMetadata.java @@ -1,22 +1,24 @@ package org.kpmp.umap; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; -import java.io.Serializable; @Entity @Table(name = "sn_umap_point_v") public class SNMetadata implements UmapPoint, Serializable { + private static final long serialVersionUID = -8871186152958713643L; @Column(name = "umap_x") private double umapX; @Column(name = "umap_y") private double umapY; @Column(name = "cluster_abbreviation") - private String clusterAbbreviation; + private String clusterAbbreviation; @Column(name = "cluster_name") private String clusterName; @Column(name = "cluster_color") @@ -59,17 +61,17 @@ public void setClusterName(String clusterName) { this.clusterName = clusterName; } - @Override - public String getClusterAbbreviation() { - return clusterAbbreviation; - } + @Override + public String getClusterAbbreviation() { + return clusterAbbreviation; + } - @Override - public void setClusterAbbreviation(String clusterAbbreviation) { - this.clusterAbbreviation = clusterAbbreviation; - } + @Override + public void setClusterAbbreviation(String clusterAbbreviation) { + this.clusterAbbreviation = clusterAbbreviation; + } - @Override + @Override public String getClusterColor() { return clusterColor; } diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java index 7f542f9..1dd102e 100755 --- a/src/test/java/org/kpmp/QueryTest.java +++ b/src/test/java/org/kpmp/QueryTest.java @@ -21,7 +21,6 @@ import org.kpmp.cellTypeSummary.ClusterHierarchy; import org.kpmp.cellTypeSummary.ClusterHierarchyService; import org.kpmp.dataSummary.DataSummaryService; -import org.kpmp.datasetSummary.DatasetSummary; import org.kpmp.gene.GeneService; import org.kpmp.gene.MyGeneInfoHit; import org.kpmp.geneExpression.RTExpressionByTissueType; @@ -32,6 +31,7 @@ import org.kpmp.geneExpressionSummary.SNRNAGeneExpressionExpressionSummaryValue; import org.kpmp.participant.ParticipantDataTypeSummary; import org.kpmp.participant.ParticipantTissueTypeSummary; +import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; import org.kpmp.umap.FeatureData; @@ -192,17 +192,17 @@ public void dataTypesForConceptWhenClusterNameAndBlankGene() throws Exception { @Test public void getGeneDatasetInformation() throws Exception { - List expectedResult = new ArrayList<>(); + List expectedResult = new ArrayList<>(); - expectedResult.add(new DatasetSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + expectedResult.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0))); - expectedResult.add(new DatasetSummary(OmicsTypeEnum.NONE.getEnum(), + expectedResult.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0))); when(geneExpressionService.getGeneDatasetInformation("AAA")).thenReturn(expectedResult); - List datasetSummary = query.getGeneDatasetInformation("AAA"); + List datasetSummary = query.getGeneDatasetInformation("AAA"); assertEquals(expectedResult, datasetSummary); } diff --git a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java index 834bed1..e4caa54 100755 --- a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java +++ b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java @@ -11,7 +11,7 @@ import org.kpmp.DataTypeEnum; import org.kpmp.FullDataTypeEnum; import org.kpmp.TissueTypeEnum; -import org.kpmp.datasetSummary.DatasetSummary; +import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -103,7 +103,7 @@ public void testGetGeneDatasetInformation() throws Exception { .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName())) .thenReturn(Long.valueOf(22)); - List result = dataSummaryService.getSummaryData(); + List result = dataSummaryService.getSummaryData(); assertEquals(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), result.get(0).getDataType()); assertEquals(DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), result.get(0).getDataTypeShort()); diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java index 83c25b8..99e6bc1 100755 --- a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java +++ b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java @@ -12,8 +12,8 @@ import org.junit.Before; import org.junit.Test; import org.kpmp.DataTypeEnum; -import org.kpmp.datasetSummary.DatasetSummary; import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository; +import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -204,10 +204,10 @@ public void testGetGeneDatasetInformation() throws Exception { when(snrnaGeneExpressionRepository.getCountByTissue("hrt")).thenReturn(Long.valueOf(0)); when(snrnaParticipantRepository.getParticipantCount()).thenReturn(Long.valueOf(0)); - List result = geneExpressionService.getGeneDatasetInformation("AAA"); - DatasetSummary resultDataSC = result.get(0); - DatasetSummary resultDataSN = result.get(1); - DatasetSummary resultDataRt = result.get(2); + List result = geneExpressionService.getGeneDatasetInformation("AAA"); + TissueTypeSummaryByDataType resultDataSC = result.get(0); + TissueTypeSummaryByDataType resultDataSN = result.get(1); + TissueTypeSummaryByDataType resultDataRt = result.get(2); assertEquals(Long.valueOf(0), resultDataSC.getAkiCount()); assertEquals(Long.valueOf(0), resultDataSC.getCkdCount()); diff --git a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java index 019b79d..dbea114 100755 --- a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java +++ b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java @@ -6,7 +6,7 @@ import org.junit.Before; import org.junit.Test; -public class SingleCellMetadataTest extends SingleCellMetadata { +public class SingleCellMetadataTest { private SingleCellMetadata scMetadata; diff --git a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java index 9e95d0d..2c62101 100755 --- a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java +++ b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java @@ -6,7 +6,7 @@ import org.junit.Before; import org.junit.Test; -public class SingleNucleusMetadataTest extends SingleNucleusMetadata { +public class SingleNucleusMetadataTest { private SingleNucleusMetadata snMetadata; diff --git a/src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java b/src/test/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataTypeTest.java similarity index 91% rename from src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java rename to src/test/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataTypeTest.java index 47cfcad..2b1b3f8 100755 --- a/src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java +++ b/src/test/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataTypeTest.java @@ -1,4 +1,4 @@ -package org.kpmp.datasetSummary; +package org.kpmp.repositorySummary; import static org.junit.Assert.assertEquals; @@ -9,14 +9,14 @@ import org.kpmp.FullDataTypeEnum; import org.kpmp.OmicsTypeEnum; -public class DatasetSummaryTest { +public class TissueTypeSummaryByDataTypeTest { - private DatasetSummary datasetSummary; + private TissueTypeSummaryByDataType datasetSummary; @Before public void setUp() { - datasetSummary = new DatasetSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + datasetSummary = new TissueTypeSummaryByDataType(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(), Long.valueOf(2), Long.valueOf(4), Long.valueOf(6), Long.valueOf(8)); } From cf7bb62b04fd272ddca3f55f50ba8d3faf9b981e Mon Sep 17 00:00:00 2001 From: rlreamy Date: Tue, 24 Jan 2023 11:42:29 -0500 Subject: [PATCH 26/30] KPMP-4001: A little more rearranging of classes so they are in correct packages --- src/main/java/org/kpmp/Query.java | 6 +++--- .../kpmp/dataSummary/DataSummaryService.java | 19 +++++++++---------- .../DataTypeSummary.java} | 6 +++--- .../GeneExpressionSummaryService.java | 12 ++++++------ src/test/java/org/kpmp/QueryTest.java | 10 +++++----- .../dataSummary/DataSummaryServiceTest.java | 3 +-- .../DataTypeSummaryTest.java} | 8 ++++---- .../GeneExpressionSummaryServiceTest.java | 10 +++++----- 8 files changed, 36 insertions(+), 38 deletions(-) rename src/main/java/org/kpmp/{repositorySummary/TissueTypeSummaryByDataType.java => dataSummary/DataTypeSummary.java} (87%) rename src/test/java/org/kpmp/{repositorySummary/TissueTypeSummaryByDataTypeTest.java => dataSummary/DataTypeSummaryTest.java} (91%) diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java index 317b5d2..d9cf541 100755 --- a/src/main/java/org/kpmp/Query.java +++ b/src/main/java/org/kpmp/Query.java @@ -11,6 +11,7 @@ import org.kpmp.cellTypeSummary.ClusterHierarchy; import org.kpmp.cellTypeSummary.ClusterHierarchyService; import org.kpmp.dataSummary.DataSummaryService; +import org.kpmp.dataSummary.DataTypeSummary; import org.kpmp.gene.GeneService; import org.kpmp.gene.MyGeneInfoHit; import org.kpmp.geneExpression.RTExpressionByTissueType; @@ -20,7 +21,6 @@ import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService; import org.kpmp.participant.ParticipantDataTypeSummary; import org.kpmp.participant.ParticipantTissueTypeSummary; -import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; import org.kpmp.umap.PlotData; @@ -100,7 +100,7 @@ public PlotData getUmapPlotData(String dataType, String geneSymbol, String tissu } } - public List getGeneDatasetInformation(String geneSymbol) throws Exception { + public List getGeneDatasetInformation(String geneSymbol) throws Exception { try { return geneExpressionSummaryService.getGeneDatasetInformation(geneSymbol); } catch (Exception e) { @@ -109,7 +109,7 @@ public List getGeneDatasetInformation(String geneSy } } - public List getSummaryData() throws Exception { + public List getSummaryData() throws Exception { try { return dataSummaryService.getSummaryData(); } catch (Exception e) { diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java index cdc0874..78fe8a0 100755 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java @@ -7,7 +7,6 @@ import org.kpmp.FullDataTypeEnum; import org.kpmp.OmicsTypeEnum; import org.kpmp.TissueTypeEnum; -import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,10 +19,10 @@ public DataSummaryService(DataSummaryRepository dataSummaryRepository) { this.dataSummaryRepository = dataSummaryRepository; } - public List getSummaryData() { - List summaryData = new ArrayList<>(); + public List getSummaryData() { + List summaryData = new ArrayList<>(); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), @@ -32,7 +31,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()))); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName(), DataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D.getAbbreviation(), @@ -41,7 +40,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()))); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName(), DataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES.getAbbreviation(), @@ -50,7 +49,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()))); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.CODEX_FULL.getFullName(), DataTypeEnum.CODEX.getAbbreviation(), @@ -59,7 +58,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName()))); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_LIPIDOMICS.getAbbreviation(), @@ -68,7 +67,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()))); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation(), @@ -77,7 +76,7 @@ public List getSummaryData() { dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()))); - summaryData.add(new TissueTypeSummaryByDataType( + summaryData.add(new DataTypeSummary( OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName(), DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation(), diff --git a/src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java b/src/main/java/org/kpmp/dataSummary/DataTypeSummary.java similarity index 87% rename from src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java rename to src/main/java/org/kpmp/dataSummary/DataTypeSummary.java index fa5d4f5..819a9ca 100755 --- a/src/main/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataType.java +++ b/src/main/java/org/kpmp/dataSummary/DataTypeSummary.java @@ -1,8 +1,8 @@ -package org.kpmp.repositorySummary; +package org.kpmp.dataSummary; import java.io.Serializable; -public class TissueTypeSummaryByDataType implements Serializable { +public class DataTypeSummary implements Serializable { private static final long serialVersionUID = 114808450473696153L; private String omicsType; private String dataType; @@ -12,7 +12,7 @@ public class TissueTypeSummaryByDataType implements Serializable { private Long hrtCount; private Long participantCount; - public TissueTypeSummaryByDataType(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount, + public DataTypeSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount, Long hrtCount, Long participantCount) { this.omicsType = omicsType; this.dataType = dataType; diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java index 2dea56d..91e0452 100755 --- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java +++ b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java @@ -8,8 +8,8 @@ import org.kpmp.FullDataTypeEnum; import org.kpmp.OmicsTypeEnum; import org.kpmp.TissueTypeEnum; +import org.kpmp.dataSummary.DataTypeSummary; import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository; -import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -110,23 +110,23 @@ public List findDataTypesByGene(String gene) { return dataTypes; } - public List getGeneDatasetInformation(String geneSymbol) { - List geneSummary = new ArrayList<>(); - geneSummary.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + public List getGeneDatasetInformation(String geneSymbol) { + List geneSummary = new ArrayList<>(); + geneSummary.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(), scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.AKI.getParticipantTissueType()), scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.CKD.getParticipantTissueType()), scrnaGeneExpressionRepository .getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()), scrnaParticipantRepository.getParticipantCount())); - geneSummary.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), + geneSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(), snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.AKI.getParticipantTissueType()), snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.CKD.getParticipantTissueType()), snrnaGeneExpressionRepository .getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()), snrnaParticipantRepository.getParticipantCount())); - geneSummary.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.NONE.getEnum(), + geneSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS_FULL.getFullName(), DataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation(), rtParticipantRepository.getCountByTissueType(TissueTypeEnum.AKI.getParticipantTissueType()), diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java index 1dd102e..7050009 100755 --- a/src/test/java/org/kpmp/QueryTest.java +++ b/src/test/java/org/kpmp/QueryTest.java @@ -21,6 +21,7 @@ import org.kpmp.cellTypeSummary.ClusterHierarchy; import org.kpmp.cellTypeSummary.ClusterHierarchyService; import org.kpmp.dataSummary.DataSummaryService; +import org.kpmp.dataSummary.DataTypeSummary; import org.kpmp.gene.GeneService; import org.kpmp.gene.MyGeneInfoHit; import org.kpmp.geneExpression.RTExpressionByTissueType; @@ -31,7 +32,6 @@ import org.kpmp.geneExpressionSummary.SNRNAGeneExpressionExpressionSummaryValue; import org.kpmp.participant.ParticipantDataTypeSummary; import org.kpmp.participant.ParticipantTissueTypeSummary; -import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; import org.kpmp.umap.FeatureData; @@ -192,17 +192,17 @@ public void dataTypesForConceptWhenClusterNameAndBlankGene() throws Exception { @Test public void getGeneDatasetInformation() throws Exception { - List expectedResult = new ArrayList<>(); + List expectedResult = new ArrayList<>(); - expectedResult.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + expectedResult.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0))); - expectedResult.add(new TissueTypeSummaryByDataType(OmicsTypeEnum.NONE.getEnum(), + expectedResult.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0))); when(geneExpressionService.getGeneDatasetInformation("AAA")).thenReturn(expectedResult); - List datasetSummary = query.getGeneDatasetInformation("AAA"); + List datasetSummary = query.getGeneDatasetInformation("AAA"); assertEquals(expectedResult, datasetSummary); } diff --git a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java index e4caa54..66be7df 100755 --- a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java +++ b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java @@ -11,7 +11,6 @@ import org.kpmp.DataTypeEnum; import org.kpmp.FullDataTypeEnum; import org.kpmp.TissueTypeEnum; -import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -103,7 +102,7 @@ public void testGetGeneDatasetInformation() throws Exception { .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName())) .thenReturn(Long.valueOf(22)); - List result = dataSummaryService.getSummaryData(); + List result = dataSummaryService.getSummaryData(); assertEquals(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), result.get(0).getDataType()); assertEquals(DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), result.get(0).getDataTypeShort()); diff --git a/src/test/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataTypeTest.java b/src/test/java/org/kpmp/dataSummary/DataTypeSummaryTest.java similarity index 91% rename from src/test/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataTypeTest.java rename to src/test/java/org/kpmp/dataSummary/DataTypeSummaryTest.java index 2b1b3f8..a85aecd 100755 --- a/src/test/java/org/kpmp/repositorySummary/TissueTypeSummaryByDataTypeTest.java +++ b/src/test/java/org/kpmp/dataSummary/DataTypeSummaryTest.java @@ -1,4 +1,4 @@ -package org.kpmp.repositorySummary; +package org.kpmp.dataSummary; import static org.junit.Assert.assertEquals; @@ -9,14 +9,14 @@ import org.kpmp.FullDataTypeEnum; import org.kpmp.OmicsTypeEnum; -public class TissueTypeSummaryByDataTypeTest { +public class DataTypeSummaryTest { - private TissueTypeSummaryByDataType datasetSummary; + private DataTypeSummary datasetSummary; @Before public void setUp() { - datasetSummary = new TissueTypeSummaryByDataType(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + datasetSummary = new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(), Long.valueOf(2), Long.valueOf(4), Long.valueOf(6), Long.valueOf(8)); } diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java index 99e6bc1..e7f5054 100755 --- a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java +++ b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java @@ -12,8 +12,8 @@ import org.junit.Before; import org.junit.Test; import org.kpmp.DataTypeEnum; +import org.kpmp.dataSummary.DataTypeSummary; import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository; -import org.kpmp.repositorySummary.TissueTypeSummaryByDataType; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -204,10 +204,10 @@ public void testGetGeneDatasetInformation() throws Exception { when(snrnaGeneExpressionRepository.getCountByTissue("hrt")).thenReturn(Long.valueOf(0)); when(snrnaParticipantRepository.getParticipantCount()).thenReturn(Long.valueOf(0)); - List result = geneExpressionService.getGeneDatasetInformation("AAA"); - TissueTypeSummaryByDataType resultDataSC = result.get(0); - TissueTypeSummaryByDataType resultDataSN = result.get(1); - TissueTypeSummaryByDataType resultDataRt = result.get(2); + List result = geneExpressionService.getGeneDatasetInformation("AAA"); + DataTypeSummary resultDataSC = result.get(0); + DataTypeSummary resultDataSN = result.get(1); + DataTypeSummary resultDataRt = result.get(2); assertEquals(Long.valueOf(0), resultDataSC.getAkiCount()); assertEquals(Long.valueOf(0), resultDataSC.getCkdCount()); From 6ac7e1afd392d6f24c982d7849b5006769febbaf Mon Sep 17 00:00:00 2001 From: rlreamy Date: Tue, 24 Jan 2023 14:50:03 -0500 Subject: [PATCH 27/30] KPMP-4001: First pass at getting code set up to get summary counts for repository --- .../AtlasRepoSummaryRepository.java | 14 ++++ .../dataSummary/ExperimentalStrategyId.java | 28 ++++++++ .../ExperimentalStrategyValue.java | 64 +++++++++++++++++++ .../ExperimentalStrategyIdTest.java | 35 ++++++++++ .../ExperimentalStrategyValueTest.java | 53 +++++++++++++++ 5 files changed, 194 insertions(+) create mode 100644 src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java create mode 100644 src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java create mode 100644 src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java create mode 100644 src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java create mode 100644 src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java new file mode 100644 index 0000000..efd0c79 --- /dev/null +++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java @@ -0,0 +1,14 @@ +package org.kpmp.dataSummary; + +import java.util.List; + +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.repository.CrudRepository; + +public interface AtlasRepoSummaryRepository extends CrudRepository { + + @Override + @Cacheable("repoSummaryCounts") + List findAll(); + +} diff --git a/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java new file mode 100644 index 0000000..ddbe8d1 --- /dev/null +++ b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java @@ -0,0 +1,28 @@ +package org.kpmp.dataSummary; + +import java.io.Serializable; + +public class ExperimentalStrategyId implements Serializable { + + private static final long serialVersionUID = 938153099192129678L; + + private String experimentalStrategy; + private String access; + + public String getExperimentalStrategy() { + return experimentalStrategy; + } + + public void setExperimentalStrategy(String experimentalStrategy) { + this.experimentalStrategy = experimentalStrategy; + } + + public String getAccess() { + return access; + } + + public void setAccess(String access) { + this.access = access; + } + +} diff --git a/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java new file mode 100644 index 0000000..99d0887 --- /dev/null +++ b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java @@ -0,0 +1,64 @@ +package org.kpmp.dataSummary; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +@Entity +@Table(name = "repository_summary_v") +@IdClass(ExperimentalStrategyId.class) +public class ExperimentalStrategyValue implements Serializable { + + private static final long serialVersionUID = 8063582327279878125L; + private int count; + @Id + private String experimentalStrategy; + @Id + private String access; + private String dataType; + private String dataCategory; + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public String getExperimentalStrategy() { + return experimentalStrategy; + } + + public void setExperimentalStrategy(String experimentalStrategy) { + this.experimentalStrategy = experimentalStrategy; + } + + public String getAccess() { + return access; + } + + public void setAccess(String access) { + this.access = access; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public String getDataCategory() { + return dataCategory; + } + + public void setDataCategory(String dataCategory) { + this.dataCategory = dataCategory; + } + +} diff --git a/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java new file mode 100644 index 0000000..d9d80ac --- /dev/null +++ b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java @@ -0,0 +1,35 @@ +package org.kpmp.dataSummary; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ExperimentalStrategyIdTest { + + private ExperimentalStrategyId id; + + @Before + public void setUp() throws Exception { + id = new ExperimentalStrategyId(); + } + + @After + public void tearDown() throws Exception { + id = null; + } + + @Test + public void testSetExperimentalStrategy() { + id.setExperimentalStrategy("strategy"); + assertEquals("strategy", id.getExperimentalStrategy()); + } + + @Test + public void testSetAccess() { + id.setAccess("open"); + assertEquals("open", id.getAccess()); + } + +} diff --git a/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java new file mode 100644 index 0000000..b2b3346 --- /dev/null +++ b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java @@ -0,0 +1,53 @@ +package org.kpmp.dataSummary; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ExperimentalStrategyValueTest { + + private ExperimentalStrategyValue value; + + @Before + public void setUp() throws Exception { + value = new ExperimentalStrategyValue(); + } + + @After + public void tearDown() throws Exception { + value = null; + } + + @Test + public void testSetCount() { + value.setCount(23); + assertEquals(23, value.getCount()); + } + + @Test + public void testSetExperimentalStrategy() { + value.setExperimentalStrategy("experimentalStrategy"); + assertEquals("experimentalStrategy", value.getExperimentalStrategy()); + } + + @Test + public void testSetAccess() { + value.setAccess("open"); + assertEquals("open", value.getAccess()); + } + + @Test + public void testSetDataType() { + value.setDataType("dataType"); + assertEquals("dataType", value.getDataType()); + } + + @Test + public void testSetDataCategory() { + value.setDataCategory("dataCategory"); + assertEquals("dataCategory", value.getDataCategory()); + } + +} From 87ea2614b316995e6da4d5d4be5a4c73c6f6d242 Mon Sep 17 00:00:00 2001 From: rlreamy Date: Thu, 16 Feb 2023 16:07:09 -0500 Subject: [PATCH 28/30] KPMP-4001: Finish setting up code to get repo summary counts for atlas repo --- src/main/java/org/kpmp/Query.java | 16 +- .../AtlasRepoSummaryLinkInformation.java | 29 +++ .../AtlasRepoSummaryRepository.java | 2 +- .../dataSummary/AtlasRepoSummaryResult.java | 37 +++ .../kpmp/dataSummary/AtlasRepoSummaryRow.java | 53 +++++ .../kpmp/dataSummary/DataSummaryService.java | 223 +++++++++++++----- .../resources/knowledge_environment.graphqls | 18 ++ .../AtlasRepoSummaryLinkInformationTest.java | 29 +++ .../AtlasRepoSummaryResultTest.java | 29 +++ .../dataSummary/AtlasRepoSummaryRowTest.java | 44 ++++ .../dataSummary/DataSummaryServiceTest.java | 4 +- 11 files changed, 416 insertions(+), 68 deletions(-) create mode 100644 src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java create mode 100644 src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java create mode 100644 src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java create mode 100644 src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java create mode 100644 src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java create mode 100644 src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java index d9cf541..be63d44 100755 --- a/src/main/java/org/kpmp/Query.java +++ b/src/main/java/org/kpmp/Query.java @@ -10,6 +10,7 @@ import org.kpmp.cellType.CellTypeService; import org.kpmp.cellTypeSummary.ClusterHierarchy; import org.kpmp.cellTypeSummary.ClusterHierarchyService; +import org.kpmp.dataSummary.AtlasRepoSummaryResult; import org.kpmp.dataSummary.DataSummaryService; import org.kpmp.dataSummary.DataTypeSummary; import org.kpmp.gene.GeneService; @@ -20,9 +21,9 @@ import org.kpmp.geneExpressionSummary.GeneExpressionSummary; import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService; import org.kpmp.participant.ParticipantDataTypeSummary; -import org.kpmp.participant.ParticipantTissueTypeSummary; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; +import org.kpmp.participant.ParticipantTissueTypeSummary; import org.kpmp.umap.PlotData; import org.kpmp.umap.UmapDataService; import org.slf4j.Logger; @@ -170,9 +171,18 @@ public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) th public List getTissueTypeSummaryData() throws Exception { try { return participantService.getTissueData(); - }catch (Exception e) { + } catch (Exception e) { logger.error(e.getMessage()); throw e; - } + } + } + + public AtlasRepoSummaryResult getAtlasSummaryRows() throws Exception { + try { + return dataSummaryService.getAtlasRepoSummary(); + } catch (Exception e) { + logger.error("Unable to get Atlas Summary data: ", e.getMessage()); + throw e; + } } } \ No newline at end of file diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java new file mode 100644 index 0000000..480b535 --- /dev/null +++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java @@ -0,0 +1,29 @@ +package org.kpmp.dataSummary; + +public class AtlasRepoSummaryLinkInformation { + + private String linkType; + private String linkValue; + + public AtlasRepoSummaryLinkInformation(String linkType, String linkValue) { + this.setLinkType(linkType); + this.setLinkValue(linkValue); + } + + public String getLinkType() { + return linkType; + } + + public void setLinkType(String linkType) { + this.linkType = linkType; + } + + public String getLinkValue() { + return linkValue; + } + + public void setLinkValue(String linkValue) { + this.linkValue = linkValue; + } + +} diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java index efd0c79..639679b 100644 --- a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java +++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java @@ -5,7 +5,7 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.data.repository.CrudRepository; -public interface AtlasRepoSummaryRepository extends CrudRepository { +interface AtlasRepoSummaryRepository extends CrudRepository { @Override @Cacheable("repoSummaryCounts") diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java new file mode 100644 index 0000000..387037d --- /dev/null +++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java @@ -0,0 +1,37 @@ +package org.kpmp.dataSummary; + +import java.util.ArrayList; +import java.util.List; + +public class AtlasRepoSummaryResult { + + private List summaryRows; + private int totalFiles; + + public AtlasRepoSummaryResult(List summaryRows, int totalFiles) { + this.summaryRows = summaryRows; + this.totalFiles = totalFiles; + + } + + public AtlasRepoSummaryResult() { + summaryRows = new ArrayList<>(); + } + + public List getSummaryRows() { + return summaryRows; + } + + public void setSummaryRows(List summaryRows) { + this.summaryRows = summaryRows; + } + + public int getTotalFiles() { + return totalFiles; + } + + public void setTotalFiles(int totalFiles) { + this.totalFiles = totalFiles; + } + +} diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java new file mode 100644 index 0000000..60e356a --- /dev/null +++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java @@ -0,0 +1,53 @@ +package org.kpmp.dataSummary; + +public class AtlasRepoSummaryRow { + private int openCount; + private int controlledCount; + private String omicsType; + private AtlasRepoSummaryLinkInformation linkInformation; + + public AtlasRepoSummaryRow(String omicsType, AtlasRepoSummaryLinkInformation linkInformation) { + this.omicsType = omicsType; + this.linkInformation = linkInformation; + } + + public int getOpenCount() { + return openCount; + } + + public void setOpenCount(int openCount) { + this.openCount = openCount; + } + + public int getControlledCount() { + return controlledCount; + } + + public void setControlledCount(int controlledCount) { + this.controlledCount = controlledCount; + } + + public String getOmicsType() { + return omicsType; + } + + public void setOmicsType(String omicsType) { + this.omicsType = omicsType; + } + + public void addToControlledCount(int count) { + this.controlledCount = this.controlledCount + count; + } + + public void addToOpenCount(int count) { + this.openCount = this.openCount + count; + } + + public AtlasRepoSummaryLinkInformation getLinkInformation() { + return linkInformation; + } + + public void setLinkInformation(AtlasRepoSummaryLinkInformation linkInformation) { + this.linkInformation = linkInformation; + } +} diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java index 78fe8a0..5d198ec 100755 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java @@ -1,7 +1,11 @@ package org.kpmp.dataSummary; import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.kpmp.DataTypeEnum; import org.kpmp.FullDataTypeEnum; @@ -12,78 +16,171 @@ @Service public class DataSummaryService { + private static final String EXPERIMENTAL_STRATEGY = "experimental_strategy"; + private static final String DATA_CATEGORY = "data_category"; + private static final String CONTROLLED_ACCESS = "controlled"; + private static final String OPEN_ACCESS = "open"; + private static final String BIOMARKERS = "Biomarkers"; + private static final String BIOMARKER = "Biomarker"; + private static final String CLINICAL_STUDY_DATA = "Clinical Study Data"; + private DataSummaryRepository dataSummaryRepository; + private AtlasRepoSummaryRepository repoSummaryRepository; @Autowired - public DataSummaryService(DataSummaryRepository dataSummaryRepository) { + public DataSummaryService(DataSummaryRepository dataSummaryRepository, + AtlasRepoSummaryRepository repoSummaryRepository) { this.dataSummaryRepository = dataSummaryRepository; + this.repoSummaryRepository = repoSummaryRepository; + } + + public AtlasRepoSummaryResult getAtlasRepoSummary() throws Exception { + List experimentalStrategies = repoSummaryRepository.findAll(); + Map summaryMap = new HashMap<>(); + int totalFiles = 0; + for (ExperimentalStrategyValue experimentalStrategyValue : experimentalStrategies) { + String experimentalStrategy = experimentalStrategyValue.getExperimentalStrategy(); + if (experimentalStrategy.isEmpty() + && experimentalStrategyValue.getDataType().equalsIgnoreCase(CLINICAL_STUDY_DATA)) { + experimentalStrategy = CLINICAL_STUDY_DATA; + } else if (experimentalStrategyValue.getDataCategory().equalsIgnoreCase(BIOMARKER)) { + experimentalStrategy = BIOMARKERS; + } + + if (summaryMap.containsKey(experimentalStrategy)) { + AtlasRepoSummaryRow atlasRepoSummaryRow = summaryMap.get(experimentalStrategy); + setCounts(experimentalStrategyValue, atlasRepoSummaryRow); + totalFiles += experimentalStrategyValue.getCount(); + } else { + AtlasRepoSummaryRow row = new AtlasRepoSummaryRow(experimentalStrategy, + getLinkInformation(experimentalStrategyValue)); + setCounts(experimentalStrategyValue, row); + summaryMap.put(experimentalStrategy, row); + totalFiles += experimentalStrategyValue.getCount(); + } + } + + Collection values = summaryMap.values(); + List results = new ArrayList<>(values); + results.sort(new Comparator() { + @Override + public int compare(AtlasRepoSummaryRow one, AtlasRepoSummaryRow two) { + return one.getOmicsType().compareToIgnoreCase(two.getOmicsType()); + } + }); + + return new AtlasRepoSummaryResult(results, totalFiles); + } + + private AtlasRepoSummaryLinkInformation getLinkInformation(ExperimentalStrategyValue experimentalStrategy) { + if (experimentalStrategy.getDataCategory().equalsIgnoreCase(BIOMARKER) + || experimentalStrategy.getDataType().equalsIgnoreCase(CLINICAL_STUDY_DATA)) { + return new AtlasRepoSummaryLinkInformation(DATA_CATEGORY, experimentalStrategy.getDataCategory()); + } else { + return new AtlasRepoSummaryLinkInformation(EXPERIMENTAL_STRATEGY, + experimentalStrategy.getExperimentalStrategy()); + } + } + + private void setCounts(ExperimentalStrategyValue experimentalStrategyValue, AtlasRepoSummaryRow atlasRepoSummaryRow) + throws Exception { + if (experimentalStrategyValue.getAccess().equalsIgnoreCase(OPEN_ACCESS)) { + atlasRepoSummaryRow.addToOpenCount(experimentalStrategyValue.getCount()); + } else if (experimentalStrategyValue.getAccess().equalsIgnoreCase(CONTROLLED_ACCESS)) { + atlasRepoSummaryRow.addToControlledCount(experimentalStrategyValue.getCount()); + } else { + throw new Exception( + "Unexpected access value while getting summary counts: " + experimentalStrategyValue.getAccess()); + } } public List getSummaryData() { List summaryData = new ArrayList<>(); - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), - DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()))); - - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName(), - DataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D.getAbbreviation(), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()))); - - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName(), - DataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES.getAbbreviation(), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()))); - - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.CODEX_FULL.getFullName(), - DataTypeEnum.CODEX.getAbbreviation(), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()), - dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName()))); - - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName(), - DataTypeEnum.SPATIAL_LIPIDOMICS.getAbbreviation(), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()))); - - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName(), - DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation(), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()))); - - summaryData.add(new DataTypeSummary( - OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), - FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName(), - DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation(), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), - dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), - dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()))); + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), + DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()), + dataSummaryRepository + .getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName(), + DataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D.getAbbreviation(), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()), + dataSummaryRepository.getParticipantSummaryCount( + FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName(), + DataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES.getAbbreviation(), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()), + dataSummaryRepository.getParticipantSummaryCount( + FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.CODEX_FULL.getFullName(), DataTypeEnum.CODEX.getAbbreviation(), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.CODEX_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.CODEX_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.CODEX_FULL.getFullName()), + dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName(), + DataTypeEnum.SPATIAL_LIPIDOMICS.getAbbreviation(), + dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryLinkCount( + TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()), + dataSummaryRepository + .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName(), + DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation(), + dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryLinkCount( + TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()), + dataSummaryRepository + .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName(), + DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation(), + dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), + dataSummaryRepository.getDataSummaryLinkCount( + TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), + dataSummaryRepository + .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()))); return summaryData; } } diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls index 6d12b12..6d94de6 100755 --- a/src/main/resources/knowledge_environment.graphqls +++ b/src/main/resources/knowledge_environment.graphqls @@ -14,6 +14,24 @@ type Query { participantSummaryDataset(redcapId: String): ParticipantSummaryDataset participantClinicalDataset(redcapId: String): ParticipantSummaryDataset getTissueTypeSummaryData: [ParticipantTissueTypeSummary] + getAtlasSummaryRows: AtlasRepoSummaryResult +} + +type AtlasRepoSummaryResult { + totalFiles: Int + summaryRows: [AtlasRepoSummaryRow] +} + +type AtlasRepoSummaryRow { + openCount: Int + controlledCount: Int + omicsType: String + linkInformation: AtlasRepoSummaryLinkInformation +} + +type AtlasRepoSummaryLinkInformation { + linkType: String + linkValue: String } type ParticipantTissueTypeSummary { diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java new file mode 100644 index 0000000..16ba4ef --- /dev/null +++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java @@ -0,0 +1,29 @@ +package org.kpmp.dataSummary; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class AtlasRepoSummaryLinkInformationTest { + + @BeforeEach + void setUp() throws Exception { + } + + @AfterEach + void tearDown() throws Exception { + } + + @Test + void testSetLinkType() { + fail("Not yet implemented"); + } + + @Test + void testSetLinkValue() { + fail("Not yet implemented"); + } + +} diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java new file mode 100644 index 0000000..0704cae --- /dev/null +++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java @@ -0,0 +1,29 @@ +package org.kpmp.dataSummary; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class AtlasRepoSummaryResultTest { + + @BeforeEach + void setUp() throws Exception { + } + + @AfterEach + void tearDown() throws Exception { + } + + @Test + void testSetSummaryRows() { + fail("Not yet implemented"); + } + + @Test + void testSetTotalFiles() { + fail("Not yet implemented"); + } + +} diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java new file mode 100644 index 0000000..d95a39c --- /dev/null +++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java @@ -0,0 +1,44 @@ +package org.kpmp.dataSummary; + +import static org.junit.Assert.*; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class AtlasRepoSummaryRowTest { + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testSetOpenCount() { + fail("Not yet implemented"); + } + + @Test + public void testSetControlledCount() { + fail("Not yet implemented"); + } + + @Test + public void testSetOmicsType() { + fail("Not yet implemented"); + } + + @Test + public void testAddToControlledCount() { + fail("Not yet implemented"); + } + + @Test + public void testAddToOpenCount() { + fail("Not yet implemented"); + } + +} diff --git a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java index 66be7df..ab65049 100755 --- a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java +++ b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java @@ -18,11 +18,13 @@ public class DataSummaryServiceTest { private DataSummaryService dataSummaryService; @Mock private DataSummaryRepository dataSummaryRepository; + @Mock + private AtlasRepoSummaryRepository atlasRepoSummaryRepository; @Before public void setUp() throws Exception { MockitoAnnotations.openMocks(this); - dataSummaryService = new DataSummaryService(dataSummaryRepository); + dataSummaryService = new DataSummaryService(dataSummaryRepository, atlasRepoSummaryRepository); } @After From 4f65f83d31674eea6730122c6001328049fb3b40 Mon Sep 17 00:00:00 2001 From: rlreamy Date: Fri, 17 Feb 2023 13:49:29 -0500 Subject: [PATCH 29/30] KPMP-4001: Added remaining tests --- .classpath | 621 +++++++++++++++++- .project | 20 +- .../AtlasRepoSummaryLinkInformation.java | 20 + src/test/java/org/kpmp/QueryTest.java | 28 +- .../AtlasRepoSummaryLinkInformationTest.java | 60 +- .../AtlasRepoSummaryResultTest.java | 49 +- .../dataSummary/AtlasRepoSummaryRowTest.java | 53 +- .../dataSummary/DataSummaryServiceTest.java | 61 ++ 8 files changed, 862 insertions(+), 50 deletions(-) diff --git a/.classpath b/.classpath index f00842b..639c8b2 100755 --- a/.classpath +++ b/.classpath @@ -1,25 +1,638 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project index 974292e..b0a8cd9 100755 --- a/.project +++ b/.project @@ -2,29 +2,27 @@ pegasus-data - - + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + org.eclipse.jdt.core.javabuilder - - + org.eclipse.buildship.core.gradleprojectbuilder - - + - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - + 1 - 30 + org.eclipse.core.resources.regexFilterMatcher node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java index 480b535..0c94d87 100644 --- a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java +++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java @@ -1,5 +1,8 @@ package org.kpmp.dataSummary; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + public class AtlasRepoSummaryLinkInformation { private String linkType; @@ -26,4 +29,21 @@ public void setLinkValue(String linkValue) { this.linkValue = linkValue; } + @Override + public int hashCode() { + return new HashCodeBuilder().append(linkType).append(linkValue).toHashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof AtlasRepoSummaryLinkInformation) { + final AtlasRepoSummaryLinkInformation other = (AtlasRepoSummaryLinkInformation) obj; + return new EqualsBuilder().append(linkType, other.getLinkType()).append(linkValue, other.getLinkValue()) + .isEquals(); + } else { + return false; + } + + } + } diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java index 7050009..6be38b3 100755 --- a/src/test/java/org/kpmp/QueryTest.java +++ b/src/test/java/org/kpmp/QueryTest.java @@ -1,6 +1,7 @@ package org.kpmp; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -20,6 +21,7 @@ import org.kpmp.cellType.CellTypeService; import org.kpmp.cellTypeSummary.ClusterHierarchy; import org.kpmp.cellTypeSummary.ClusterHierarchyService; +import org.kpmp.dataSummary.AtlasRepoSummaryResult; import org.kpmp.dataSummary.DataSummaryService; import org.kpmp.dataSummary.DataTypeSummary; import org.kpmp.gene.GeneService; @@ -31,9 +33,9 @@ import org.kpmp.geneExpressionSummary.SCRNAGeneExpressionExpressionSummaryValue; import org.kpmp.geneExpressionSummary.SNRNAGeneExpressionExpressionSummaryValue; import org.kpmp.participant.ParticipantDataTypeSummary; -import org.kpmp.participant.ParticipantTissueTypeSummary; import org.kpmp.participant.ParticipantService; import org.kpmp.participant.ParticipantSummaryDataset; +import org.kpmp.participant.ParticipantTissueTypeSummary; import org.kpmp.umap.FeatureData; import org.kpmp.umap.PlotData; import org.kpmp.umap.ReferenceCluster; @@ -78,6 +80,26 @@ public void tearDown() throws Exception { query = null; } + @Test + public void testGetAtlasSummaryRows() throws Exception { + AtlasRepoSummaryResult expectedResult = mock(AtlasRepoSummaryResult.class); + when(dataSummaryService.getAtlasRepoSummary()).thenReturn(expectedResult); + + assertEquals(expectedResult, query.getAtlasSummaryRows()); + } + + @Test + public void testGetAtlasSummaryRows_throwsException() throws Exception { + when(dataSummaryService.getAtlasRepoSummary()).thenThrow(new Exception("ack")); + + try { + query.getAtlasSummaryRows(); + fail("Should have thrown exception"); + } catch (Exception e) { + assertEquals("ack", e.getMessage()); + } + } + @Test public void testGenes() throws Exception { List expectedResult = Arrays.asList(new MyGeneInfoHit()); @@ -251,12 +273,12 @@ public void testParticipantClinicalDataset() throws Exception { assertEquals(expected, query.participantClinicalDataset("participant_id")); } - + public void getParticipantTissueTypeSummary() throws Exception { List expectedResult = new ArrayList<>(); expectedResult.add(new ParticipantTissueTypeSummary(Long.valueOf(4), Long.valueOf(5), Long.valueOf(6))); - + List tissueSummary = query.getTissueTypeSummaryData(); assertEquals(expectedResult, tissueSummary); diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java index 16ba4ef..5d12f92 100644 --- a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java +++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java @@ -1,29 +1,63 @@ package org.kpmp.dataSummary; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; -class AtlasRepoSummaryLinkInformationTest { +public class AtlasRepoSummaryLinkInformationTest { - @BeforeEach - void setUp() throws Exception { + @Before + public void setUp() throws Exception { + + } + + @After + public void tearDown() throws Exception { } - @AfterEach - void tearDown() throws Exception { + @Test + public void testConstructor() { + AtlasRepoSummaryLinkInformation linkInfo = new AtlasRepoSummaryLinkInformation("type", "value"); + + assertEquals("type", linkInfo.getLinkType()); + assertEquals("value", linkInfo.getLinkValue()); } @Test - void testSetLinkType() { - fail("Not yet implemented"); + public void testSetLinkType() { + AtlasRepoSummaryLinkInformation linkInfo = new AtlasRepoSummaryLinkInformation("type", "value"); + linkInfo.setLinkType("anotherType"); + + assertEquals("anotherType", linkInfo.getLinkType()); } @Test - void testSetLinkValue() { - fail("Not yet implemented"); + public void testSetLinkValue() { + AtlasRepoSummaryLinkInformation linkInfo = new AtlasRepoSummaryLinkInformation("type", "value"); + linkInfo.setLinkValue("another value"); + + assertEquals("another value", linkInfo.getLinkValue()); } + @Test + public void testEqualsAndHashCode() throws Exception { + AtlasRepoSummaryLinkInformation base = new AtlasRepoSummaryLinkInformation("linkType", "linkValue"); + AtlasRepoSummaryLinkInformation same = new AtlasRepoSummaryLinkInformation("linkType", "linkValue"); + AtlasRepoSummaryLinkInformation differentLinkType = new AtlasRepoSummaryLinkInformation("another type", + "linkValue"); + AtlasRepoSummaryLinkInformation differentLinkValue = new AtlasRepoSummaryLinkInformation("linkType", + "another value"); + String anotherObject = "hey there"; + + assertEquals(base.hashCode(), base.hashCode()); + assertEquals(base.hashCode(), same.hashCode()); + assertEquals(true, base.equals(same)); + assertEquals(true, base.equals(base)); + assertEquals(false, base.equals(differentLinkType)); + assertEquals(false, base.equals(differentLinkValue)); + assertEquals(false, base.equals(anotherObject)); + + } } diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java index 0704cae..23f5617 100644 --- a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java +++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java @@ -1,29 +1,52 @@ package org.kpmp.dataSummary; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.Assert.assertEquals; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import java.util.List; -class AtlasRepoSummaryResultTest { +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; - @BeforeEach - void setUp() throws Exception { +public class AtlasRepoSummaryResultTest { + + private AtlasRepoSummaryResult result; + @Mock + private List summaryRows; + + @Before + public void setUp() throws Exception { + result = new AtlasRepoSummaryResult(); } - @AfterEach - void tearDown() throws Exception { + @After + public void tearDown() throws Exception { + result = null; } @Test - void testSetSummaryRows() { - fail("Not yet implemented"); + public void testConstructor() throws Exception { + int totalFiles = 5; + AtlasRepoSummaryResult constructorTest = new AtlasRepoSummaryResult(summaryRows, totalFiles); + + assertEquals(summaryRows, constructorTest.getSummaryRows()); + assertEquals(5, constructorTest.getTotalFiles()); + } @Test - void testSetTotalFiles() { - fail("Not yet implemented"); + public void testSetSummaryRows() { + result.setSummaryRows(summaryRows); + + assertEquals(summaryRows, result.getSummaryRows()); + } + + @Test + public void testSetTotalFiles() { + result.setTotalFiles(58); + + assertEquals(58, result.getTotalFiles()); } } diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java index d95a39c..1d12217 100644 --- a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java +++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java @@ -1,44 +1,85 @@ package org.kpmp.dataSummary; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; public class AtlasRepoSummaryRowTest { + @Mock + AtlasRepoSummaryLinkInformation linkInformation; + private AtlasRepoSummaryRow row; + @Before public void setUp() throws Exception { + MockitoAnnotations.openMocks(this); + row = new AtlasRepoSummaryRow("omicsType", linkInformation); } @After public void tearDown() throws Exception { + MockitoAnnotations.openMocks(this).close(); + row = null; + } + + @Test + public void testConstructor() throws Exception { + AtlasRepoSummaryLinkInformation expectedLinkInformation = mock(AtlasRepoSummaryLinkInformation.class); + AtlasRepoSummaryRow rowToTest = new AtlasRepoSummaryRow("stuff", expectedLinkInformation); + + assertEquals("stuff", rowToTest.getOmicsType()); + assertEquals(expectedLinkInformation, rowToTest.getLinkInformation()); + assertEquals(0, rowToTest.getOpenCount()); + assertEquals(0, rowToTest.getControlledCount()); } @Test public void testSetOpenCount() { - fail("Not yet implemented"); + row.setOpenCount(43); + + assertEquals(43, row.getOpenCount()); } @Test public void testSetControlledCount() { - fail("Not yet implemented"); + row.setControlledCount(44); + + assertEquals(44, row.getControlledCount()); } @Test public void testSetOmicsType() { - fail("Not yet implemented"); + row.setOmicsType("omicsType 2"); + assertEquals("omicsType 2", row.getOmicsType()); } @Test public void testAddToControlledCount() { - fail("Not yet implemented"); + row.setControlledCount(2); + row.addToControlledCount(30); + + assertEquals(32, row.getControlledCount()); } @Test public void testAddToOpenCount() { - fail("Not yet implemented"); + row.setOpenCount(5); + row.addToOpenCount(5); + + assertEquals(10, row.getOpenCount()); } + @Test + public void testSetLinkInformation() { + AtlasRepoSummaryLinkInformation expectedLinkInformation = mock(AtlasRepoSummaryLinkInformation.class); + row.setLinkInformation(expectedLinkInformation); + + assertEquals(expectedLinkInformation, row.getLinkInformation()); + + } } diff --git a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java index ab65049..65bb950 100755 --- a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java +++ b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java @@ -3,6 +3,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; +import java.util.Arrays; import java.util.List; import org.junit.After; @@ -33,6 +34,66 @@ public void tearDown() throws Exception { dataSummaryService = null; } + @Test + public void testGetAtlasRepoSummary() throws Exception { + ExperimentalStrategyValue clinicalData = new ExperimentalStrategyValue(); + clinicalData.setDataCategory("stuff"); + clinicalData.setExperimentalStrategy(""); + clinicalData.setDataType("Clinical Study Data"); + clinicalData.setCount(1); + clinicalData.setAccess("open"); + ExperimentalStrategyValue biomarker1 = new ExperimentalStrategyValue(); + biomarker1.setDataCategory("Biomarker"); + biomarker1.setExperimentalStrategy("something"); + biomarker1.setDataType("stuff"); + biomarker1.setDataCategory("Biomarker"); + biomarker1.setCount(5); + biomarker1.setAccess("open"); + ExperimentalStrategyValue biomarker2 = new ExperimentalStrategyValue(); + biomarker2.setDataCategory("Biomarker"); + biomarker2.setDataType("more stuff"); + biomarker2.setExperimentalStrategy("something else"); + biomarker2.setDataCategory("Biomarker"); + biomarker2.setCount(10); + biomarker2.setAccess("open"); + ExperimentalStrategyValue other1 = new ExperimentalStrategyValue(); + other1.setDataCategory("data category"); + other1.setDataType("different stuff"); + other1.setExperimentalStrategy("strategy1"); + other1.setCount(10); + other1.setAccess("open"); + ExperimentalStrategyValue other2 = new ExperimentalStrategyValue(); + other2.setDataCategory("data category2"); + other2.setDataType("even more different stuff"); + other2.setExperimentalStrategy("strategy1"); + other2.setCount(10); + other2.setAccess("controlled"); + List strategyValues = Arrays.asList(clinicalData, biomarker1, biomarker2, other1, + other2); + when(atlasRepoSummaryRepository.findAll()).thenReturn(strategyValues); + + AtlasRepoSummaryResult result = dataSummaryService.getAtlasRepoSummary(); + List summaryRows = result.getSummaryRows(); + assertEquals(3, summaryRows.size()); + assertEquals("Biomarkers", summaryRows.get(0).getOmicsType()); + assertEquals(0, summaryRows.get(0).getControlledCount()); + assertEquals(15, summaryRows.get(0).getOpenCount()); + assertEquals(new AtlasRepoSummaryLinkInformation("data_category", "Biomarker"), + summaryRows.get(0).getLinkInformation()); + assertEquals("Clinical Study Data", summaryRows.get(1).getOmicsType()); + assertEquals(0, summaryRows.get(1).getControlledCount()); + assertEquals(1, summaryRows.get(1).getOpenCount()); + assertEquals(new AtlasRepoSummaryLinkInformation("data_category", "stuff"), + summaryRows.get(1).getLinkInformation()); + assertEquals("strategy1", summaryRows.get(2).getOmicsType()); + assertEquals(10, summaryRows.get(2).getControlledCount()); + assertEquals(10, summaryRows.get(2).getOpenCount()); + assertEquals(new AtlasRepoSummaryLinkInformation("experimental_strategy", "strategy1"), + summaryRows.get(2).getLinkInformation()); + assertEquals(36, result.getTotalFiles()); + + } + @Test public void testGetGeneDatasetInformation() throws Exception { when(dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), From 95c187218def3ef58fd93dd7011e47adbfdbbc09 Mon Sep 17 00:00:00 2001 From: rlreamy Date: Fri, 17 Feb 2023 13:51:43 -0500 Subject: [PATCH 30/30] KPMP-4001: adding more details to README " --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 6931273..821d0e8 100755 --- a/README.md +++ b/README.md @@ -34,3 +34,11 @@ Repository for the Atlas Explorer Tool service layer 2. Update .env ENV_MYSQL_PASSWORD to the password for QA KE 3. Add your IP address to a new security group called sg-0597e054f11d2e31a (Developer to KE Mariadb) 4. Restart your knowledge-environment (don't worry that you have your own copy of mariadb, it'll be ignored) + +If you have already followed these steps and are still having trouble connecting, check to see if your ip address has changed, you may need to update the security group rules + +# Talking to GraphQL + +1. Start up your atlas/knowledge-environment server +2. Open a tool like GraphQLPlayground and connect to "http://localhost:3030/graphql" +3. Write and execute your query