diff --git a/.classpath b/.classpath
index 9527d1e0..7b824e4a 100755
--- a/.classpath
+++ b/.classpath
@@ -1,690 +1,25 @@
-
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/.github/workflows/build-gradle-project.yml b/.github/workflows/build-gradle-project.yml
index 73c43fec..5e76c456 100644
--- a/.github/workflows/build-gradle-project.yml
+++ b/.github/workflows/build-gradle-project.yml
@@ -6,7 +6,7 @@ on:
jobs:
build-gradle-project:
env:
- IMAGE_TAG: 3.1.0
+ IMAGE_TAG: 3.3.0
runs-on: ubuntu-latest
steps:
- name: Get branch names
diff --git a/.java-version b/.java-version
index b4de3947..f222bf6f 100644
--- a/.java-version
+++ b/.java-version
@@ -1 +1 @@
-11
+21.0.4
diff --git a/Dockerfile b/Dockerfile
index e6095937..35a3c349 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM --platform=linux/amd64 alpine:3.19.1
+FROM --platform=linux/amd64 alpine:3.21.6
RUN apk update
RUN apk add openjdk21
diff --git a/build.gradle b/build.gradle
index 77326569..d857d686 100755
--- a/build.gradle
+++ b/build.gradle
@@ -13,7 +13,7 @@ plugins {
}
group = 'kingstonduo'
-version = '3.1.0'
+version = '3.3.0'
apply plugin: 'java'
apply plugin: 'eclipse'
@@ -45,6 +45,7 @@ dependencies {
implementation 'org.springframework.graphql:spring-graphql'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'com.hazelcast:hazelcast-all:4.2.5'
+ implementation 'com.graphql-java:graphql-java-extended-scalars:21.0'
testImplementation('org.mockito:mockito-junit-jupiter:3.12.4')
testImplementation 'org.springframework.boot:spring-boot-starter-test'
diff --git a/changelog.md b/changelog.md
index 39269a71..bafa3230 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,7 +1,13 @@
# Changelog
-## Release 3.2 (unreleased)
+## Release 3.3 (unreleased)
+
+---
+
+## Release 3.2
Brief summary:
+- return HUBMAP cell type ontology ID
+- fixed duplicate data being returned for Regional Transcriptomics data
### Breaking changes
diff --git a/src/main/java/org/kpmp/Application.java b/src/main/java/org/kpmp/Application.java
index d6afb2a3..4d92991b 100755
--- a/src/main/java/org/kpmp/Application.java
+++ b/src/main/java/org/kpmp/Application.java
@@ -9,6 +9,9 @@
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import graphql.scalars.ExtendedScalars;
+import org.springframework.graphql.execution.RuntimeWiringConfigurer;
+
@Configuration
@EnableCaching
@SpringBootApplication
@@ -28,4 +31,9 @@ public void addCorsMappings(CorsRegistry registry) {
}
};
}
+
+ @Bean
+ public RuntimeWiringConfigurer runtimeWiringConfigurer() {
+ return wiringBuilder -> wiringBuilder.scalar(ExtendedScalars.Json);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/QueryController.java b/src/main/java/org/kpmp/QueryController.java
index 50cc7fb4..335b1931 100755
--- a/src/main/java/org/kpmp/QueryController.java
+++ b/src/main/java/org/kpmp/QueryController.java
@@ -3,6 +3,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.kpmp.atlasMessage.AtlasMessage;
import org.kpmp.atlasMessage.AtlasMessageService;
@@ -10,6 +11,8 @@
import org.kpmp.autocomplete.AutocompleteService;
import org.kpmp.cellType.CellTypeHierarchy;
import org.kpmp.cellType.CellTypeService;
+import org.kpmp.cellType.HubmapCellTypeMappingService;
+import org.kpmp.cellType.HubmapOntologyCellType;
import org.kpmp.cellTypeSummary.ClusterHierarchy;
import org.kpmp.cellTypeSummary.ClusterHierarchyService;
import org.kpmp.dataSummary.AtlasRepoSummaryResult;
@@ -17,19 +20,9 @@
import org.kpmp.dataSummary.DataTypeSummary;
import org.kpmp.geneExpression.*;
import org.kpmp.geneExpressionSummary.GeneExpressionSummary;
-import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService;
import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService2025;
-import org.kpmp.participant.ParticipantClinicalDataset;
-import org.kpmp.participant.ParticipantDataTypeSummary;
-import org.kpmp.participant.ParticipantDataTypeSummary2025;
-import org.kpmp.participant.ParticipantRepoDataTypeInformation;
-import org.kpmp.participant.ParticipantRepoDataTypeSummary;
-import org.kpmp.participant.ParticipantService;
-import org.kpmp.participant.ParticipantService2025;
-import org.kpmp.participant.ParticipantSummaryDataset;
-import org.kpmp.participant.ParticipantEnrollmentCategorySummary;
+import org.kpmp.participant.*;
import org.kpmp.umap.PlotData;
-import org.kpmp.umap.UmapDataService;
import org.kpmp.umap.UmapDataService2025;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,41 +38,35 @@ public class QueryController implements GraphQLQueryResolver {
private AutocompleteService autocompleteService;
private CellTypeService cellTypeService;
- private GeneExpressionSummaryService geneExpressionSummaryService;
private GeneExpressionSummaryService2025 geneExpressionSummaryService2025;
private DataSummaryService dataSummaryService;
- private UmapDataService umapService;
private UmapDataService2025 umapService2025;
private ClusterHierarchyService clusterHierarchyService;
private RTExpressionDataService rtExpressionDataService;
-
private RPExpressionDataService rpExpressionDataService;
- private ParticipantService participantService;
private ParticipantService2025 participantService2025;
private AtlasMessageService atlasMessageService;
+ private HubmapCellTypeMappingService hubmapCellTypeMappingService;
private Logger logger = LoggerFactory.getLogger(QueryController.class);
@Autowired
- public QueryController(AutocompleteService autocompleteService, CellTypeService cellTypeService,
- UmapDataService umapService, UmapDataService2025 umapService2025, GeneExpressionSummaryService geneExpressionSummaryService,
+ public QueryController(AutocompleteService autocompleteService, CellTypeService cellTypeService, UmapDataService2025 umapService2025,
GeneExpressionSummaryService2025 geneExpressionService2025,
DataSummaryService dataSummaryService, ClusterHierarchyService clusterHierarchyService,
- RTExpressionDataService rtExpressionDataService, RPExpressionDataService rpExpressionDataService,
- ParticipantService participantService, ParticipantService2025 participantService2025, AtlasMessageService atlasMessageService) {
+ RTExpressionDataService rtExpressionDataService, RPExpressionDataService rpExpressionDataService, ParticipantService2025 participantService2025,
+ AtlasMessageService atlasMessageService, HubmapCellTypeMappingService hubmapCellTypeMappingService) {
this.autocompleteService = autocompleteService;
this.cellTypeService = cellTypeService;
- this.umapService = umapService;
this.umapService2025 = umapService2025;
- this.geneExpressionSummaryService = geneExpressionSummaryService;
this.geneExpressionSummaryService2025 = geneExpressionService2025;
this.dataSummaryService = dataSummaryService;
this.clusterHierarchyService = clusterHierarchyService;
this.rtExpressionDataService = rtExpressionDataService;
this.rpExpressionDataService = rpExpressionDataService;
- this.participantService = participantService;
this.participantService2025 = participantService2025;
this.atlasMessageService = atlasMessageService;
+ this.hubmapCellTypeMappingService = hubmapCellTypeMappingService;
}
@QueryMapping
@@ -87,29 +74,11 @@ public List autocomplete(@Argument String searchTerm) throws
return autocompleteService.query(searchTerm);
}
- @QueryMapping
- public CellTypeHierarchy cellTypeHierarchy() throws IOException {
- return cellTypeService.getCellTypeHierarchy();
- }
-
@QueryMapping
public CellTypeHierarchy cellTypeHierarchy2025() throws IOException {
return cellTypeService.getCellTypeHierarchy2025();
}
- @QueryMapping
- public List extends GeneExpressionSummary> geneExpressionSummary(@Argument String dataType, @Argument String geneSymbol,
- @Argument String cellType, @Argument String enrollmentCategory) throws IOException {
- List extends GeneExpressionSummary> results = new ArrayList<>();
- if (cellType.isEmpty()) {
- results = geneExpressionSummaryService.getByDataTypeEnrollmentCategoryAndGene(dataType, geneSymbol, enrollmentCategory);
- } else if (geneSymbol.isEmpty()) {
- results = geneExpressionSummaryService.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(dataType,
- cellType, enrollmentCategory);
- }
- return results;
- }
-
@QueryMapping
public List extends GeneExpressionSummary> geneExpressionSummary2025(@Argument String dataType, @Argument String geneSymbol,
@Argument String cellType, @Argument String enrollmentCategory) throws IOException {
@@ -123,26 +92,11 @@ public List extends GeneExpressionSummary> geneExpressionSummary2025(@Argument
return results;
}
- @QueryMapping
- public List getClusterHieararchies(@Argument String cellType) throws IOException {
- return clusterHierarchyService.findClustersByCellType(cellType);
- }
-
@QueryMapping
public List getClusterHieararchies2025(@Argument String cellType) throws IOException {
return clusterHierarchyService.findClustersByCellType2025(cellType);
}
- @QueryMapping
- public PlotData getUmapPlotData(@Argument String dataType, @Argument String geneSymbol, @Argument String enrollmentCategory) throws Exception {
- try {
- return umapService.getPlotData(dataType, geneSymbol, enrollmentCategory);
- } catch (Exception e) {
- logger.error(e.getMessage());
- throw e;
- }
- }
-
@QueryMapping
public PlotData getUmapPlotData2025(@Argument String dataType, @Argument String geneSymbol, @Argument String enrollmentCategory) throws Exception {
try {
@@ -153,16 +107,6 @@ public PlotData getUmapPlotData2025(@Argument String dataType, @Argument String
}
}
- @QueryMapping
- public List getDataTypeSummaryInformation() throws Exception {
- try {
- return geneExpressionSummaryService.getDataTypeSummaryInformation();
- } catch (Exception e) {
- logger.error(e.getMessage());
- throw e;
- }
- }
-
@QueryMapping
public List getDataTypeSummaryInformation2025() throws Exception {
try {
@@ -183,21 +127,10 @@ public List getSummaryData() throws Exception {
}
}
- @QueryMapping
- public List dataTypesForConcept(@Argument String geneSymbol, @Argument String clusterName) throws Exception {
- if (geneSymbol != null && !geneSymbol.isEmpty()) {
- return geneExpressionSummaryService.findDataTypesByGene(geneSymbol);
- } else if (clusterName != null && !clusterName.isEmpty()) {
- return clusterHierarchyService.findDataTypesByClusterName(clusterName);
- }
- throw new Exception("Must provide either a cluster or a gene symbol.");
-
- }
-
@QueryMapping
public List dataTypesForConcept2025(@Argument String geneSymbol, @Argument String clusterName) throws Exception {
if (geneSymbol != null && !geneSymbol.isEmpty()) {
- return geneExpressionSummaryService.findDataTypesByGene(geneSymbol);
+ return geneExpressionSummaryService2025.findDataTypesByGene(geneSymbol);
} else if (clusterName != null && !clusterName.isEmpty()) {
return clusterHierarchyService.findDataTypesByClusterName2025(clusterName);
}
@@ -260,32 +193,27 @@ public List getRPGeneExpressionByEnrollment(@Argument String g
@QueryMapping
public ParticipantClinicalDataset getParticipantClinicalDataset(@Argument String redcapId) {
try{
- return participantService.getParticipantClinicalDataset(redcapId);
+ return participantService2025.getParticipantClinicalDataset(redcapId);
}catch (Exception e) {
logger.error(e.getMessage());
throw e;
}
}
- @QueryMapping
- public ParticipantDataTypeSummary getDataTypeInformationByParticipant(@Argument String redcapId) {
- return participantService.getExperimentCounts(redcapId);
- }
-
@QueryMapping
public ParticipantDataTypeSummary2025 getDataTypeInformationByParticipant2025(@Argument String redcapId) {
return participantService2025.getExperimentCounts(redcapId);
}
@QueryMapping
- public ParticipantRepoDataTypeSummary getRepoDataTypeInformationByParticipant(@Argument String redcapId) {
- return participantService.getDataTypeCounts(redcapId);
- }
+ public ParticipantRepoDataTypeSummary getRepoDataTypeInformationByParticipant(@Argument String redcapId) {
+ return participantService2025.getDataTypeCounts(redcapId);
+ }
@QueryMapping
public ParticipantSummaryDataset participantSummaryDataset(@Argument String redcapId) throws Exception {
try {
- return participantService.getParticipantSummaryDataset(redcapId);
+ return participantService2025.getParticipantSummaryDataset(redcapId);
} catch (Exception e) {
logger.error(e.getMessage());
ParticipantSummaryDataset emptyResult = new ParticipantSummaryDataset();
@@ -298,7 +226,7 @@ public ParticipantSummaryDataset participantSummaryDataset(@Argument String redc
@QueryMapping
public ParticipantRepoDataTypeInformation getTotalParticipantFilesCount(@Argument String redcapId) throws Exception {
try {
- return this.participantService.getTotalFilesCount(redcapId);
+ return this.participantService2025.getTotalFilesCount(redcapId);
} catch (Exception e) {
logger.error(e.getMessage());
throw e;
@@ -308,7 +236,7 @@ public ParticipantRepoDataTypeInformation getTotalParticipantFilesCount(@Argumen
@QueryMapping
public List getEnrollmentCategorySummaryData() throws Exception {
try {
- return participantService.getEnrollmentData();
+ return participantService2025.getEnrollmentData();
} catch (Exception e) {
logger.error(e.getMessage());
throw e;
@@ -337,6 +265,11 @@ public List getAtlasMessages() throws Exception {
@QueryMapping
public List getExperimentalStrategyCountsByParticipant(@Argument String redcapId) {
- return participantService.getExperimentalStrategyCountsByParticipant(redcapId);
+ return participantService2025.getExperimentalStrategyCountsByParticipant(redcapId);
+ }
+
+ @QueryMapping
+ public List getHubmapTermMap() {
+ return hubmapCellTypeMappingService.buildHubmapIdToCellTypeMap();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/cellType/CellTypeRepository.java b/src/main/java/org/kpmp/cellType/CellTypeRepository.java
index 4d3c7a28..eca40027 100755
--- a/src/main/java/org/kpmp/cellType/CellTypeRepository.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeRepository.java
@@ -19,9 +19,6 @@ public interface CellTypeRepository extends CrudRepository {
+ " WHERE ct.cell_type LIKE %:searchTerm% ", nativeQuery = true)
List findByCellTypeContainingOrSynonymContaining(@Param("searchTerm") String searchTerm);
- @Cacheable("cellTypeIsNotNullOrderByCellTypeOrdering")
- List findAllByCellTypeIsNotNullOrderByCellTypeOrdering();
-
@Cacheable("cellTypeIsNotNullOrderByCellTypeOrdering2025")
@Query(value = "SELECT * FROM cell_type_2025 WHERE cell_type IS NOT NULL ORDER BY cell_type_order ASC", nativeQuery = true)
List findAllByCellTypeIsNotNullOrderByCellTypeOrdering2025();
diff --git a/src/main/java/org/kpmp/cellType/CellTypeService.java b/src/main/java/org/kpmp/cellType/CellTypeService.java
index 744f781f..f9c5712e 100755
--- a/src/main/java/org/kpmp/cellType/CellTypeService.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeService.java
@@ -15,21 +15,6 @@ public CellTypeService(CellTypeRepository cellTypeRepo) {
this.cellTypeRepo = cellTypeRepo;
}
- public CellTypeHierarchy getCellTypeHierarchy() {
- List cellTypes = cellTypeRepo.findAllByCellTypeIsNotNullOrderByCellTypeOrdering();
- CellTypeHierarchy hierarchy = new CellTypeHierarchy();
-
- for (CellType cellType : cellTypes) {
- CellTypeStructureSubregion subregion = new CellTypeStructureSubregion(cellType.getStructureSubregion());
- subregion.addCellType(cellType);
- CellTypeStructureRegion region = new CellTypeStructureRegion(cellType.getStructureRegion());
- region.addCellTypeSubregion(subregion);
- hierarchy.addCellTypeStructureRegion(region);
- }
-
- return hierarchy;
- }
-
public CellTypeHierarchy getCellTypeHierarchy2025() {
List cellTypes = cellTypeRepo.findAllByCellTypeIsNotNullOrderByCellTypeOrdering2025();
CellTypeHierarchy hierarchy = new CellTypeHierarchy();
diff --git a/src/main/java/org/kpmp/cellType/HubmapCellTypeMappingService.java b/src/main/java/org/kpmp/cellType/HubmapCellTypeMappingService.java
new file mode 100644
index 00000000..9e059016
--- /dev/null
+++ b/src/main/java/org/kpmp/cellType/HubmapCellTypeMappingService.java
@@ -0,0 +1,18 @@
+package org.kpmp.cellType;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+
+@Service
+public class HubmapCellTypeMappingService {
+
+ private final HubmapOnotologyCellTypeRepository repo;
+
+ public HubmapCellTypeMappingService(HubmapOnotologyCellTypeRepository repo) {
+ this.repo = repo;
+ }
+
+ public List buildHubmapIdToCellTypeMap() {
+ return repo.findAll();
+ }
+}
diff --git a/src/main/java/org/kpmp/cellType/HubmapOnotologyCellTypeRepository.java b/src/main/java/org/kpmp/cellType/HubmapOnotologyCellTypeRepository.java
new file mode 100644
index 00000000..9052121c
--- /dev/null
+++ b/src/main/java/org/kpmp/cellType/HubmapOnotologyCellTypeRepository.java
@@ -0,0 +1,16 @@
+package org.kpmp.cellType;
+
+import org.jetbrains.annotations.NotNull;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface HubmapOnotologyCellTypeRepository extends CrudRepository {
+
+ @NotNull
+ @Cacheable("hubmapOntologyCellTypeMap")
+ List findAll();
+}
diff --git a/src/main/java/org/kpmp/cellType/HubmapOntologyCellType.java b/src/main/java/org/kpmp/cellType/HubmapOntologyCellType.java
new file mode 100644
index 00000000..6d1f56b5
--- /dev/null
+++ b/src/main/java/org/kpmp/cellType/HubmapOntologyCellType.java
@@ -0,0 +1,35 @@
+package org.kpmp.cellType;
+
+import java.io.Serializable;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+
+@Entity
+@Table(name = "hubmap_ontology_celltype_v")
+public class HubmapOntologyCellType implements Serializable{
+
+ @Id
+ @Column(name = "hubmap_ontology_id", nullable = false, insertable = false, updatable = false)
+ private String hubmapOntologyId;
+ private String cellType;
+
+ public String getHubmapOntologyId() {
+ return hubmapOntologyId;
+ }
+
+ public void setHubmapOntologyId(String hubmapOntologyId) {
+ this.hubmapOntologyId = hubmapOntologyId;
+ }
+
+ public String getCellType() {
+ return cellType;
+ }
+
+ public void setCellType(String cell_type) {
+ this.cellType = cell_type;
+ }
+
+}
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java
index 8df0a5c1..2024d666 100755
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java
+++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java
@@ -2,7 +2,6 @@
import java.util.List;
-import org.kpmp.cluster.Cluster;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
@@ -10,10 +9,6 @@
interface ClusterHiearchyRepository extends CrudRepository {
- @Override
- @Cacheable("clusterHierarchy")
- List findAll();
-
@Cacheable("clusterHierarchyRNA2025ByCellType")
@Query(value = "SELECT ch.*, 'N' AS is_rt, 'N' AS is_rp FROM cluster_hierarchy_2025_v ch WHERE ch.cell_type = :cell_type OR ch.structure_region = :cell_type OR ch.structure_subregion = :cell_type " +
"ORDER BY ch.cell_type_order ASC", nativeQuery = true)
@@ -54,12 +49,4 @@ interface ClusterHiearchyRepository extends CrudRepository findByCellType(@Param("cell_type") String cellType);
-
- @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
index c633a9f1..adc7f6bb 100755
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
+++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
@@ -7,8 +7,10 @@
import jakarta.persistence.Id;
import jakarta.persistence.IdClass;
import jakarta.persistence.Table;
+import jakarta.persistence.Transient;
import org.springframework.lang.Nullable;
+import com.fasterxml.jackson.annotation.JsonProperty;
@Entity
@Table(name = "cluster_hierarchy_v")
@@ -42,6 +44,9 @@ public class ClusterHierarchy implements Serializable {
@Column(name = "cell_type_order")
private Double cellTypeOrder;
+ @Transient
+ private String isSpatialTranscriptomics;
+
public int getCellTypeId() {
return cellTypeId;
}
@@ -116,6 +121,16 @@ public String getIsRegionalProteomics() {
public void setIsRegionalProteomics(String isRegionalProteomics) {
this.isRegionalProteomics = isRegionalProteomics;
}
+
+ @JsonProperty("isSpatialTranscriptomics")
+ public String getIsSpatialTranscriptomics() {
+ return isSpatialTranscriptomics;
+ }
+
+ public void setIsSpatialTranscriptomics(String isSpatialTranscriptomics) {
+ this.isSpatialTranscriptomics = isSpatialTranscriptomics;
+ }
+
@Nullable
public Double getCellTypeOrder() {
return cellTypeOrder;
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy2025.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy2025.java
deleted file mode 100644
index f7202195..00000000
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy2025.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.kpmp.cellTypeSummary;
-
-import jakarta.persistence.*;
-import org.springframework.lang.Nullable;
-
-import java.io.Serializable;
-
-@Entity
-@Table(name = "cluster_hierarchy_2025_v")
-@IdClass(ClusterHierarchyId.class)
-public class ClusterHierarchy2025 implements Serializable {
-
- private static final long serialVersionUID = -7707637379989017634L;
- @Id
- @Column(name = "cell_type_id")
- private int cellTypeId;
- @Id
- @Column(name = "cluster_id")
- private int clusterId;
- @Column(name = "structure_region")
- private String structureRegion;
- @Column(name = "structure_subregion")
- private String structureSubregion;
- @Column(name = "cluster_name")
- private String clusterName;
- @Column(name = "is_single_cell")
- private String isSingleCellCluster;
- @Column(name = "is_single_nuc")
- private String isSingleNucCluster;
- @Column(name = "is_rt")
- private String isRegionalTranscriptomics;
- @Column(name = "is_rp")
- private String isRegionalProteomics;
- @Column(name = "cell_type")
- private String cellType;
- @Column(name = "cell_type_order")
- private Double cellTypeOrder;
-
- public int getCellTypeId() {
- return cellTypeId;
- }
-
- public void setCellTypeId(int cellTypeId) {
- this.cellTypeId = cellTypeId;
- }
-
- @Nullable
- public int getClusterId() {
- return clusterId;
- }
-
- public void setClusterId(int clusterId) {
- this.clusterId = clusterId;
- }
-
- public String getStructureRegion() {
- return structureRegion;
- }
-
- public void setStructureRegion(String structureRegion) {
- this.structureRegion = structureRegion;
- }
-
- @Nullable
- public String getStructureSubregion() {
- return structureSubregion;
- }
-
- public void setStructureSubregion(String structureSubregion) {
- this.structureSubregion = structureSubregion;
- }
-
- @Nullable
- public String getClusterName() {
- return clusterName;
- }
-
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- public String getIsSingleCellCluster() {
- return isSingleCellCluster;
- }
-
- public void setIsSingleCellCluster(String isSingleCellCluster) {
- this.isSingleCellCluster = isSingleCellCluster;
- }
-
- public String getIsSingleNucCluster() {
- return isSingleNucCluster;
- }
-
- public void setIsSingleNucCluster(String isSingleNucCluster) {
- this.isSingleNucCluster = isSingleNucCluster;
- }
-
- public String getIsRegionalTranscriptomics() {
- return isRegionalTranscriptomics;
- }
-
- public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
- this.isRegionalTranscriptomics = isRegionalTranscriptomics;
- }
-
- public String getIsRegionalProteomics() {
- return isRegionalProteomics;
- }
-
- public void setIsRegionalProteomics(String isRegionalProteomics) {
- this.isRegionalProteomics = isRegionalProteomics;
- }
- @Nullable
- public Double getCellTypeOrder() {
- return cellTypeOrder;
- }
-
- public void setCellTypeOrder(Double cellTypeOrder) {
- this.cellTypeOrder = cellTypeOrder;
- }
-
- @Nullable
- public String getCellType() {
- return cellType;
- }
-
- public void setCellType(String cellType) {
- this.cellType = cellType;
- }
-}
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java
index 46bfb1ea..3155e47f 100755
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java
+++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java
@@ -16,66 +16,6 @@ public ClusterHierarchyService(ClusterHiearchyRepository clusterHierarchyRepo) {
this.clusterHierarchyRepo = clusterHierarchyRepo;
}
- public List findClustersByCellType(String cellType) {
-
- ArrayList result = new ArrayList<>();
- Map clusterToHierarchy = new HashMap<>();
- List clusterHierarchies = clusterHierarchyRepo.findByCellType(cellType);
- for (ClusterHierarchy clusterHierarchy : clusterHierarchies) {
- String clusterName = clusterHierarchy.getClusterName();
- if (clusterToHierarchy.containsKey(clusterName)) {
- if (clusterName == null) {
- result.add(clusterHierarchy);
- } else if (clusterName != null && clusterName.equals(clusterHierarchy.getCellType())) {
- clusterToHierarchy.put(clusterName, clusterHierarchy);
- }
- } else {
- clusterToHierarchy.put(clusterName, clusterHierarchy);
- }
- }
- if (cellType.equals("Tubules") || cellType.equals("Interstitium")) {
- ClusterHierarchy tiCluster = new ClusterHierarchy();
- tiCluster.setStructureRegion("Tubulo-interstitium");
- tiCluster.setIsSingleCellCluster("N");
- tiCluster.setIsSingleNucCluster("N");
- tiCluster.setIsRegionalProteomics("Y");
- tiCluster.setIsRegionalTranscriptomics("Y");
- tiCluster.setCellTypeOrder(0.01);
- result.add(tiCluster);
- }
- result.addAll(clusterToHierarchy.values());
- Collections.sort(result, new Comparator() {
- @Override
- public int compare(ClusterHierarchy a, ClusterHierarchy b) {
- return a.getCellTypeOrder().compareTo(b.getCellTypeOrder());
- }
- });
- return result;
- }
-
- public List findDataTypesByClusterName(String clusterName) {
- List dataTypesRepresented = new ArrayList<>();
- if (clusterName.equals("Tubulo-interstitium")) {
- dataTypesRepresented.add(FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation());
- dataTypesRepresented.add(FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation());
- } else {
- ClusterHierarchy clustersInDataTypes = clusterHierarchyRepo.findFirstByClusterOrRegion(clusterName);
- if (clustersInDataTypes.getIsSingleCellCluster().equalsIgnoreCase("Y")) {
- dataTypesRepresented.add(FullDataTypeEnum.SINGLE_CELL.getAbbreviation());
- }
- if (clustersInDataTypes.getIsSingleNucCluster().equalsIgnoreCase("Y")) {
- dataTypesRepresented.add(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation());
- }
- if (clustersInDataTypes.getIsRegionalTranscriptomics().equalsIgnoreCase("Y")) {
- dataTypesRepresented.add(FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation());
- }
- if (clustersInDataTypes.getIsRegionalProteomics().equalsIgnoreCase("Y")) {
- dataTypesRepresented.add(FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation());
- }
- }
- return dataTypesRepresented;
- }
-
public List findClustersByCellType2025(String cellType) {
ArrayList result = new ArrayList<>();
@@ -84,6 +24,7 @@ public List findClustersByCellType2025(String cellType) {
List clusterHierarchiesRNASeq = clusterHierarchyRepo.findRnaSeqByCellTypeOrRegion(cellType);
List clusterHierarchiesRegional = clusterHierarchyRepo.findRTRPByCellTypeOrRegion(cellType);
List clusterHierarchiesParentRegions = clusterHierarchyRepo.findRTRPParentRegions(cellType);
+
clusterHierarchiesRNASeq.addAll(clusterHierarchiesRegional);
clusterHierarchiesRNASeq.addAll(clusterHierarchiesParentRegions);
clusterHierarchySet.addAll(clusterHierarchiesRNASeq);
@@ -109,6 +50,15 @@ public List findClustersByCellType2025(String cellType) {
tiCluster.setCellTypeOrder(0.01);
result.add(tiCluster);
}
+ ClusterHierarchy bogusST = new ClusterHierarchy();
+ bogusST.setIsSpatialTranscriptomics("Y");
+ bogusST.setCellTypeOrder(-1.0);
+ bogusST.setIsSingleCellCluster("N");
+ bogusST.setIsSingleNucCluster("N");
+ bogusST.setIsRegionalProteomics("N");
+ bogusST.setIsRegionalTranscriptomics("N");
+ bogusST.setStructureRegion("Glomerulus / Renal Corpuscle");
+ result.add(bogusST);
result.addAll(clusterToHierarchy.values());
Collections.sort(result, new Comparator() {
@Override
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
index d34beb59..f5d905f9 100755
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
@@ -1,148 +1,148 @@
-package org.kpmp.geneExpression;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-
-@Entity
-@Table(name = "rt_segments")
-public class RTExpressionDataAllSegments implements RTExpressionData, Serializable {
-
- private static final long serialVersionUID = 9029734049386312455L;
- @Id
- @Column(name = "id")
- private Integer id;
- @Column(name = "gene_symbol")
- private String geneSymbol;
- @Column(name = "segment")
- private String segment;
- @Column(name = "segment_name")
- private String segmentName;
- @Column(name = "fold_change")
- private Double foldChange;
- @Column(name = "p_val")
- private Double pVal;
- @Column(name = "std_dev")
- private Double stdDev;
- @Column(name = "p_val_log10")
- private Double pValLog10;
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
- @Column(name = "adj_p_val")
- private Double adjPVal;
- @Column(name = "sample_count")
- private Integer sampleCount;
-
- @Override
- public Integer getId() {
- return id;
- }
-
- @Override
- public void setId(Integer id) {
- this.id = id;
- }
-
- @Override
- public String getGeneSymbol() {
- return geneSymbol;
- }
-
- @Override
- public void setGeneSymbol(String geneSymbol) {
- this.geneSymbol = geneSymbol;
- }
-
- @Override
- public String getSegment() {
- return segment;
- }
-
- @Override
- public void setSegment(String segment) {
- this.segment = segment;
- }
-
- @Override
- public Double getFoldChange() {
- return foldChange;
- }
-
- @Override
- public void setFoldChange(Double foldChange) {
- this.foldChange = foldChange;
- }
-
- @Override
- public Double getPVal() {
- return pVal;
- }
-
- @Override
- public void setPVal(Double pVal) {
- this.pVal = pVal;
- }
-
- @Override
- public Double getStdDev() {
- return stdDev;
- }
-
- @Override
- public void setStdDev(Double stdDev) {
- this.stdDev = stdDev;
- }
-
- @Override
- public Double getPValLog10() {
- return pValLog10;
- }
-
- @Override
- public void setPValLog10(Double pValLog10) {
- this.pValLog10 = pValLog10;
- }
-
- @Override
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- @Override
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-
- @Override
- public Integer getSampleCount() {
- return sampleCount;
- }
-
- @Override
- public void setSampleCount(Integer sampleCount) {
- this.sampleCount = sampleCount;
- }
-
- @Override
- public String getSegmentName() {
- return segmentName;
- }
-
- @Override
- public void setSegmentName(String segmentName) {
- this.segmentName = segmentName;
- }
-
- @Override
- public Double getAdjPVal() {
- return adjPVal;
- }
-
- @Override
- public void setAdjPVal(Double adjPVal) {
- this.adjPVal = adjPVal;
- }
-}
+package org.kpmp.geneExpression;
+
+import java.io.Serializable;
+
+import jakarta.persistence.*;
+
+@Entity
+@Table(name = "rt_segments")
+@IdClass(RTExpressionDataId.class)
+public class RTExpressionDataAllSegments implements RTExpressionData, Serializable {
+
+ private static final long serialVersionUID = 9029734049386312455L;
+ @Id
+ @Column(name = "id")
+ private Integer id;
+ @Id
+ @Column(name = "gene_symbol")
+ private String geneSymbol;
+ @Column(name = "segment")
+ private String segment;
+ @Column(name = "segment_name")
+ private String segmentName;
+ @Column(name = "fold_change")
+ private Double foldChange;
+ @Id
+ @Column(name = "p_val")
+ private Double pVal;
+ @Column(name = "std_dev")
+ private Double stdDev;
+ @Column(name = "p_val_log10")
+ private Double pValLog10;
+ @Column(name = "enrollment_category")
+ private String enrollmentCategory;
+ @Column(name = "adj_p_val")
+ private Double adjPVal;
+ @Column(name = "sample_count")
+ private Integer sampleCount;
+
+ @Override
+ public Integer getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getGeneSymbol() {
+ return geneSymbol;
+ }
+
+ @Override
+ public void setGeneSymbol(String geneSymbol) {
+ this.geneSymbol = geneSymbol;
+ }
+
+ @Override
+ public String getSegment() {
+ return segment;
+ }
+
+ @Override
+ public void setSegment(String segment) {
+ this.segment = segment;
+ }
+
+ @Override
+ public Double getFoldChange() {
+ return foldChange;
+ }
+
+ @Override
+ public void setFoldChange(Double foldChange) {
+ this.foldChange = foldChange;
+ }
+
+ @Override
+ public Double getPVal() {
+ return pVal;
+ }
+
+ @Override
+ public void setPVal(Double pVal) {
+ this.pVal = pVal;
+ }
+
+ @Override
+ public Double getStdDev() {
+ return stdDev;
+ }
+
+ @Override
+ public void setStdDev(Double stdDev) {
+ this.stdDev = stdDev;
+ }
+
+ @Override
+ public Double getPValLog10() {
+ return pValLog10;
+ }
+
+ @Override
+ public void setPValLog10(Double pValLog10) {
+ this.pValLog10 = pValLog10;
+ }
+
+ @Override
+ public String getEnrollmentCategory() {
+ return enrollmentCategory;
+ }
+
+ @Override
+ public void setEnrollmentCategory(String enrollmentCategory) {
+ this.enrollmentCategory = enrollmentCategory;
+ }
+
+ @Override
+ public Integer getSampleCount() {
+ return sampleCount;
+ }
+
+ @Override
+ public void setSampleCount(Integer sampleCount) {
+ this.sampleCount = sampleCount;
+ }
+
+ @Override
+ public String getSegmentName() {
+ return segmentName;
+ }
+
+ @Override
+ public void setSegmentName(String segmentName) {
+ this.segmentName = segmentName;
+ }
+
+ @Override
+ public Double getAdjPVal() {
+ return adjPVal;
+ }
+
+ @Override
+ public void setAdjPVal(Double adjPVal) {
+ this.adjPVal = adjPVal;
+ }
+}
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java
index 7227691e..79a5d5e5 100755
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java
@@ -9,7 +9,7 @@
import org.springframework.stereotype.Repository;
@Repository
-public interface RTExpressionDataAllSegmentsRepository extends CrudRepository {
+public interface RTExpressionDataAllSegmentsRepository extends CrudRepository {
@Cacheable("rtExpGeneSymbolAndEnrollmentCategoryWithCounts")
@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.enrollment_category = rsv.enrollment_category "
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java
new file mode 100644
index 00000000..88c78d2e
--- /dev/null
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataId.java
@@ -0,0 +1,39 @@
+package org.kpmp.geneExpression;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+public class RTExpressionDataId implements Serializable {
+
+ private Integer id;
+ private String geneSymbol;
+ private Double pVal;
+
+ public RTExpressionDataId() {}
+
+ public RTExpressionDataId(Integer id, String geneSymbol, Double pVal) {
+ this.id = id;
+ this.geneSymbol = geneSymbol;
+ this.pVal = pVal;
+ }
+
+ public Integer getId() { return id; }
+ public void setId(Integer id) { this.id = id; }
+ public String getGeneSymbol() { return geneSymbol; }
+ public void setGeneSymbol(String geneSymbol) { this.geneSymbol = geneSymbol; }
+ public Double getPVal() { return pVal; }
+ public void setPVal(Double pVal) { this.pVal = pVal; }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ RTExpressionDataId that = (RTExpressionDataId) o;
+ return Objects.equals(id, that.id) && Objects.equals(geneSymbol, that.geneSymbol) && Objects.equals(pVal, that.pVal);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, geneSymbol, pVal);
+ }
+}
diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
deleted file mode 100755
index 9b40ab04..00000000
--- a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.kpmp.geneExpression;
-
-import java.io.Serializable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-
-
-@Entity
-@Table(name = "sc_feature_data")
-class SCExpressionData implements Serializable {
-
- private static final long serialVersionUID = 1079445825708102694L;
- @Id
- @Column(name = "gene_symbol")
- private String geneSymbol;
- @Column(name = "expression_data")
- private String expressionString;
-
- public String getGeneSymbol() {
- return geneSymbol;
- }
-
- public void setGeneSymbol(String geneSymbol) {
- this.geneSymbol = geneSymbol;
- }
-
- public String getExpressionString() {
- return expressionString;
- }
-
- public void setExpressionString(String expressionString) {
- this.expressionString = expressionString;
- }
-
- public JSONObject getExpressionDataAsJson() throws JSONException {
- return new JSONObject(expressionString);
- }
-
-}
diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java b/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java
deleted file mode 100755
index 558986a3..00000000
--- a/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.kpmp.geneExpression;
-
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.data.repository.CrudRepository;
-
-interface SCExpressionDataRepository extends CrudRepository {
-
- @Cacheable("scExpression")
- SCExpressionData findByGeneSymbol(String geneSymbol);
-
-}
diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
deleted file mode 100755
index a8cecf64..00000000
--- a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.kpmp.geneExpression;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-@Entity
-@Table(name = "sn_feature_data")
-public class SNExpressionData implements Serializable {
-
- private static final long serialVersionUID = -3363426907715685587L;
- @Id
- @Column(name = "gene_symbol")
- private String geneSymbol;
- @Column(name = "expression_data")
- private String expressionString;
-
- public String getGeneSymbol() {
- return geneSymbol;
- }
-
- public void setGeneSymbol(String geneSymbol) {
- this.geneSymbol = geneSymbol;
- }
-
- public String getExpressionString() {
- return expressionString;
- }
-
- public void setExpressionString(String expressionString) {
- this.expressionString = expressionString;
- }
-
- public JSONObject getExpressionDataAsJson() throws JSONException {
- return new JSONObject(expressionString);
- }
-
-}
diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java b/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java
deleted file mode 100755
index a3061cd7..00000000
--- a/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.kpmp.geneExpression;
-
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.data.repository.CrudRepository;
-
-interface SNExpressionDataRepository extends CrudRepository {
-
- @Cacheable("snExpression")
- SNExpressionData findByGeneSymbol(String geneSymbol);
-
-}
diff --git a/src/main/java/org/kpmp/geneExpression/SNSCExpressionDataService.java b/src/main/java/org/kpmp/geneExpression/SNSCExpressionDataService.java
deleted file mode 100755
index 89b31172..00000000
--- a/src/main/java/org/kpmp/geneExpression/SNSCExpressionDataService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.kpmp.geneExpression;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.kpmp.FullDataTypeEnum;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class SNSCExpressionDataService {
-
- private SNExpressionDataRepository snRepo;
- private SCExpressionDataRepository scRepo;
-
- @Autowired
- public SNSCExpressionDataService(SNExpressionDataRepository snRepo, SCExpressionDataRepository scRepo) {
- this.snRepo = snRepo;
- this.scRepo = scRepo;
- }
-
- public JSONObject getGeneExpressionValues(String dataType, String geneSymbol) throws JSONException, Exception {
- if (dataType.equals(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation())) {
- SNExpressionData expressionData = snRepo.findByGeneSymbol(geneSymbol);
- return expressionData.getExpressionDataAsJson();
- } else if (dataType.equals(FullDataTypeEnum.SINGLE_CELL.getAbbreviation())) {
- SCExpressionData expressionData = scRepo.findByGeneSymbol(geneSymbol);
- return expressionData.getExpressionDataAsJson();
- }
- throw new Exception("Invalid data type: " + dataType);
- }
-
-}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java
deleted file mode 100755
index 341ba9f0..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.kpmp.geneExpressionSummary;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.kpmp.FullDataTypeEnum;
-import org.kpmp.OmicsTypeEnum;
-import org.kpmp.EnrollmentCategoryEnum;
-import org.kpmp.dataSummary.DataTypeSummary;
-import org.kpmp.geneExpression.RPExpressionDataRepository;
-import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository;
-import org.kpmp.geneExpressionSummary.regionalProteomics.RPParticipantRepository;
-import org.kpmp.geneExpressionSummary.regionalTranscriptomics.RTParticipantRepository;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionSummaryRepository;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionSummaryRepository2025;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAParticipantRepository;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionSummaryRepository;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionSummaryRepository2025;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAParticipantRepository;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class GeneExpressionSummaryService {
- private SCRNAGeneExpressionSummaryRepository scrnaGeneExpressionRepository;
- private SNRNAGeneExpressionSummaryRepository snrnaGeneExpressionRepository;
- private SCRNAGeneExpressionSummaryRepository2025 scrnaGeneExpressionRepository2025;
- private SNRNAGeneExpressionSummaryRepository2025 snrnaGeneExpressionRepository2025;
- private SCRNAParticipantRepository scrnaParticipantRepository;
- private SNRNAParticipantRepository snrnaParticipantRepository;
- private RTParticipantRepository rtParticipantRepository;
-
- private RPParticipantRepository rpParticipantRepository;
- private RPExpressionDataRepository rpExpressionDataRepository;
- RTExpressionDataAllSegmentsRepository rtExpressionDataAllSegmentsRepository;
-
- @Autowired
- public GeneExpressionSummaryService(SCRNAGeneExpressionSummaryRepository scrnaGeneExpressionRepository,
- SNRNAGeneExpressionSummaryRepository snrnaGeneExpressionRepository,
- SNRNAGeneExpressionSummaryRepository2025 snrnaGeneExpressionRepository2025,
- SCRNAParticipantRepository scrnaParticipantRepository,
- SCRNAGeneExpressionSummaryRepository2025 scrnaGeneExpressionRepository2025,
- SNRNAParticipantRepository snrnaParticipantRepository, RTParticipantRepository rtParticipantRepository,
- RTExpressionDataAllSegmentsRepository rtExpressionDataAllSegmentsRepository, RPExpressionDataRepository rpExpressionDataRepository, RPParticipantRepository rpParticipantRepository) {
- this.scrnaGeneExpressionRepository = scrnaGeneExpressionRepository;
- this.snrnaGeneExpressionRepository = snrnaGeneExpressionRepository;
- this.snrnaGeneExpressionRepository2025 = snrnaGeneExpressionRepository2025;
- this.scrnaGeneExpressionRepository2025 = scrnaGeneExpressionRepository2025;
- this.scrnaParticipantRepository = scrnaParticipantRepository;
- this.snrnaParticipantRepository = snrnaParticipantRepository;
- this.rtParticipantRepository = rtParticipantRepository;
- this.rpExpressionDataRepository = rpExpressionDataRepository;
- this.rpParticipantRepository = rpParticipantRepository;
- this.rtExpressionDataAllSegmentsRepository = rtExpressionDataAllSegmentsRepository;
- }
-
- public List extends GeneExpressionSummary> getByDataTypeEnrollmentCategoryAndGene(String dataType, String geneSymbol,
- String enrollmentCategory) {
- List extends GeneExpressionSummary> results = new ArrayList<>();
- FullDataTypeEnum dataTypeEnum = FullDataTypeEnum.fromAbbreviation(dataType);
- EnrollmentCategoryEnum enrollmentCategoryEnum = EnrollmentCategoryEnum.fromRequestType(enrollmentCategory);
- switch (dataTypeEnum) {
- case SINGLE_CELL:
- return scrnaGeneExpressionRepository
- .findByEnrollmentAndGeneAllClusters(geneSymbol, enrollmentCategoryEnum.getParticipantEnrollmentCategory()).stream()
- .distinct().collect(Collectors.toList());
- case SINGLE_NUCLEUS:
- return snrnaGeneExpressionRepository
- .findByEnrollmentAndGeneAllClusters(geneSymbol, enrollmentCategoryEnum.getParticipantEnrollmentCategory()).stream()
- .distinct().collect(Collectors.toList());
- case UNKNOWN:
- List allResults = new ArrayList<>();
- allResults.addAll(scrnaGeneExpressionRepository.findByEnrollmentAndGeneAllClusters(geneSymbol,
- enrollmentCategoryEnum.getParticipantEnrollmentCategory()));
- allResults.addAll(snrnaGeneExpressionRepository.findByEnrollmentAndGeneAllClusters(geneSymbol,
- enrollmentCategoryEnum.getParticipantEnrollmentCategory()));
- return allResults;
- default:
- break;
-
- }
- return results;
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public List extends GeneExpressionSummary> getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(String dataType,
- String cellType, String enrollmentCategory) {
- List extends GeneExpressionSummary> results = new ArrayList<>();
- FullDataTypeEnum dataTypeEnum = FullDataTypeEnum.fromAbbreviation(dataType);
- EnrollmentCategoryEnum enrollmentCategoryEnum = EnrollmentCategoryEnum.fromRequestType(enrollmentCategory);
- switch (dataTypeEnum) {
- case SINGLE_CELL:
- results = scrnaGeneExpressionRepository.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(cellType,
- enrollmentCategoryEnum.getParticipantEnrollmentCategory());
- break;
- case SINGLE_NUCLEUS:
- results = snrnaGeneExpressionRepository.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(cellType,
- enrollmentCategoryEnum.getParticipantEnrollmentCategory());
- break;
- case UNKNOWN:
- List allResults = new ArrayList<>();
- allResults.addAll(scrnaGeneExpressionRepository.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(
- cellType, enrollmentCategoryEnum.getParticipantEnrollmentCategory()));
- allResults.addAll(snrnaGeneExpressionRepository.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(
- cellType, enrollmentCategoryEnum.getParticipantEnrollmentCategory()));
- results = allResults;
- default:
- break;
- }
- return results;
- }
-
- public List findDataTypesByGene2025(String gene) {
- List dataTypes = new ArrayList<>();
- long scCountByGene = scrnaGeneExpressionRepository2025.getCountByGene(gene);
- if (scCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.SINGLE_CELL.getAbbreviation());
- }
-
- long snCountByGene = snrnaGeneExpressionRepository2025.getCountByGene(gene);
- if (snCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation());
- }
- long rtCountByGene = rtExpressionDataAllSegmentsRepository.getCountByGene(gene);
- if (rtCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation());
- }
- long rpCountByGene = rpExpressionDataRepository.getCountByGene(gene);
- if (rpCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation());
- }
- return dataTypes;
- }
-
- public List findDataTypesByGene(String gene) {
- List dataTypes = new ArrayList<>();
- long scCountByGene = scrnaGeneExpressionRepository.getCountByGene(gene);
- if (scCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.SINGLE_CELL.getAbbreviation());
- }
-
- long snCountByGene = snrnaGeneExpressionRepository.getCountByGene(gene);
- if (snCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation());
- }
- long rtCountByGene = rtExpressionDataAllSegmentsRepository.getCountByGene(gene);
- if (rtCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation());
- }
- long rpCountByGene = rpExpressionDataRepository.getCountByGene(gene);
- if (rpCountByGene != 0) {
- dataTypes.add(FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation());
- }
- return dataTypes;
- }
-
- public List getDataTypeSummaryInformation() {
- List dataTypeSummary = new ArrayList<>();
- dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.SINGLE_CELL.getFullName(), FullDataTypeEnum.SINGLE_CELL.getAbbreviation(),
- scrnaGeneExpressionRepository.getCountByEnrollment(EnrollmentCategoryEnum.AKI.getParticipantEnrollmentCategory()),
- scrnaGeneExpressionRepository.getCountByEnrollment(EnrollmentCategoryEnum.CKD.getParticipantEnrollmentCategory()),
- scrnaGeneExpressionRepository
- .getCountByEnrollment(EnrollmentCategoryEnum.HEALTHY_REFERENCE.getParticipantEnrollmentCategory()),
- scrnaGeneExpressionRepository.getCountByEnrollment(EnrollmentCategoryEnum.DMR.getParticipantEnrollmentCategory()),
- scrnaParticipantRepository.getParticipantCount(),
- scrnaParticipantRepository.getParticipantCount()));
- dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
- FullDataTypeEnum.SINGLE_NUCLEUS.getFullName(), FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(),
- snrnaGeneExpressionRepository.getCountByEnrollment(EnrollmentCategoryEnum.AKI.getParticipantEnrollmentCategory()),
- snrnaGeneExpressionRepository.getCountByEnrollment(EnrollmentCategoryEnum.CKD.getParticipantEnrollmentCategory()),
- snrnaGeneExpressionRepository
- .getCountByEnrollment(EnrollmentCategoryEnum.HEALTHY_REFERENCE.getParticipantEnrollmentCategory()),
- snrnaGeneExpressionRepository.getCountByEnrollment(EnrollmentCategoryEnum.DMR.getParticipantEnrollmentCategory()),
- snrnaParticipantRepository.getParticipantCount(),
- snrnaParticipantRepository.getParticipantCount()));
- dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
- FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getFullName(),
- FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation(),
- rtParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.AKI.getParticipantEnrollmentCategory()),
- rtParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.CKD.getParticipantEnrollmentCategory()),
- rtParticipantRepository
- .getCountByEnrollmentCategory(EnrollmentCategoryEnum.HEALTHY_REFERENCE.getParticipantEnrollmentCategory()),
- rtParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.DMR.getParticipantEnrollmentCategory()),
- rtParticipantRepository.getParticipantCount(),
- rtParticipantRepository.getParticipantCount()));
- dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
- FullDataTypeEnum.REGIONAL_PROTEOMICS.getFullName(),
- FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation(),
- rpParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.AKI.getParticipantEnrollmentCategory()),
- rpParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.CKD.getParticipantEnrollmentCategory()),
- rpParticipantRepository
- .getCountByEnrollmentCategory(EnrollmentCategoryEnum.HEALTHY_REFERENCE.getParticipantEnrollmentCategory()),
- rpParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.DMR.getParticipantEnrollmentCategory()),
- rpParticipantRepository.getParticipantCount(),
- rpParticipantRepository.getParticipantCount()));
- return dataTypeSummary;
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService2025.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService2025.java
index 967578ae..e4a86f03 100755
--- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService2025.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService2025.java
@@ -165,12 +165,12 @@ public List getDataTypeSummaryInformation() {
rpParticipantRepository.getCountByEnrollmentCategory(EnrollmentCategoryEnum.DMR.getParticipantEnrollmentCategory()),
rpParticipantRepository.getParticipantCount(),
rpParticipantRepository.getParticipantCount()));
- // dataTypeSummary.add(new DataTypeSummary(
- // OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- // FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getFullName(),
- // FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(),
- // 1000L, 1000L, 1000L,
- // 1000L, 1000L, 1000L));
+ dataTypeSummary.add(new DataTypeSummary(
+ OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getFullName(),
+ FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(),
+ 1000L, 1000L, 1000L,
+ 1000L, 1000L, 1000L));
return dataTypeSummary;
}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAGeneExpressionExpressionSummaryValue.java
deleted file mode 100755
index 6ac88b9d..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAGeneExpressionExpressionSummaryValue.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleCell;
-
-import java.beans.Transient;
-import java.io.Serializable;
-
-import jakarta.annotation.Nullable;
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.kpmp.FullDataTypeEnum;
-import org.kpmp.geneExpressionSummary.GeneExpressionId;
-import org.kpmp.geneExpressionSummary.GeneExpressionSummary;
-
-@Entity
-@Table(name = "sc_rnaseq")
-@IdClass(GeneExpressionId.class)
-public class SCRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable {
-
- private static final long serialVersionUID = 7265280085624504185L;
- @Column(name = "id")
- private Integer id;
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
- @Id
- @Column(name = "gene")
- private String gene;
- @Column(name = "p_val")
- private Double pVal;
- @Column(name = "p_val_adj")
- private Double pValAdj;
- @Column(name = "fold_change")
- private Double foldChange;
- @Column(name = "pct_1")
- private Double pct1;
- @Column(name = "pct_2")
- private Double pct2;
- @Column(name = "avg_exp")
- private Double avgExp;
- @Id
- @Column(name = "cluster")
- private String cluster;
-
- @Column(name = "cluster_name")
- private String clusterName;
-
- @Column(name = "cell_count")
- private Integer cellCount;
-
- @Override
- @Transient
- public String getDataType() {
- return FullDataTypeEnum.SINGLE_CELL.getAbbreviation();
- }
-
- @Override
- public void setCellCount(Integer cellCount) {
- this.cellCount = cellCount;
- }
-
- @Override
- public Integer getCellCount() {
- return this.cellCount;
- }
-
- @Override
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- @Nullable
- @Override
- public String getClusterName() {
- return this.clusterName;
- }
-
- @Override
- @Nullable
- public Integer getId() {
- return id;
- }
-
- @Override
- public void setId(Integer id) {
- this.id = id;
- }
-
- @Override
- @Nullable
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- @Override
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-
- @Override
- @Nullable
- public String getGene() {
- return gene;
- }
-
- @Override
- 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;
- }
-
- @Override
- @Nullable
- public Double getFoldChange() {
- return foldChange;
- }
-
- @Override
- public void setFoldChange(Double foldChange) {
- this.foldChange = foldChange;
- }
-
- @Override
- @Nullable
- public Double getPct1() {
- return pct1;
- }
-
- @Override
- public void setPct1(Double pct1) {
- this.pct1 = pct1;
- }
-
- @Override
- @Nullable
- public Double getPct2() {
- return pct2;
- }
-
- @Override
- public void setPct2(Double pct2) {
- this.pct2 = pct2;
- }
-
- @Override
- @Nullable
- public Double getAvgExp() {
- return avgExp;
- }
-
- @Override
- public void setAvgExp(Double avgExp) {
- this.avgExp = avgExp;
- }
-
- @Override
- @Nullable
- public String getCluster() {
- return cluster;
- }
-
- @Override
- public void setCluster(String cluster) {
- this.cluster = cluster;
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(gene).append(cluster).build();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (!(obj instanceof SCRNAGeneExpressionExpressionSummaryValue))
- return false;
- SCRNAGeneExpressionExpressionSummaryValue that = (SCRNAGeneExpressionExpressionSummaryValue) obj;
- return new EqualsBuilder().append(this.gene, that.gene).append(this.cluster, that.cluster).build();
- }
-
-}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAGeneExpressionSummaryRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAGeneExpressionSummaryRepository.java
deleted file mode 100755
index 57db52fc..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAGeneExpressionSummaryRepository.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleCell;
-
-import java.util.List;
-
-import org.kpmp.geneExpressionSummary.GeneExpressionId;
-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;
-
-@Repository
-public interface SCRNAGeneExpressionSummaryRepository
- extends CrudRepository {
-
- @Cacheable("scCountsAllClusters")
- @Query(value = "SELECT DISTINCT scc.cluster, scc.cluster_name, scc.cell_count, scc.cluster_id as id, IF(isnull(scr.enrollment_category), :enrollmentCategory, scr.enrollment_category) as enrollment_category, 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.enrollment_category = LCASE(:enrollmentCategory) "
- + "WHERE scc.enrollment_category = LCASE(:enrollmentCategory) ORDER BY scr.p_val IS NULL, scr.p_val ASC", nativeQuery = true)
- List findByEnrollmentAndGeneAllClusters(
- @Param("geneSymbol") String geneSymbol, @Param("enrollmentCategory") String enrollmentCategory);
-
- @Cacheable("scCountsSummaryPerGene")
- @Query(value = "SELECT DISTINCT scr.cluster, c.cluster_name, 0 as cell_count, scr.id, scr.enrollment_category, 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.enrollment_category = LCASE(:enrollmentCategory) " + "ORDER BY scr.fold_change DESC", nativeQuery = true)
- List findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(
- @Param("cellType") String cellType, @Param("enrollmentCategory") String enrollmentCategory);
-
- @Cacheable("scCountsByGene")
- @Query(value = "SELECT COUNT(*) FROM sc_rnaseq scr WHERE scr.gene= :gene", nativeQuery = true)
- long getCountByGene(@Param("gene") String gene);
-
- @Cacheable("scCountsByEnrollment")
- @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.enrollment_category=:enrollmentCategory group by p.redcap_id) as mycount", nativeQuery = true)
- long getCountByEnrollment(@Param("enrollmentCategory") String enrollmentCategory);
-}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAParticipantRepository.java
deleted file mode 100755
index 26b8933f..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAParticipantRepository.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleCell;
-
-import org.kpmp.geneExpressionSummary.ParticipantId;
-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/singleCell/SCRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAParticipantValue.java
deleted file mode 100755
index 6db627b2..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleCell/SCRNAParticipantValue.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleCell;
-
-import org.kpmp.geneExpressionSummary.ParticipantId;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-
-@Entity
-@Table(name = "sn_participant_tissue_v")
-@IdClass(ParticipantId.class)
-public class SCRNAParticipantValue implements Serializable {
-
- private static final long serialVersionUID = 8746341469788157316L;
-
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
-
- @Column(name = "redcap_id")
- private String redcapId;
-
- @Id
- public String getRedcapId() {
- return redcapId;
- }
-
- public void setRedcapId(String redcapId) {
- this.redcapId = redcapId;
- }
-
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAGeneExpressionExpressionSummaryValue.java
deleted file mode 100755
index 22cd94d3..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAGeneExpressionExpressionSummaryValue.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleNucleus;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-import jakarta.persistence.Transient;
-
-import org.kpmp.FullDataTypeEnum;
-import org.kpmp.geneExpressionSummary.GeneExpressionId;
-import org.kpmp.geneExpressionSummary.GeneExpressionSummary;
-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;
-
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
-
- @Id
- @Column(name = "gene")
- private String gene;
-
- @Column(name = "p_val")
- private Double pVal;
-
- @Column(name = "p_val_adj")
- private Double pValAdj;
-
- @Column(name = "fold_change")
- private Double foldChange;
-
- @Column(name = "pct_1")
- private Double pct1;
-
- @Column(name = "pct_2")
- private Double pct2;
-
- @Column(name = "avg_exp")
- private Double avgExp;
-
- @Id
- @Column(name = "cluster")
- private String cluster;
-
- @Column(name = "cell_type")
- private String cellType;
-
- @Override
- @Transient
- public String getDataType() {
- return FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation();
- }
-
- @Column(name = "cluster_name")
- private String clusterName;
-
- @Column(name = "cell_count")
- private Integer cellCount;
-
- @Override
- @Nullable
- public Integer getId() {
- return id;
- }
-
- @Override
- public void setId(Integer id) {
- this.id = id;
- }
-
- @Override
- @Nullable
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- @Override
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-
- @Override
- @Nullable
- public String getGene() {
- return gene;
- }
-
- @Override
- 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;
- }
-
- @Override
- @Nullable
- public Double getFoldChange() {
- return foldChange;
- }
-
- @Override
- public void setFoldChange(Double foldChange) {
- this.foldChange = foldChange;
- }
-
- @Override
- @Nullable
- public Double getPct1() {
- return pct1;
- }
-
- @Override
- public void setPct1(Double pct1) {
- this.pct1 = pct1;
- }
-
- @Override
- @Nullable
- public Double getPct2() {
- return pct2;
- }
-
- @Override
- public void setPct2(Double pct2) {
- this.pct2 = pct2;
- }
-
- @Override
- @Nullable
- public Double getAvgExp() {
- return avgExp;
- }
-
- @Override
- @Nullable
- public void setAvgExp(Double avgExp) {
- this.avgExp = avgExp;
- }
-
- @Id
- @Override
- public String getCluster() {
- return cluster;
- }
-
- @Override
- public void setCluster(String cluster) {
- this.cluster = cluster;
- }
-
- @Override
- public void setCellCount(Integer cellCount) {
- this.cellCount = cellCount;
- }
-
- @Override
- public Integer getCellCount() {
- return this.cellCount;
- }
-
- @Override
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- @Nullable
- @Override
- public String getClusterName() {
- return this.clusterName;
- }
-
- @Override
- public int hashCode() {
- return (gene + cluster).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
- if (!(obj instanceof SNRNAGeneExpressionExpressionSummaryValue))
- return false;
- SNRNAGeneExpressionExpressionSummaryValue snrnaGeneExpressionExpressionSummaryValue = (SNRNAGeneExpressionExpressionSummaryValue) obj;
- return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene())
- && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster()));
- }
-}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAGeneExpressionSummaryRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAGeneExpressionSummaryRepository.java
deleted file mode 100755
index 66bbc84c..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAGeneExpressionSummaryRepository.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleNucleus;
-
-import java.util.List;
-
-import org.kpmp.geneExpressionSummary.GeneExpressionId;
-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;
-
-@Repository
-public interface SNRNAGeneExpressionSummaryRepository
- extends CrudRepository {
-
- @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.enrollment_category), :enrollmentCategory, snr.enrollment_category) as enrollment_category, 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.enrollment_category = LCASE(:enrollmentCategory) "
- + "WHERE snc.enrollment_category = LCASE(:enrollmentCategory) ORDER BY snr.p_val IS NULL, snr.p_val ASC", nativeQuery = true)
- List findByEnrollmentAndGeneAllClusters(
- @Param("geneSymbol") String geneSymbol, @Param("enrollmentCategory") String enrollmentCategory);
-
- @Cacheable("snCounts")
- @Query(value = "SELECT DISTINCT snr.cluster, c.cluster_name, 0 as cell_count, snr.id, snr.enrollment_category, snr.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_rnaseq snr " + "JOIN cluster c ON snr.cluster = c.abbreviation AND c.cluster_name = :cellType "
- + "WHERE snr.enrollment_category = LCASE(:enrollmentCategory) " + "ORDER BY snr.fold_change DESC", nativeQuery = true)
- List findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(
- @Param("cellType") String cellType, @Param("enrollmentCategory") String enrollmentCategory);
-
- @Cacheable("snCounts")
- @Query(value = "select count(*) from (select p.redcap_id from sn_metadata sn "
- + "join participant p on sn.specimen_id = p.redcap_id "
- + "where p.enrollment_category=:enrollmentCategory group by p.redcap_id) as mycount", nativeQuery = true)
- long getCountByEnrollment(@Param("enrollmentCategory") String enrollmentCategory);
-
- @Cacheable("snCounts")
- @Query(value = "SELECT COUNT(*) FROM sn_rnaseq snr WHERE snr.gene= :gene", nativeQuery = true)
- long getCountByGene(@Param("gene") String gene);
-}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAParticipantRepository.java
deleted file mode 100755
index c2e146ba..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAParticipantRepository.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleNucleus;
-
-import org.kpmp.geneExpressionSummary.ParticipantId;
-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/geneExpressionSummary/singleNucleus/SNRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAParticipantValue.java
deleted file mode 100755
index a478ebdf..00000000
--- a/src/main/java/org/kpmp/geneExpressionSummary/singleNucleus/SNRNAParticipantValue.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.kpmp.geneExpressionSummary.singleNucleus;
-
-import org.kpmp.geneExpressionSummary.Participant;
-import org.kpmp.geneExpressionSummary.ParticipantId;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-
-@Entity
-@Table(name = "sn_participant_tissue_v")
-@IdClass(ParticipantId.class)
-public class SNRNAParticipantValue implements Participant, Serializable {
-
- private static final long serialVersionUID = -2404700991479961255L;
-
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
-
- @Column(name = "redcap_id")
- private String redcapId;
-
- @Override
- @Id
- public String getRedcapId() {
- return redcapId;
- }
-
- @Override
- public void setRedcapId(String redcapId) {
- this.redcapId = redcapId;
- }
-
- @Override
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- @Override
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-}
diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java
deleted file mode 100755
index 20eab4a9..00000000
--- a/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.kpmp.participant;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class ParticipantDataTypeInformation {
-
- private String dataType;
- private Integer count;
- private Boolean isAggregatedData;
-
- public ParticipantDataTypeInformation() {
- // default constructor so spring does not complain
- }
-
- public ParticipantDataTypeInformation(String dataType, Integer count, boolean isAggregatedData) {
- this.dataType = dataType;
- this.count = count;
- this.isAggregatedData = isAggregatedData;
-
- }
-
- public String getDataType() {
- return dataType;
- }
-
- public void setDataType(String dataType) {
- this.dataType = dataType;
- }
-
- public Integer getCount() {
- return count;
- }
-
- public void setCount(Integer count) {
- this.count = count;
- }
-
- public boolean isAggregatedData() {
- return isAggregatedData;
- }
-
- public void setAggregatedData(boolean isAggregatedData) {
- this.isAggregatedData = isAggregatedData;
- }
-
-}
diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java
deleted file mode 100755
index a3c33835..00000000
--- a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.kpmp.participant;
-
-import java.util.List;
-
-import org.springframework.stereotype.Component;
-
-@Component
-public class ParticipantDataTypeSummary {
- private List spatialViewerDataTypes;
- private List explorerDataTypes;
-
- public List getSpatialViewerDataTypes() {
- return spatialViewerDataTypes;
- }
-
- public void setSpatialViewerDataTypes(List spatialViewerDataTypes) {
- this.spatialViewerDataTypes = spatialViewerDataTypes;
- }
-
- public List getExplorerDataTypes() {
- return explorerDataTypes;
- }
-
- public void setExplorerDataTypes(List explorerDataTypes) {
- this.explorerDataTypes = explorerDataTypes;
- }
-}
diff --git a/src/main/java/org/kpmp/participant/ParticipantService.java b/src/main/java/org/kpmp/participant/ParticipantService.java
deleted file mode 100755
index ef53b3e7..00000000
--- a/src/main/java/org/kpmp/participant/ParticipantService.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package org.kpmp.participant;
-
-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.FullDataTypeEnum;
-import org.kpmp.EnrollmentCategoryEnum;
-import org.kpmp.dataSummary.AtlasRepositoryLinkInformation;
-import org.kpmp.dataSummary.DataSummaryRepository;
-import org.kpmp.geneExpressionSummary.regionalProteomics.RPParticipantRepository;
-import org.kpmp.geneExpressionSummary.regionalTranscriptomics.RTParticipantRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-@Service
-public class ParticipantService {
- @Value("${experiment.label.clinicalStudyData}")
- private String CLINICAL_STUDY_DATA;
- @Value("${experiment.label.biomarkers}")
- private String BIOMARKERS;
- @Value("${experiment.category.biomarker}")
- private String BIOMARKER;
-
-
- private ParticipantSummaryDatasetRepository participantSummaryDatasetRepository;
- private DataSummaryRepository dataSummaryRepo;
- private SpatialViewerTypeRepository svTypeRepo;
- private SingleCellMetadataRepository scMetadataRepo;
- private Logger logger = LoggerFactory.getLogger(ParticipantService.class);
-
- private final String SPATIAL_VIEWER_FILE_VIEW = "sv_file_v";
- private final String SPATIAL_VIEWER_LINK_VIEW = "sv_link_v";
- private SingleNucleusMetadataRepository snMetadataRepo;
- private SingleNucleusMetadataRepository2025 snMetadataRepo2025;
- private RTParticipantRepository rtParticipantRepo;
- private ParticipantRepoDataRepository fileByParticipantRepo;
- private RPParticipantRepository rpParticipantRepository;
- private ParticipantClinicalDatasetRepository participantClinicalDatasetRepo;
-
- @Autowired
- public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTypeRepository svTypeRepo,
- SingleCellMetadataRepository scMetadataRepo, SingleNucleusMetadataRepository snMetadataRepo,
- SingleNucleusMetadataRepository2025 snMetadataRepo2025,
- RTParticipantRepository rtParticipantRepo,
- ParticipantSummaryDatasetRepository participantSummaryDatasetRepository, RPParticipantRepository rpParticipantRepository,
- ParticipantRepoDataRepository fileByParticipantRepo, ParticipantClinicalDatasetRepository participantClinicalDatasetRepo) {
- this.dataSummaryRepo = dataSummaryRepo;
- this.svTypeRepo = svTypeRepo;
- this.scMetadataRepo = scMetadataRepo;
- this.snMetadataRepo = snMetadataRepo;
- this.rtParticipantRepo = rtParticipantRepo;
- this.participantSummaryDatasetRepository = participantSummaryDatasetRepository;
- this.rpParticipantRepository = rpParticipantRepository;
- this.fileByParticipantRepo = fileByParticipantRepo;
- this.participantClinicalDatasetRepo = participantClinicalDatasetRepo;
- this.snMetadataRepo2025 = snMetadataRepo2025;
- }
-
- public ParticipantClinicalDataset getParticipantClinicalDataset(String redcapId){
- Integer participantId = participantSummaryDatasetRepository.findIdByRedcapId(redcapId);
- return participantClinicalDatasetRepo.findByParticipantId(participantId);
- }
-
- public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) {
- return participantSummaryDatasetRepository.findByRedcapId(redcapId);
- }
-
- public List getEnrollmentData() {
- List enrollmentData = new ArrayList<>();
-
- enrollmentData.add(new ParticipantEnrollmentCategorySummary(
- participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.AKI.getParticipantEnrollmentCategory()),
- participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.CKD.getParticipantEnrollmentCategory()),
- participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.HEALTHY_REFERENCE.getParticipantEnrollmentCategory()),
- participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.DMR.getParticipantEnrollmentCategory())));
- return enrollmentData;
- }
-
- public ParticipantRepoDataTypeSummary getDataTypeCounts(String redcapId) {
- ParticipantRepoDataTypeSummary summaryData = new ParticipantRepoDataTypeSummary();
- summaryData.setRepositoryDataTypes(getRepositoryCounts(redcapId));
- return summaryData;
- }
-
- public ParticipantDataTypeSummary getExperimentCounts(String redcapId) {
- ParticipantDataTypeSummary summaryData = new ParticipantDataTypeSummary();
- summaryData.setSpatialViewerDataTypes(getSpatialViewerCounts(redcapId));
- summaryData.setExplorerDataTypes(getExplorerCounts(redcapId));
-
- return summaryData;
- }
-
- public ParticipantRepoDataTypeInformation getTotalFilesCount(String redcapId) {
- String participant_id = dataSummaryRepo.getParticipantIDString(redcapId);
- Integer totalCount = dataSummaryRepo.getParticipantTotalFileCount(participant_id);
- AtlasRepositoryLinkInformation linkInfo = new AtlasRepositoryLinkInformation("redcap_id", redcapId);
- ParticipantRepoDataTypeInformation res = new ParticipantRepoDataTypeInformation("", totalCount, linkInfo);
-
- return res;
- }
-
- public List getExperimentalStrategyCountsByParticipant(String redcapId) {
- // this behaves in much the same way as DataSummaryService.getAtlasRepoSummary does to coallate link types together
- // But, the underlying object structure was different enough I couldn't figure out a way to merge them into one implemention
-
- List fileCountsForParticipant = fileByParticipantRepo.findFileCountsByParticipant(redcapId);
- Map resultMap = new HashMap<>();
-
- for (ParticipantRepoData participantRepoData : fileCountsForParticipant) {
- String experimentalStrategy = participantRepoData.getExperimentalStrategy();
- AtlasRepositoryLinkInformation linkInfo = new AtlasRepositoryLinkInformation(AtlasRepositoryLinkInformation.EXPERIMENTAL_STRATEGY, experimentalStrategy);
- if (experimentalStrategy.isEmpty() && participantRepoData.getDataType().equalsIgnoreCase(CLINICAL_STUDY_DATA)) {
- experimentalStrategy = CLINICAL_STUDY_DATA;
- linkInfo = new AtlasRepositoryLinkInformation(AtlasRepositoryLinkInformation.DATA_CATEGORY, participantRepoData.getDataCategory());
- } else if (participantRepoData.getDataCategory().equalsIgnoreCase(BIOMARKER)) {
- experimentalStrategy = BIOMARKERS;
- linkInfo = new AtlasRepositoryLinkInformation(AtlasRepositoryLinkInformation.DATA_CATEGORY, participantRepoData.getDataCategory());
- }
-
- if (resultMap.containsKey(experimentalStrategy)) {
- ParticipantRepoDataTypeInformation existingRecord = resultMap.get(experimentalStrategy);
- existingRecord.setCount(existingRecord.getCount() + participantRepoData.getCount());
- } else {
-
- ParticipantRepoDataTypeInformation dataInformation = new ParticipantRepoDataTypeInformation(experimentalStrategy, participantRepoData.getCount(), linkInfo);
-
- resultMap.put(experimentalStrategy, dataInformation);
- }
-
- }
-
- Collection values = resultMap.values();
- List results = new ArrayList<>(values);
- results.sort(new Comparator() {
- public int compare(ParticipantRepoDataTypeInformation one, ParticipantRepoDataTypeInformation two) {
- return one.getDataType().compareToIgnoreCase(two.getDataType());
- }
- });
-
- return results;
- }
-
- private List getExplorerCounts(String redcapId) {
- List explorerExperiments = new ArrayList<>();
- int scCount = 0;
- if (scMetadataRepo.existsByRedcapId(redcapId)) {
- scCount = 1;
- }
-
- ParticipantDataTypeInformation singleCellData = new ParticipantDataTypeInformation(
- FullDataTypeEnum.SINGLE_CELL.getFullName(), scCount, true);
- explorerExperiments.add(singleCellData);
-
- int snCount = 0;
- if (snMetadataRepo.existsByRedcapId(redcapId)) {
- snCount = 1;
- }
- ParticipantDataTypeInformation singleNucData = new ParticipantDataTypeInformation(
- FullDataTypeEnum.SINGLE_NUCLEUS.getFullName(), snCount, true);
- explorerExperiments.add(singleNucData);
-
- int regionalTranscriptomicsCount = 0;
- if (rtParticipantRepo.existsByRedcapId(redcapId)) {
- regionalTranscriptomicsCount = 1;
- }
- ParticipantDataTypeInformation regionalTranscriptomicsData = new ParticipantDataTypeInformation(
- FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getFullName(), regionalTranscriptomicsCount, true);
- explorerExperiments.add(regionalTranscriptomicsData);
-
- int regionalProteomicsCount = 0;
- if (rpParticipantRepository.existsByRedcapId(redcapId)) {
- regionalProteomicsCount = 1;
- }
- ParticipantDataTypeInformation regionalProteomicsData = new ParticipantDataTypeInformation(
- FullDataTypeEnum.REGIONAL_PROTEOMICS.getFullName(), regionalProteomicsCount, true);
- explorerExperiments.add(regionalProteomicsData);
-
- return explorerExperiments;
- }
-
- private List getSpatialViewerCounts(String redcapId) {
- List spatialViewerExperiments = new ArrayList<>();
-
- List spatialViewerDataTypes = svTypeRepo.findAll();
- for (SpatialViewerDataType spatialViewerDataType : spatialViewerDataTypes) {
- String dataType = spatialViewerDataType.getDataType();
- if (spatialViewerDataType.getTableName().equals(SPATIAL_VIEWER_FILE_VIEW)) {
-
- Integer count = dataSummaryRepo.getParticipantSvFileDataTypeCount(redcapId, dataType);
- ParticipantDataTypeInformation dataTypeInfo = new ParticipantDataTypeInformation(dataType, count,
- false);
- spatialViewerExperiments.add(dataTypeInfo);
- } else if (spatialViewerDataType.getTableName().equals(SPATIAL_VIEWER_LINK_VIEW)) {
- Integer count = dataSummaryRepo.getParticipantSvLinkDataTypeCount(redcapId, dataType);
- ParticipantDataTypeInformation dataTypeInfo = new ParticipantDataTypeInformation(dataType, count,
- false);
- spatialViewerExperiments.add(dataTypeInfo);
- } else {
- logger.error("Unable to query for data type: " + dataType + ". Need to change code to handle.");
- }
- }
- return spatialViewerExperiments;
- }
-
- private List getRepositoryCounts(String redcapId) {
- List repoCounts = new ArrayList<>();
-
- List repoDataTypes = dataSummaryRepo.getRepoDataTypes();
- for (String repoDataType : repoDataTypes) {
- Integer count = dataSummaryRepo.getParticipantRepoFileDataTypeCount(redcapId, repoDataType);
- AtlasRepositoryLinkInformation linkInformation = new AtlasRepositoryLinkInformation("data_type", repoDataType);
- ParticipantRepoDataTypeInformation dataTypeInfo = new ParticipantRepoDataTypeInformation(repoDataType, count, linkInformation);
- repoCounts.add(dataTypeInfo);
- }
- return repoCounts;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/participant/ParticipantService2025.java b/src/main/java/org/kpmp/participant/ParticipantService2025.java
index 733b3364..ca3dd516 100755
--- a/src/main/java/org/kpmp/participant/ParticipantService2025.java
+++ b/src/main/java/org/kpmp/participant/ParticipantService2025.java
@@ -33,7 +33,7 @@ public class ParticipantService2025 {
private DataSummaryRepository dataSummaryRepo;
private SpatialViewerTypeRepository svTypeRepo;
private SingleCellMetadataRepository2025 scMetadataRepo2025;
- private Logger logger = LoggerFactory.getLogger(ParticipantService.class);
+ private Logger logger = LoggerFactory.getLogger(ParticipantService2025.class);
private final String SPATIAL_VIEWER_FILE_VIEW = "sv_file_v";
private final String SPATIAL_VIEWER_LINK_VIEW = "sv_link_v";
diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
deleted file mode 100755
index 4b151c6f..00000000
--- a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.kpmp.participant;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-
-@Entity
-@Table(name = "sn_metadata")
-class SingleNucleusMetadata implements Serializable {
-
- private static final long serialVersionUID = -504357775835334661L;
- @Id
- private String barcode;
- @Column(name = "specimen_id")
- private String redcapId;
-
- public String getBarcode() {
- return barcode;
- }
-
- public void setBarcode(String barcode) {
- this.barcode = barcode;
- }
-
- public String getRedcapId() {
- return redcapId;
- }
-
- public void setRedcapId(String redcapId) {
- this.redcapId = redcapId;
- }
-
-}
diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java
deleted file mode 100755
index fbaad996..00000000
--- a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java
+++ /dev/null
@@ -1,12 +0,0 @@
-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/umap/SCMetadata.java b/src/main/java/org/kpmp/umap/SCMetadata.java
deleted file mode 100755
index 9509b5ea..00000000
--- a/src/main/java/org/kpmp/umap/SCMetadata.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.kpmp.umap;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-import jakarta.persistence.Transient;
-
-@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_name")
- private String clusterName;
- @Column(name = "cluster_color")
- private String clusterColor;
- @Id
- @Column(name = "barcode")
- private String barcode;
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
- @Transient
- private double expressionValue;
-
- @Override
- public double getUmapX() {
- return umapX;
- }
-
- @Override
- public void setUmapX(double umapX) {
- this.umapX = umapX;
- }
-
- @Override
- public double getUmapY() {
- return umapY;
- }
-
- @Override
- public void setUmapY(double umapY) {
- this.umapY = umapY;
- }
-
- @Override
- public String getClusterName() {
- return clusterName;
- }
-
- @Override
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- @Override
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
-
- @Override
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
-
- @Override
- public String getClusterColor() {
- return clusterColor;
- }
-
- @Override
- public void setClusterColor(String clusterColor) {
- this.clusterColor = clusterColor;
- }
-
- @Override
- public double getExpressionValue() {
- return this.expressionValue;
- }
-
- @Override
- public void setExpressionValue(double expressionValue) {
- this.expressionValue = expressionValue;
- }
-
- @Override
- public String getBarcode() {
- return this.barcode;
- }
-
- @Override
- public void setBarcode(String barcode) {
- this.barcode = barcode;
- }
-
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-
-}
diff --git a/src/main/java/org/kpmp/umap/SCMetadataRepository.java b/src/main/java/org/kpmp/umap/SCMetadataRepository.java
deleted file mode 100755
index 7b508e39..00000000
--- a/src/main/java/org/kpmp/umap/SCMetadataRepository.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.kpmp.umap;
-
-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;
-
-public interface SCMetadataRepository extends CrudRepository {
-
- @Cacheable("scMetadataAll")
- @Override
- List findAll();
-
- @Cacheable("scMetadataLimited")
- @Query(value = "SELECT "
- + "umap_x, "
- + "umap_y, "
- + "cluster_abbreviation, "
- + "cluster_name, "
- + "cluster_color, "
- + "barcode, "
- + "enrollment_category "
- + "FROM sc_umap_point_v "
- + "LIMIT :limit", nativeQuery = true)
- List findLimited(@Param("limit") int limit);
-
- @Cacheable("scMetadataCount")
- @Query(value = "SELECT COUNT(umap_x) FROM sc_umap_point_v;", nativeQuery = true)
- int findCount();
-
- List findByEnrollmentCategory(String enrollmentCategory);
-
- SCMetadata findByBarcode(String barcode);
-
- @Cacheable("scMetadataWithEnrollment")
- @Query(value = "SELECT "
- + "umap_x, "
- + "umap_y, "
- + "cluster_abbreviation, "
- + "cluster_name, "
- + "cluster_color, "
- + "barcode, "
- + "enrollment_category "
- + "FROM sc_umap_point_v "
- + "WHERE enrollment_category=:enrollmentCategory "
- + "LIMIT :limit", nativeQuery = true)
- List findLimitedWithEnrollmentCategory(@Param("enrollmentCategory") String enrollmentCategory, @Param("limit") int limit);
-}
diff --git a/src/main/java/org/kpmp/umap/SNMetadata.java b/src/main/java/org/kpmp/umap/SNMetadata.java
deleted file mode 100755
index 6173c4eb..00000000
--- a/src/main/java/org/kpmp/umap/SNMetadata.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.kpmp.umap;
-
-import java.io.Serializable;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-import jakarta.persistence.Transient;
-
-@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;
- @Column(name = "cluster_name")
- private String clusterName;
- @Column(name = "cluster_color")
- private String clusterColor;
- @Id
- @Column(name = "barcode")
- private String barcode;
- @Column(name = "enrollment_category")
- private String enrollmentCategory;
- @Transient
- private double expressionValue;
-
- @Override
- public double getUmapX() {
- return umapX;
- }
-
- @Override
- public void setUmapX(double umapX) {
- this.umapX = umapX;
- }
-
- @Override
- public double getUmapY() {
- return umapY;
- }
-
- @Override
- public void setUmapY(double umapY) {
- this.umapY = umapY;
- }
-
- @Override
- public String getClusterName() {
- return clusterName;
- }
-
- @Override
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- @Override
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
-
- @Override
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
-
- @Override
- public String getClusterColor() {
- return clusterColor;
- }
-
- @Override
- public void setClusterColor(String clusterColor) {
- this.clusterColor = clusterColor;
- }
-
- @Override
- public double getExpressionValue() {
- return this.expressionValue;
- }
-
- @Override
- public void setExpressionValue(double expressionValue) {
- this.expressionValue = expressionValue;
- }
-
- @Override
- public String getBarcode() {
- return this.barcode;
- }
-
- @Override
- public void setBarcode(String barcode) {
- this.barcode = barcode;
- }
-
- public String getEnrollmentCategory() {
- return enrollmentCategory;
- }
-
- public void setEnrollmentCategory(String enrollmentCategory) {
- this.enrollmentCategory = enrollmentCategory;
- }
-
-}
diff --git a/src/main/java/org/kpmp/umap/SNMetadataRepository.java b/src/main/java/org/kpmp/umap/SNMetadataRepository.java
deleted file mode 100755
index 8af9d5a9..00000000
--- a/src/main/java/org/kpmp/umap/SNMetadataRepository.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.kpmp.umap;
-
-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;
-
-interface SNMetadataRepository extends CrudRepository {
-
- @Cacheable("snMetadataAll")
- @Override
- List findAll();
-
- @Cacheable("snMetadataLimited")
- @Query(value = "SELECT "
- + "umap_x, "
- + "umap_y, "
- + "cluster_abbreviation, "
- + "cluster_name, "
- + "cluster_color, "
- + "barcode, "
- + "enrollment_category "
- + "FROM sn_umap_point_v "
- + "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("snMetadataByEnrollment")
- List findByEnrollmentCategory(String enrollmentCategory);
-
- @Cacheable("snMetadataWithEnrollment")
- @Query(value = "SELECT "
- + "umap_x, "
- + "umap_y, "
- + "cluster_abbreviation, "
- + "cluster_name, "
- + "cluster_color, "
- + "barcode, "
- + "enrollment_category "
- + "FROM sn_umap_point_v "
- + "WHERE enrollment_category=:enrollmentCategory "
- + "LIMIT :limit", nativeQuery = true)
- List findLimitedWithEnrollmentCategory(@Param("enrollmentCategory") String enrollmentCategory, @Param("limit") int limit);
-}
diff --git a/src/main/java/org/kpmp/umap/SNMetadataRepository2025.java b/src/main/java/org/kpmp/umap/SNMetadataRepository2025.java
index 14303b37..5054e1f2 100755
--- a/src/main/java/org/kpmp/umap/SNMetadataRepository2025.java
+++ b/src/main/java/org/kpmp/umap/SNMetadataRepository2025.java
@@ -2,7 +2,6 @@
import java.util.List;
-import org.checkerframework.checker.units.qual.C;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
diff --git a/src/main/java/org/kpmp/umap/UmapDataService.java b/src/main/java/org/kpmp/umap/UmapDataService.java
deleted file mode 100755
index 3e531dff..00000000
--- a/src/main/java/org/kpmp/umap/UmapDataService.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.kpmp.umap;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Iterator;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.kpmp.EnrollmentCategoryEnum;
-import org.kpmp.FullDataTypeEnum;
-import org.kpmp.geneExpression.SNSCExpressionDataService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-@Service
-public class UmapDataService {
-
- private SNSCExpressionDataService expressionService;
- private SNMetadataRepository snMetadataRepo;
- private SCMetadataRepository scMetadataRepo;
-
- @Autowired
- public UmapDataService(SCMetadataRepository scMetadataRepo, SNMetadataRepository snMetadataRepo,
- SNSCExpressionDataService expressionService) {
- this.scMetadataRepo = scMetadataRepo;
- this.snMetadataRepo = snMetadataRepo;
- this.expressionService = expressionService;
- }
-
- public PlotData getPlotData(String dataType, String geneSymbol, String requestEnrollmentCategory)
- throws JSONException, Exception {
- JSONObject geneExpressionValues = expressionService.getGeneExpressionValues(dataType, geneSymbol);
- FullDataTypeEnum dataTypeEnum = FullDataTypeEnum.fromAbbreviation(dataType);
- List extends UmapPoint> umapPoints = new ArrayList<>();
- EnrollmentCategoryEnum enrollmentCategory = EnrollmentCategoryEnum.fromRequestType(requestEnrollmentCategory);
-
- umapPoints = getUmapPoints(dataTypeEnum, umapPoints, enrollmentCategory);
-
- Map referenceClusters = new HashMap<>();
- FeatureData featureDataWithExpressionValues = new FeatureData();
- FeatureData featureDataWithNoExpressionValues = new FeatureData();
-
- for (UmapPoint umapPoint : umapPoints) {
- double umapX = umapPoint.getUmapX();
- double umapY = umapPoint.getUmapY();
-
- if (referenceClusters.containsKey(umapPoint.getClusterAbbreviation())) {
- ReferenceCluster referenceCluster = referenceClusters.get(umapPoint.getClusterAbbreviation());
- referenceCluster.addXValue(umapX);
- referenceCluster.addYValue(umapY);
- referenceCluster.setClusterName(umapPoint.getClusterName());
- referenceCluster.setClusterAbbreviation(umapPoint.getClusterAbbreviation());
- } else {
- ReferenceCluster referenceCluster = new ReferenceCluster(umapPoint.getClusterAbbreviation(),
- umapPoint.getClusterColor());
- referenceCluster.addXValue(umapX);
- referenceCluster.addYValue(umapY);
- referenceCluster.setClusterName(umapPoint.getClusterName());
- referenceCluster.setClusterAbbreviation(umapPoint.getClusterAbbreviation());
- referenceClusters.put(umapPoint.getClusterAbbreviation(), referenceCluster);
- }
-
- String barcode = umapPoint.getBarcode();
- if (geneExpressionValues.has(barcode)) {
- Double expressionValue = geneExpressionValues.getDouble(barcode);
- featureDataWithExpressionValues.addXValue(umapX);
- featureDataWithExpressionValues.addYValue(umapY);
- featureDataWithExpressionValues.addExpression(expressionValue);
- featureDataWithExpressionValues.addHoverDisplay(Double.toString(expressionValue) + "
" + umapPoint.getClusterName());
-
- } else {
- featureDataWithNoExpressionValues.addXValue(umapX);
- featureDataWithNoExpressionValues.addYValue(umapY);
- featureDataWithNoExpressionValues.addExpression(0d);
- featureDataWithNoExpressionValues.addHoverDisplay(umapPoint.getClusterName());
- }
- }
-
- if (dataTypeEnum.equals(FullDataTypeEnum.SINGLE_CELL)
- && featureDataWithExpressionValues.getExpression().size() == 0
- && geneExpressionValues.length() <= 200) {
- Iterator keys = geneExpressionValues.keys();
- while(keys.hasNext()) {
- String barcode = keys.next();
- Double expressionValue = geneExpressionValues.getDouble(barcode);
- UmapPoint umapPoint = scMetadataRepo.findByBarcode(barcode);
- featureDataWithExpressionValues.addXValue(umapPoint.getUmapX());
- featureDataWithExpressionValues.addYValue(umapPoint.getUmapY());
- featureDataWithExpressionValues.addExpression(expressionValue);
- featureDataWithExpressionValues.addHoverDisplay(Double.toString(expressionValue) + "
" + umapPoint.getClusterName());
- }
- }
-
- List referenceClusterList = new ArrayList<>(referenceClusters.values());
- return new PlotData(referenceClusterList,
- Arrays.asList(featureDataWithExpressionValues, featureDataWithNoExpressionValues));
- }
-
- private List extends UmapPoint> getUmapPoints(FullDataTypeEnum dataTypeEnum, List extends UmapPoint> umapPoints,
- EnrollmentCategoryEnum enrollmentCategory) {
- if (enrollmentCategory == EnrollmentCategoryEnum.ALL) {
- if (dataTypeEnum.equals(FullDataTypeEnum.SINGLE_CELL)) {
- int pointCount = scMetadataRepo.findCount();
- int limit = (int) Math.round(pointCount*.3);
- umapPoints = scMetadataRepo.findLimited(limit);
- } else if (dataTypeEnum.equals(FullDataTypeEnum.SINGLE_NUCLEUS)) {
- int pointCount = snMetadataRepo.findCount();
- int limit = (int) Math.round(pointCount*.3);
- umapPoints = snMetadataRepo.findLimited(limit);
- }
- } else if (enrollmentCategory != EnrollmentCategoryEnum.UNKNOWN) {
- if (dataTypeEnum.equals(FullDataTypeEnum.SINGLE_CELL)) {
- int pointCount = scMetadataRepo.findCount();
- int limit = (int) Math.round(pointCount*.3);
- umapPoints = scMetadataRepo.findLimitedWithEnrollmentCategory(enrollmentCategory.getParticipantEnrollmentCategory(), limit);
- } else if (dataTypeEnum.equals(FullDataTypeEnum.SINGLE_NUCLEUS)) {
- int pointCount = snMetadataRepo.findCount();
- int limit = (int) Math.round(pointCount*.3);
- umapPoints = snMetadataRepo.findLimitedWithEnrollmentCategory(enrollmentCategory.getParticipantEnrollmentCategory(), limit);
- }
- }
- return umapPoints;
- }
-
-}
diff --git a/src/main/resources/graphql/knowledge_environment.graphqls b/src/main/resources/graphql/knowledge_environment.graphqls
index 7c691a9c..73edc4df 100755
--- a/src/main/resources/graphql/knowledge_environment.graphqls
+++ b/src/main/resources/graphql/knowledge_environment.graphqls
@@ -1,24 +1,17 @@
type Query {
autocomplete(searchTerm: String): [AutoCompleteResult]
- cellTypeHierarchy: CellTypeHierarchy
- cellTypeHierarchy2025: CellTypeHierarchy
- geneExpressionSummary(dataType: String, geneSymbol: String, cellType: String, enrollmentCategory: String) : [GeneExpressionSummary]
+ cellTypeHierarchy2025: CellTypeHierarchy
geneExpressionSummary2025(dataType: String, geneSymbol: String, cellType: String, enrollmentCategory: String) : [GeneExpressionSummary2025]
- getClusterHieararchies(cellType: String!): [ClusterHierarchy]
- getClusterHieararchies2025(cellType: String!): [ClusterHierarchy]
- getUmapPlotData(dataType: String!, geneSymbol: String!, enrollmentCategory: String): PlotData
+ getClusterHieararchies2025(cellType: String!): [ClusterHierarchy]
getUmapPlotData2025(dataType: String!, geneSymbol: String!, enrollmentCategory: String): PlotData2025
- dataTypesForConcept(geneSymbol: String, clusterName: String): [String]
- dataTypesForConcept2025(geneSymbol: String, clusterName: String): [String]
- getDataTypeSummaryInformation: [DataTypeSummaryInformation]
+ dataTypesForConcept2025(geneSymbol: String, clusterName: String): [String]
getDataTypeSummaryInformation2025: [DataTypeSummaryInformation2025]
getRTGeneExpressionByEnrollment(comparisonType: String, geneSymbol: String): RTGeneExpressionByEnrollment
getRPGeneExpressionByEnrollment(geneSymbol: String!): [RPAccessionGroup]
getRPGeneExpressionByEnrollmentAndProtein(geneSymbol: String!, protein: String!): RPExpressionByEnrollmentCategory
getRTGeneExpressionByStructure(structure: String): [RTGeneExpression]
getRPGeneExpressionByStructure(structure: String): [RPGeneExpression]
- getSummaryData: [DataTypeSummaryInformation]
- getDataTypeInformationByParticipant(redcapId: String!): ParticipantDataTypeSummary
+ getSummaryData: [DataTypeSummaryInformation2025]
getDataTypeInformationByParticipant2025(redcapId: String!): ParticipantDataTypeSummary2025
getRepoDataTypeInformationByParticipant(redcapId: String!): ParticipantRepoDataTypeSummary
participantSummaryDataset(redcapId: String!): ParticipantSummaryDataset
@@ -28,6 +21,12 @@ type Query {
getAtlasMessages: [AtlasMessages]
getExperimentalStrategyCountsByParticipant(redcapId: String!): [ParticipantRepoDataTypeInformation]
getParticipantClinicalDataset(redcapId: String!): ParticipantClinicalDataset
+ getHubmapTermMap: [HubmapOntologyCellType]
+}
+
+type HubmapOntologyCellType {
+ hubmapOntologyId: String
+ cellType: String
}
type AtlasMessages {
@@ -65,13 +64,8 @@ type ParticipantEnrollmentCategorySummary {
dmrCount: Int
}
-type ParticipantDataTypeSummary {
- spatialViewerDataTypes: [ParticipantDataTypeInformation]
- explorerDataTypes: [ParticipantDataTypeInformation]
-}
-
type ParticipantDataTypeSummary2025 {
- spatialViewerDataTypes: [ParticipantDataTypeInformation]
+ spatialViewerDataTypes: [ParticipantDataTypeInformation2025]
explorerDataTypes: [ParticipantDataTypeInformation2025]
}
@@ -81,14 +75,8 @@ type ParticipantDataTypeInformation2025 {
isAggregatedData: Boolean
}
-type ParticipantDataTypeInformation {
- dataType: String
- count: Int
- isAggregatedData: Boolean
-}
-
type ParticipantRepoDataTypeSummary {
- repositoryDataTypes: [ParticipantRepoDataTypeInformation]
+ repositoryDataTypes: [ParticipantDataTypeInformation2025]
}
type ParticipantRepoDataTypeInformation {
@@ -109,20 +97,6 @@ type DataTypeSummaryInformation2025 {
participantCount: Int
}
-
-type DataTypeSummaryInformation {
- omicsType: String
- dataType: String
- dataTypeShort: String
- akiCount: Int
- ckdCount: Int
- hrtCount: Int
- dmrCount: Int
- totalCount: Int
- participantCount: Int
-}
-
-
type AutoCompleteResult {
value: String
name: String
@@ -149,22 +123,6 @@ type CellType {
cellType: String
}
-type GeneExpressionSummary {
- id: ID
- enrollmentCategory: String
- gene: String
- pVal: Float
- pValAdj: Float
- foldChange: Float
- pct1: Float
- pct2: Float
- avgExp: Float
- cluster: String
- clusterName: String
- dataType: String
- cellCount: Int
-}
-
type GeneExpressionSummary2025 {
id: ID
enrollmentCategory: String
@@ -192,6 +150,7 @@ type ClusterHierarchy {
isSingleCellCluster: String
isRegionalTranscriptomics: String
isRegionalProteomics: String
+ isSpatialTranscriptomics: String
cellTypeOrder: Float
}
@@ -215,26 +174,6 @@ type ReferenceCluster2025 {
clusterAbbreviation: String
}
-type PlotData {
- referenceData: [ReferenceCluster]
- featureData: [FeatureData]
-}
-
-type FeatureData {
- xValues: [Float]
- yValues: [Float]
- expression: [Float]
- hoverDisplay: [String]
-}
-
-type ReferenceCluster {
- xValues: [Float]
- yValues: [Float]
- color: String
- clusterName: String
- clusterAbbreviation: String
-}
-
type RTGeneExpression {
id: ID
geneSymbol: String
diff --git a/src/test/java/org/kpmp/QueryControllerTest.java b/src/test/java/org/kpmp/QueryControllerTest.java
index a72acf34..f969822f 100755
--- a/src/test/java/org/kpmp/QueryControllerTest.java
+++ b/src/test/java/org/kpmp/QueryControllerTest.java
@@ -14,6 +14,7 @@
import java.util.Arrays;
import java.util.Date;
import java.util.List;
+import java.util.Map;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -22,8 +23,9 @@
import org.kpmp.atlasMessage.AtlasMessageService;
import org.kpmp.autocomplete.AutocompleteResult;
import org.kpmp.autocomplete.AutocompleteService;
-import org.kpmp.cellType.CellTypeHierarchy;
import org.kpmp.cellType.CellTypeService;
+import org.kpmp.cellType.HubmapCellTypeMappingService;
+import org.kpmp.cellType.HubmapOntologyCellType;
import org.kpmp.cellTypeSummary.ClusterHierarchy;
import org.kpmp.cellTypeSummary.ClusterHierarchyService;
import org.kpmp.dataSummary.AtlasRepoSummaryResult;
@@ -34,23 +36,13 @@
import org.kpmp.geneExpression.RTExpressionByEnrollmentCategory;
import org.kpmp.geneExpression.RTExpressionDataAllSegments;
import org.kpmp.geneExpression.RTExpressionDataService;
-import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService;
import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService2025;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionExpressionSummaryValue;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionExpressionSummaryValue;
+import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionExpressionSummaryValue2025;
import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionExpressionSummaryValue2025;
-import org.kpmp.participant.ParticipantClinicalDataset;
-import org.kpmp.participant.ParticipantDataTypeSummary;
-import org.kpmp.participant.ParticipantRepoDataTypeInformation;
-import org.kpmp.participant.ParticipantRepoDataTypeSummary;
-import org.kpmp.participant.ParticipantService;
-import org.kpmp.participant.ParticipantService2025;
-import org.kpmp.participant.ParticipantSummaryDataset;
-import org.kpmp.participant.ParticipantEnrollmentCategorySummary;
+import org.kpmp.participant.*;
import org.kpmp.umap.FeatureData;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.ReferenceCluster;
-import org.kpmp.umap.UmapDataService;
import org.kpmp.umap.UmapDataService2025;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -63,21 +55,17 @@ public class QueryControllerTest {
@Mock
private AutocompleteService autocompleteService;
@Mock
- private GeneExpressionSummaryService geneExpressionService;
- @Mock
private GeneExpressionSummaryService2025 geneExpressionService2025;
@Mock
private DataSummaryService dataSummaryService;
private QueryController query;
@Mock
- private UmapDataService umapDataService;
+ private UmapDataService2025 umapDataService;
@Mock
private ClusterHierarchyService clusterHierarchyService;
@Mock
private RTExpressionDataService rtExpressionDataService;
@Mock
- private ParticipantService participantService;
- @Mock
private ParticipantEnrollmentCategorySummary participantEnrollmentCategorySummary;
@Mock
private AtlasMessageService atlasMessageService;
@@ -89,13 +77,15 @@ public class QueryControllerTest {
private UmapDataService2025 umapDataService2025;
@Mock ParticipantService2025 participantService2025;
+ @Mock
+ HubmapCellTypeMappingService hubmapCellTypeMappingService;
@BeforeEach
public void setUp() throws Exception {
MockitoAnnotations.openMocks(this);
- query = new QueryController(autocompleteService, cellTypeService, umapDataService, umapDataService2025, geneExpressionService,
+ query = new QueryController(autocompleteService, cellTypeService, umapDataService2025,
geneExpressionService2025, dataSummaryService, clusterHierarchyService, rtExpressionDataService, rpExpressionDataService,
- participantService, participantService2025, atlasMessageService);
+ participantService2025, atlasMessageService, hubmapCellTypeMappingService);
}
@AfterEach
@@ -132,50 +122,12 @@ public void testAutocomplete() throws Exception {
assertEquals(expectedResults, query.autocomplete("autocomplete"));
}
- @Test
- public void testGetCellTypeHierarchy() throws Exception {
- CellTypeHierarchy expectedResult = new CellTypeHierarchy();
- when(cellTypeService.getCellTypeHierarchy()).thenReturn(expectedResult);
-
- assertEquals(expectedResult, query.cellTypeHierarchy());
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Test
- public void geneExpression() throws Exception {
- List expectedResultSN1 = Arrays.asList(new SNRNAGeneExpressionExpressionSummaryValue());
- List expectedResultSN2 = Arrays.asList(new SNRNAGeneExpressionExpressionSummaryValue());
- List expectedResultSN3 = Arrays.asList(new SNRNAGeneExpressionExpressionSummaryValue());
- List expectedResultSN4 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue());
- when(geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sn", "gene", "aki")).thenReturn(expectedResultSN1);
- when(geneExpressionService.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sn", "cell type", "aki"))
- .thenReturn(expectedResultSN2);
-
- when(geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sn", "gene", "aki")).thenReturn(expectedResultSN3);
- when(geneExpressionService.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sn", "cell type", "aki"))
- .thenReturn(expectedResultSN4);
-
- List expectedResultSC1 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue());
- List expectedResultSC2 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue());
- when(geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sc", "gene", "aki")).thenReturn(expectedResultSC1);
- when(geneExpressionService.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sc", "cell type", "aki"))
- .thenReturn(expectedResultSC2);
-
- assertEquals(expectedResultSN1, query.geneExpressionSummary("sn", "gene", "", "aki"));
- assertEquals(expectedResultSC1, query.geneExpressionSummary("sc", "gene", "", "aki"));
-
- assertEquals(expectedResultSN2, query.geneExpressionSummary("sn", "", "cell type", "aki"));
- assertEquals(expectedResultSC2, query.geneExpressionSummary("sc", "", "cell type", "aki"));
-
- assertEquals(expectedResultSN2, query.geneExpressionSummary("sn", "", "cell type", "aki"));
- }
-
@Test
public void geneExpression2025() throws Exception {
List expectedResultSN1 = Arrays.asList(new SNRNAGeneExpressionExpressionSummaryValue2025());
List expectedResultSN2 = Arrays.asList(new SNRNAGeneExpressionExpressionSummaryValue2025());
List expectedResultSN3 = Arrays.asList(new SNRNAGeneExpressionExpressionSummaryValue2025());
- List expectedResultSN4 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue());
+ List expectedResultSN4 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue2025());
when(geneExpressionService2025.getByDataTypeEnrollmentCategoryAndGene("sn", "gene", "aki")).thenReturn(expectedResultSN1);
when(geneExpressionService2025.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sn", "cell type", "aki"))
.thenReturn(expectedResultSN2);
@@ -184,38 +136,19 @@ public void geneExpression2025() throws Exception {
when(geneExpressionService2025.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sn", "cell type", "aki"))
.thenReturn(expectedResultSN4);
- List expectedResultSC1 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue());
- List expectedResultSC2 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue());
+ List expectedResultSC1 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue2025());
+ List expectedResultSC2 = Arrays.asList(new SCRNAGeneExpressionExpressionSummaryValue2025());
when(geneExpressionService2025.getByDataTypeEnrollmentCategoryAndGene("sc", "gene", "aki")).thenReturn(expectedResultSC1);
when(geneExpressionService2025.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sc", "cell type", "aki"))
.thenReturn(expectedResultSC2);
- assertEquals(expectedResultSN1, query.geneExpressionSummary("sn", "gene", "", "aki"));
- assertEquals(expectedResultSC1, query.geneExpressionSummary("sc", "gene", "", "aki"));
+ assertEquals(expectedResultSN1, query.geneExpressionSummary2025("sn", "gene", "", "aki"));
+ assertEquals(expectedResultSC1, query.geneExpressionSummary2025("sc", "gene", "", "aki"));
- assertEquals(expectedResultSN2, query.geneExpressionSummary("sn", "", "cell type", "aki"));
- assertEquals(expectedResultSC2, query.geneExpressionSummary("sc", "", "cell type", "aki"));
+ assertEquals(expectedResultSN2, query.geneExpressionSummary2025("sn", "", "cell type", "aki"));
+ assertEquals(expectedResultSC2, query.geneExpressionSummary2025("sc", "", "cell type", "aki"));
- assertEquals(expectedResultSN2, query.geneExpressionSummary("sn", "", "cell type", "aki"));
- }
-
- @Test
- public void testGetUmapPlotData() throws Exception {
- List featureData = new ArrayList<>();
- List referenceData = new ArrayList<>();
- PlotData expectedPlotData1 = new PlotData(referenceData, featureData);
- PlotData expectedPlotData2 = new PlotData(referenceData, featureData);
- when(umapDataService.getPlotData("sn", "gene", "all")).thenReturn(expectedPlotData1);
- when(umapDataService.getPlotData("sn", "gene", "all")).thenReturn(expectedPlotData2);
-
- PlotData umapPlotData1 = query.getUmapPlotData("sn", "gene", "all");
- PlotData umapPlotData2 = query.getUmapPlotData("sn", "gene", "all");
-
- assertEquals(expectedPlotData1, umapPlotData1);
- verify(umapDataService).getPlotData("sn", "gene", "all");
-
- assertEquals(expectedPlotData2, umapPlotData2);
- verify(umapDataService).getPlotData("sn", "gene", "all");
+ assertEquals(expectedResultSN2, query.geneExpressionSummary2025("sn", "", "cell type", "aki"));
}
@Test
@@ -240,42 +173,42 @@ public void testGetUmapPlotData2025() throws Exception {
@Test
public void testGetClusterHierarchies() throws Exception {
List expectedList = Arrays.asList(new ClusterHierarchy());
- when(clusterHierarchyService.findClustersByCellType("cell type")).thenReturn(expectedList);
+ when(clusterHierarchyService.findClustersByCellType2025("cell type")).thenReturn(expectedList);
- assertEquals(expectedList, query.getClusterHieararchies("cell type"));
- verify(clusterHierarchyService).findClustersByCellType("cell type");
+ assertEquals(expectedList, query.getClusterHieararchies2025("cell type"));
+ verify(clusterHierarchyService).findClustersByCellType2025("cell type");
}
@Test
public void dataTypesForConceptWhenGeneSymbolAndNullClusterName() throws Exception {
List expectedResult1 = Arrays.asList("1", "2");
List expectedResult2 = Arrays.asList("3", "4");
- when(geneExpressionService.findDataTypesByGene("gene")).thenReturn(expectedResult1);
+ when(geneExpressionService2025.findDataTypesByGene("gene")).thenReturn(expectedResult1);
- List dataTypesForConcept1 = query.dataTypesForConcept("gene", null);
- List dataTypesForConcept2 = query.dataTypesForConcept("gene", null);
+ List dataTypesForConcept1 = query.dataTypesForConcept2025("gene", null);
+ List dataTypesForConcept2 = query.dataTypesForConcept2025("gene", null);
assertEquals(expectedResult1, dataTypesForConcept1);
- verify(clusterHierarchyService, times(0)).findDataTypesByClusterName(any(String.class));
+ verify(clusterHierarchyService, times(0)).findDataTypesByClusterName2025(any(String.class));
assertEquals(expectedResult2, dataTypesForConcept2);
- verify(clusterHierarchyService, times(0)).findDataTypesByClusterName(any(String.class));
+ verify(clusterHierarchyService, times(0)).findDataTypesByClusterName2025(any(String.class));
}
@Test
public void dataTypesForConceptWhenGeneSymbolAndBlankClusterName() throws Exception {
List expectedResult1 = Arrays.asList("1", "2");
List expectedResult2 = Arrays.asList("3", "4");
- when(geneExpressionService.findDataTypesByGene("gene")).thenReturn(expectedResult1);
- when(geneExpressionService.findDataTypesByGene("gene")).thenReturn(expectedResult2);
+ when(geneExpressionService2025.findDataTypesByGene("gene")).thenReturn(expectedResult1);
+ when(geneExpressionService2025.findDataTypesByGene("gene")).thenReturn(expectedResult2);
- List dataTypesForConcept1 = query.dataTypesForConcept("gene", "");
- List dataTypesForConcept2 = query.dataTypesForConcept("gene", "");
+ List dataTypesForConcept1 = query.dataTypesForConcept2025("gene", "");
+ List dataTypesForConcept2 = query.dataTypesForConcept2025("gene", "");
assertEquals(expectedResult1, dataTypesForConcept1);
- verify(clusterHierarchyService, times(0)).findDataTypesByClusterName(any(String.class));
+ verify(clusterHierarchyService, times(0)).findDataTypesByClusterName2025(any(String.class));
assertEquals(expectedResult2, dataTypesForConcept2);
- verify(clusterHierarchyService, times(0)).findDataTypesByClusterName(any(String.class));
+ verify(clusterHierarchyService, times(0)).findDataTypesByClusterName2025(any(String.class));
}
@@ -283,33 +216,33 @@ public void dataTypesForConceptWhenGeneSymbolAndBlankClusterName() throws Except
public void dataTypesForConceptWhenClusterNameAndNullGene() throws Exception {
List expectedResult1 = Arrays.asList("1", "2");
List expectedResult2 = Arrays.asList("3", "4");
- when(clusterHierarchyService.findDataTypesByClusterName("cluster")).thenReturn(expectedResult1);
- when(clusterHierarchyService.findDataTypesByClusterName("cluster")).thenReturn(expectedResult2);
+ when(clusterHierarchyService.findDataTypesByClusterName2025("cluster")).thenReturn(expectedResult1);
+ when(clusterHierarchyService.findDataTypesByClusterName2025("cluster")).thenReturn(expectedResult2);
- List dataTypesForConcept1 = query.dataTypesForConcept(null, "cluster");
- List dataTypesForConcept2 = query.dataTypesForConcept(null, "cluster");
+ List dataTypesForConcept1 = query.dataTypesForConcept2025(null, "cluster");
+ List dataTypesForConcept2 = query.dataTypesForConcept2025(null, "cluster");
assertEquals(expectedResult1, dataTypesForConcept1);
- verify(geneExpressionService, times(0)).findDataTypesByGene(any(String.class));
+ verify(geneExpressionService2025, times(0)).findDataTypesByGene(any(String.class));
assertEquals(expectedResult2, dataTypesForConcept2);
- verify(geneExpressionService, times(0)).findDataTypesByGene(any(String.class));
+ verify(geneExpressionService2025, times(0)).findDataTypesByGene(any(String.class));
}
@Test
public void dataTypesForConceptWhenClusterNameAndBlankGene() throws Exception {
List expectedResult1 = Arrays.asList("1", "2");
List expectedResult2 = Arrays.asList("3", "4");
- when(clusterHierarchyService.findDataTypesByClusterName("cluster")).thenReturn(expectedResult1);
- when(clusterHierarchyService.findDataTypesByClusterName("cluster")).thenReturn(expectedResult2);
+ when(clusterHierarchyService.findDataTypesByClusterName2025("cluster")).thenReturn(expectedResult1);
+ when(clusterHierarchyService.findDataTypesByClusterName2025("cluster")).thenReturn(expectedResult2);
- List dataTypesForConcept1 = query.dataTypesForConcept("", "cluster");
- List dataTypesForConcept2 = query.dataTypesForConcept("", "cluster");
+ List dataTypesForConcept1 = query.dataTypesForConcept2025("", "cluster");
+ List dataTypesForConcept2 = query.dataTypesForConcept2025("", "cluster");
assertEquals(expectedResult1, dataTypesForConcept1);
- verify(geneExpressionService, times(0)).findDataTypesByGene(any(String.class));
+ verify(geneExpressionService2025, times(0)).findDataTypesByGene(any(String.class));
assertEquals(expectedResult2, dataTypesForConcept2);
- verify(geneExpressionService, times(0)).findDataTypesByGene(any(String.class));
+ verify(geneExpressionService2025, times(0)).findDataTypesByGene(any(String.class));
}
@Test
@@ -323,7 +256,7 @@ public void getGeneDatasetInformation() throws Exception {
expectedResult1.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.SINGLE_NUCLEUS.getFullName(), FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(),
Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0)));
- when(geneExpressionService.getDataTypeSummaryInformation()).thenReturn(expectedResult1);
+ when(geneExpressionService2025.getDataTypeSummaryInformation()).thenReturn(expectedResult1);
expectedResult2.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
FullDataTypeEnum.SINGLE_CELL.getFullName(), FullDataTypeEnum.SINGLE_CELL.getAbbreviation(),
@@ -331,10 +264,10 @@ public void getGeneDatasetInformation() throws Exception {
expectedResult2.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.SINGLE_NUCLEUS.getFullName(), FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(),
Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0)));
- when(geneExpressionService.getDataTypeSummaryInformation()).thenReturn(expectedResult2);
+ when(geneExpressionService2025.getDataTypeSummaryInformation()).thenReturn(expectedResult2);
- List datasetSummary1 = query.getDataTypeSummaryInformation();
- List datasetSummary2 = query.getDataTypeSummaryInformation();
+ List datasetSummary1 = query.getDataTypeSummaryInformation2025();
+ List datasetSummary2 = query.getDataTypeSummaryInformation2025();
assertEquals(expectedResult1, datasetSummary1);
assertEquals(expectedResult2, datasetSummary2);
@@ -371,13 +304,13 @@ public void testGetRPGeneExpressionByEnrollmentAndProtein() throws Exception {
@Test
public void testGetDataTypeInformationByParticipant() throws Exception {
- ParticipantDataTypeSummary expected1 = mock(ParticipantDataTypeSummary.class);
- ParticipantDataTypeSummary expected2 = mock(ParticipantDataTypeSummary.class);
- when(participantService.getExperimentCounts("123")).thenReturn(expected1);
- when(participantService.getExperimentCounts("123")).thenReturn(expected2);
+ ParticipantDataTypeSummary2025 expected1 = mock(ParticipantDataTypeSummary2025.class);
+ ParticipantDataTypeSummary2025 expected2 = mock(ParticipantDataTypeSummary2025.class);
+ when(participantService2025.getExperimentCounts("123")).thenReturn(expected1);
+ when(participantService2025.getExperimentCounts("123")).thenReturn(expected2);
- ParticipantDataTypeSummary result1 = query.getDataTypeInformationByParticipant("123");
- ParticipantDataTypeSummary result2 = query.getDataTypeInformationByParticipant("123");
+ ParticipantDataTypeSummary2025 result1 = query.getDataTypeInformationByParticipant2025("123");
+ ParticipantDataTypeSummary2025 result2 = query.getDataTypeInformationByParticipant2025("123");
assertEquals(expected1, result1);
assertEquals(expected2, result2);
@@ -387,7 +320,7 @@ public void testGetDataTypeInformationByParticipant() throws Exception {
@Test
public void testGetRepoDataTypeInformationByParticipant() throws Exception {
ParticipantRepoDataTypeSummary expected = mock(ParticipantRepoDataTypeSummary.class);
- when(participantService.getDataTypeCounts("123")).thenReturn(expected);
+ when(participantService2025.getDataTypeCounts("123")).thenReturn(expected);
ParticipantRepoDataTypeSummary result = query.getRepoDataTypeInformationByParticipant("123");
@@ -398,19 +331,19 @@ public void testGetRepoDataTypeInformationByParticipant() throws Exception {
@Test
public void testGetParticipantClincialDataset() throws Exception {
ParticipantClinicalDataset expected = new ParticipantClinicalDataset();
- when(participantService.getParticipantClinicalDataset("participant_id")).thenReturn(expected);
+ when(participantService2025.getParticipantClinicalDataset("participant_id")).thenReturn(expected);
assertEquals(expected, query.getParticipantClinicalDataset("participant_id"));
- verify(participantService).getParticipantClinicalDataset("participant_id");
+ verify(participantService2025).getParticipantClinicalDataset("participant_id");
}
@Test
public void testParticipantSummaryDataset() throws Exception {
ParticipantSummaryDataset expected = new ParticipantSummaryDataset();
- when(participantService.getParticipantSummaryDataset("participant_id")).thenReturn(expected);
+ when(participantService2025.getParticipantSummaryDataset("participant_id")).thenReturn(expected);
assertEquals(expected, query.participantSummaryDataset("participant_id"));
- verify(participantService).getParticipantSummaryDataset("participant_id");
+ verify(participantService2025).getParticipantSummaryDataset("participant_id");
}
@Test
@@ -446,10 +379,27 @@ public void testGetAtlasMessage() throws Exception {
@Test
public void testGetExperimentalStrategyCountsByParticipant() {
List expectedResults = new ArrayList<>();
- when(participantService.getExperimentalStrategyCountsByParticipant("redcapId")).thenReturn(expectedResults);
+ when(participantService2025.getExperimentalStrategyCountsByParticipant("redcapId")).thenReturn(expectedResults);
List result = query.getExperimentalStrategyCountsByParticipant("redcapId");
assertEquals(expectedResults, result);
}
+ @Test
+ public void testGetHubmapTermMap() {
+ HubmapOntologyCellType cellType1 = mock(HubmapOntologyCellType.class);
+ when(cellType1.getHubmapOntologyId()).thenReturn("HUBMAP:001");
+ when(cellType1.getCellType()).thenReturn("Podocyte");
+
+ HubmapOntologyCellType cellType2 = mock(HubmapOntologyCellType.class);
+ when(cellType2.getHubmapOntologyId()).thenReturn("HUBMAP:002");
+ when(cellType2.getCellType()).thenReturn("Tubule cell");
+
+ List expectedList = Arrays.asList(cellType1, cellType2);
+ when(hubmapCellTypeMappingService.buildHubmapIdToCellTypeMap()).thenReturn(expectedList);
+
+ List result = query.getHubmapTermMap();
+ assertEquals(expectedList, result);
+ verify(hubmapCellTypeMappingService).buildHubmapIdToCellTypeMap();
+ }
}
\ No newline at end of file
diff --git a/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java b/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java
index 26b2b47c..1208996e 100755
--- a/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java
+++ b/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java
@@ -31,28 +31,6 @@ public void tearDown() throws Exception {
cellTypeRepo = null;
}
- @Test
- public void testGetCellTypeHierarchy() {
- ArrayList cellTypes = new ArrayList();
- CellType cellType1 = new CellType();
- cellType1.setCellType("cell type 1");
- cellType1.setStructureSubregion("subregion 1");
- cellType1.setStructureRegion("region 1");
- cellTypes.add(cellType1);
- when(cellTypeRepo.findAllByCellTypeIsNotNullOrderByCellTypeOrdering()).thenReturn(cellTypes);
-
- CellTypeHierarchy cellTypeHierarchy = service.getCellTypeHierarchy();
-
- assertEquals(1, cellTypeHierarchy.getCellTypeRegions().size());
- CellTypeStructureRegion region = cellTypeHierarchy.getCellTypeRegions().get(0);
- assertEquals("region 1", region.getRegionName());
- assertEquals(1, region.getCellTypeSubregions().size());
- CellTypeStructureSubregion subregion = region.getCellTypeSubregions().get(0);
- assertEquals("subregion 1", subregion.getSubregionName());
- assertEquals(1, subregion.getCellTypes().size());
- assertEquals("cell type 1", subregion.getCellTypes().get(0).getCellType());
- }
-
@Test
public void testGetCellTypeHierarchy2025() {
ArrayList cellTypes = new ArrayList();
diff --git a/src/test/java/org/kpmp/cellType/HubmapCellTypeMappingServiceTest.java b/src/test/java/org/kpmp/cellType/HubmapCellTypeMappingServiceTest.java
new file mode 100644
index 00000000..b96c56c6
--- /dev/null
+++ b/src/test/java/org/kpmp/cellType/HubmapCellTypeMappingServiceTest.java
@@ -0,0 +1,46 @@
+package org.kpmp.cellType;
+
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+import java.util.*;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+class HubmapCellTypeMappingServiceTest {
+ private HubmapOnotologyCellTypeRepository repo;
+ private HubmapCellTypeMappingService service;
+
+ @BeforeEach
+ void setUp() {
+ repo = mock(HubmapOnotologyCellTypeRepository.class);
+ service = new HubmapCellTypeMappingService(repo);
+ }
+
+ @Test
+ void testBuildHubmapIdToCellTypeMap_returnsCorrectList() {
+ HubmapOntologyCellType cellType1 = mock(HubmapOntologyCellType.class);
+ when(cellType1.getHubmapOntologyId()).thenReturn("HUBMAP:001");
+ when(cellType1.getCellType()).thenReturn("Podocyte");
+
+ HubmapOntologyCellType cellType2 = mock(HubmapOntologyCellType.class);
+ when(cellType2.getHubmapOntologyId()).thenReturn("HUBMAP:002");
+ when(cellType2.getCellType()).thenReturn("Tubule cell");
+
+ List cellTypes = Arrays.asList(cellType1, cellType2);
+ when(repo.findAll()).thenReturn(cellTypes);
+
+ List result = service.buildHubmapIdToCellTypeMap();
+ assertEquals(2, result.size());
+ assertTrue(result.contains(cellType1));
+ assertTrue(result.contains(cellType2));
+ }
+
+ @Test
+ void testBuildHubmapIdToCellTypeMap_emptyListReturnsEmptyList() {
+ when(repo.findAll()).thenReturn(Collections.emptyList());
+ List result = service.buildHubmapIdToCellTypeMap();
+ assertTrue(result.isEmpty());
+ }
+}
diff --git a/src/test/java/org/kpmp/cellType/HubmapOntologyCellTypeTest.java b/src/test/java/org/kpmp/cellType/HubmapOntologyCellTypeTest.java
new file mode 100644
index 00000000..5605fd83
--- /dev/null
+++ b/src/test/java/org/kpmp/cellType/HubmapOntologyCellTypeTest.java
@@ -0,0 +1,24 @@
+package org.kpmp.cellType;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.junit.jupiter.api.Test;
+
+class HubmapOntologyCellTypeTest {
+ @Test
+ void testGettersAndSetters() {
+ HubmapOntologyCellType cellType = new HubmapOntologyCellType();
+ cellType.setHubmapOntologyId("HUBMAP:123");
+ cellType.setCellType("Podocyte");
+
+ assertEquals("HUBMAP:123", cellType.getHubmapOntologyId());
+ assertEquals("Podocyte", cellType.getCellType());
+ }
+
+ @Test
+ void testDefaultValues() {
+ HubmapOntologyCellType cellType = new HubmapOntologyCellType();
+ assertNull(cellType.getHubmapOntologyId());
+ assertNull(cellType.getCellType());
+ }
+}
diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java
index 37d8c396..b71878c7 100755
--- a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java
+++ b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java
@@ -33,187 +33,6 @@ public void tearDown() throws Exception {
service = null;
}
- @Test
- public void testFindClustersByCellType() {
- List hierarchies = Arrays.asList(new ClusterHierarchy());
- when(clusterHierarchyRepo.findByCellType("cell type")).thenReturn(hierarchies);
-
- assertEquals(hierarchies, service.findClustersByCellType("cell type"));
- }
-
- @Test
- public void testFindClustersByCellType_remvoesDups() {
- ClusterHierarchy clusterHierarchy1 = new ClusterHierarchy();
- clusterHierarchy1.setCellType("celltype");
- clusterHierarchy1.setClusterName("cluster");
- ClusterHierarchy clusterHierarchy2 = new ClusterHierarchy();
- clusterHierarchy2.setCellType("cluster");
- clusterHierarchy2.setClusterName("cluster");
- List hierarchies = Arrays.asList(clusterHierarchy1, clusterHierarchy2);
-
- when(clusterHierarchyRepo.findByCellType("cell type")).thenReturn(hierarchies);
-
- assertEquals(Arrays.asList(clusterHierarchy2), service.findClustersByCellType("cell type"));
- }
-
- @Test
- public void testFindClustersByCellType_remvoesDupsUnlessNull() {
- ClusterHierarchy clusterHierarchy1 = new ClusterHierarchy();
- clusterHierarchy1.setCellType("celltype");
- clusterHierarchy1.setClusterName(null);
- clusterHierarchy1.setCellTypeOrder(3.2);
- ClusterHierarchy clusterHierarchy2 = new ClusterHierarchy();
- clusterHierarchy2.setCellType("cluster");
- clusterHierarchy2.setClusterName(null);
- clusterHierarchy2.setCellTypeOrder(2.0);
- List hierarchies = Arrays.asList(clusterHierarchy1, clusterHierarchy2);
- when(clusterHierarchyRepo.findByCellType("cell type")).thenReturn(hierarchies);
- List expected = Arrays.asList(clusterHierarchy1, clusterHierarchy2);
-
- List result = service.findClustersByCellType("cell type");
-
- assertEquals(expected.size(), result.size());
- assertEquals(true, result.containsAll(expected));
- }
-
- @Test
- public void testFindClustersByCellType_sorts() {
- ClusterHierarchy clusterHierarchy1 = new ClusterHierarchy();
- clusterHierarchy1.setCellType("celltype");
- clusterHierarchy1.setStructureSubregion("second region");
- clusterHierarchy1.setClusterName("cluster");
- clusterHierarchy1.setCellTypeOrder(5.0);
- ClusterHierarchy clusterHierarchy2 = new ClusterHierarchy();
- clusterHierarchy2.setCellType("cluster");
- clusterHierarchy2.setClusterName("another cluster");
- clusterHierarchy2.setStructureSubregion("first region");
- clusterHierarchy2.setCellTypeOrder(1.0);
-
- List hierarchies = Arrays.asList(clusterHierarchy1, clusterHierarchy2);
-
- when(clusterHierarchyRepo.findByCellType("cell type")).thenReturn(hierarchies);
-
- assertEquals(Arrays.asList(clusterHierarchy2, clusterHierarchy1), service.findClustersByCellType("cell type"));
- }
-
- @Test
- public void testFindDataTypesByClusterNameWhenBothY() throws Exception {
- ClusterHierarchy clusterHierarchy = new ClusterHierarchy();
- clusterHierarchy.setIsSingleCellCluster("Y");
- clusterHierarchy.setIsSingleNucCluster("Y");
- clusterHierarchy.setIsRegionalTranscriptomics("N");
- clusterHierarchy.setIsRegionalProteomics("N");
- when(clusterHierarchyRepo.findFirstByClusterOrRegion("cluster")).thenReturn(clusterHierarchy);
-
- List dataTypes = service.findDataTypesByClusterName("cluster");
-
- assertEquals(2, dataTypes.size());
- assertEquals(Arrays.asList(FullDataTypeEnum.SINGLE_CELL.getAbbreviation(),
- FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation()), dataTypes);
- verify(clusterHierarchyRepo).findFirstByClusterOrRegion("cluster");
- }
-
- @Test
- public void testFindDataTypesByClusterNameWhenSingleCellY() throws Exception {
- ClusterHierarchy clusterHierarchy = new ClusterHierarchy();
- clusterHierarchy.setIsSingleCellCluster("Y");
- clusterHierarchy.setIsSingleNucCluster("N");
- clusterHierarchy.setIsRegionalTranscriptomics("N");
- clusterHierarchy.setIsRegionalProteomics("N");
- when(clusterHierarchyRepo.findFirstByClusterOrRegion("cluster")).thenReturn(clusterHierarchy);
-
- List dataTypes = service.findDataTypesByClusterName("cluster");
-
- assertEquals(1, dataTypes.size());
- assertEquals(Arrays.asList(FullDataTypeEnum.SINGLE_CELL.getAbbreviation()), dataTypes);
- verify(clusterHierarchyRepo).findFirstByClusterOrRegion("cluster");
- }
-
- @Test
- public void testFindDataTypesByClusterNameWhenSingleNucY() throws Exception {
- ClusterHierarchy clusterHierarchy = new ClusterHierarchy();
- clusterHierarchy.setIsSingleCellCluster("N");
- clusterHierarchy.setIsSingleNucCluster("y");
- clusterHierarchy.setIsRegionalTranscriptomics("N");
- clusterHierarchy.setIsRegionalProteomics("N");
- when(clusterHierarchyRepo.findFirstByClusterOrRegion("cluster")).thenReturn(clusterHierarchy);
-
- List dataTypes = service.findDataTypesByClusterName("cluster");
-
- assertEquals(1, dataTypes.size());
- assertEquals(Arrays.asList(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation()), dataTypes);
- verify(clusterHierarchyRepo).findFirstByClusterOrRegion("cluster");
- }
-
- @Test
- public void testFindDataTypesByClusterNameWhenNeitherY() throws Exception {
- ClusterHierarchy clusterHierarchy = new ClusterHierarchy();
- clusterHierarchy.setIsSingleCellCluster("N");
- clusterHierarchy.setIsSingleNucCluster("N");
- clusterHierarchy.setIsRegionalTranscriptomics("N");
- clusterHierarchy.setIsRegionalProteomics("N");
- when(clusterHierarchyRepo.findFirstByClusterOrRegion("cluster")).thenReturn(clusterHierarchy);
-
- List dataTypes = service.findDataTypesByClusterName("cluster");
-
- assertEquals(0, dataTypes.size());
- verify(clusterHierarchyRepo).findFirstByClusterOrRegion("cluster");
- }
-
- @Test
- public void testFindDataTypesByClusterNameWhenRTY() throws Exception {
- ClusterHierarchy clusterHierarchy = new ClusterHierarchy();
- clusterHierarchy.setIsSingleCellCluster("N");
- clusterHierarchy.setIsSingleNucCluster("N");
- clusterHierarchy.setIsRegionalTranscriptomics("Y");
- clusterHierarchy.setIsRegionalProteomics("N");
- when(clusterHierarchyRepo.findFirstByClusterOrRegion("cluster")).thenReturn(clusterHierarchy);
-
- List dataTypes = service.findDataTypesByClusterName("cluster");
-
- assertEquals(1, dataTypes.size());
- verify(clusterHierarchyRepo).findFirstByClusterOrRegion("cluster");
- }
-
-
- @Test
- public void testFindDataTypesByClusterNameWhenRPY() throws Exception {
- ClusterHierarchy clusterHierarchy = new ClusterHierarchy();
- clusterHierarchy.setIsSingleCellCluster("N");
- clusterHierarchy.setIsSingleNucCluster("N");
- clusterHierarchy.setIsRegionalTranscriptomics("N");
- clusterHierarchy.setIsRegionalProteomics("Y");
- when(clusterHierarchyRepo.findFirstByClusterOrRegion("cluster")).thenReturn(clusterHierarchy);
-
- List dataTypes = service.findDataTypesByClusterName("cluster");
-
- assertEquals(1, dataTypes.size());
- assertEquals(Arrays.asList("rp"), dataTypes);
- verify(clusterHierarchyRepo).findFirstByClusterOrRegion("cluster");
- }
-
- @Test
- public void testFindClustersByCellTypeTubulesOrInterstitium() throws Exception {
- List clusterHierarchies = new ArrayList<>();
- when(clusterHierarchyRepo.findByCellType("Tubules")).thenReturn(clusterHierarchies);
- when(clusterHierarchyRepo.findByCellType("Interstitium")).thenReturn(clusterHierarchies);
- List clusters = service.findClustersByCellType("Tubules");
- assertEquals("Tubulo-interstitium", clusters.get(0).getStructureRegion());
- List clusters2 = service.findClustersByCellType("Interstitium");
- assertEquals("Tubulo-interstitium", clusters2.get(0).getStructureRegion());
- }
-
- @Test
- public void testFindDataTypesByClusterNameTi() throws Exception {
- List dataTypes = service.findDataTypesByClusterName("Tubulo-interstitium");
- assertTrue(dataTypes.contains(FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation()));
- assertTrue(dataTypes.contains(FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation()));
- assertFalse(dataTypes.contains(FullDataTypeEnum.SINGLE_CELL.getAbbreviation()));
- assertFalse(dataTypes.contains(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation()));
- }
-
- //////// 2025 Set
-
@Test
public void testFindClustersByCellType2025() {
@@ -433,6 +252,12 @@ public void testFindClustersByCellTypeTubulesOrInterstitium2025() throws Excepti
assertEquals("Tubulo-interstitium", clusters2.get(0).getStructureRegion());
}
+ @Test
+ public void testfindClustersByCellType2025RemovesDupes() throws Exception {
+ List clusterHierarchies = new ArrayList<>();
+
+ }
+
@Test
public void testFindDataTypesByClusterNameTi2025() throws Exception {
List dataTypes = service.findDataTypesByClusterName2025("Tubulo-interstitium");
diff --git a/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java
deleted file mode 100755
index 56296fdb..00000000
--- a/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.kpmp.geneExpression;
-
-import static org.junit.jupiter.api.Assertions.fail;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class ExpressionDataServiceTest {
-
- @Mock
- private SNExpressionDataRepository snRepo;
- @Mock
- private SCExpressionDataRepository scRepo;
- @Mock
- private SNExpressionDataRepository2025 snRepo2025;
- private SNSCExpressionDataService service;
-
- @BeforeEach
- public void setUp() throws Exception {
- MockitoAnnotations.openMocks(this);
- service = new SNSCExpressionDataService(snRepo, scRepo);
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- MockitoAnnotations.openMocks(this).close();
- service = null;
- }
-
- @Test
- public void testGetGeneExpressionValuesWhenSingleNuc() throws JSONException, Exception {
- SNExpressionData expressionData1 = mock(SNExpressionData.class);
- SNExpressionData2025 expressionData2025 = mock(SNExpressionData2025.class);
- JSONObject expectedResult1 = new JSONObject();
- JSONObject expectedResult2 = new JSONObject();
- when(expressionData1.getExpressionDataAsJson()).thenReturn(expectedResult1);
- when(expressionData2025.getExpressionDataAsJson()).thenReturn(expectedResult2);
- when(snRepo.findByGeneSymbol("geneSymbol")).thenReturn(expressionData1);
- when(snRepo2025.findByGeneSymbol("geneSymbol")).thenReturn(expressionData2025);
-
- assertEquals(expectedResult1, service.getGeneExpressionValues("sn", "geneSymbol"));
- assertEquals(expectedResult2, service.getGeneExpressionValues("sn", "geneSymbol"));
- }
-
- @Test
- public void testGetGeneExpressionValuesWhenSingleCell() throws JSONException, Exception {
- SCExpressionData expressionData = mock(SCExpressionData.class);
- JSONObject expectedResult = new JSONObject();
- when(expressionData.getExpressionDataAsJson()).thenReturn(expectedResult);
- when(scRepo.findByGeneSymbol("geneSymbol")).thenReturn(expressionData);
-
- assertEquals(expectedResult, service.getGeneExpressionValues("sc", "geneSymbol"));
- }
-
- @Test
- public void testGetGeneExpressionValuesWhenOtherDataType() throws JSONException {
-
- try {
- service.getGeneExpressionValues("garbage", "geneSymbol");
- fail("Should have thrown exception");
- } catch (Exception expected) {
- assertEquals("Invalid data type: garbage", expected.getMessage());
- }
- }
-
-}
diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java
new file mode 100644
index 00000000..876c325f
--- /dev/null
+++ b/src/test/java/org/kpmp/geneExpression/RTExpressionDataIdTest.java
@@ -0,0 +1,46 @@
+package org.kpmp.geneExpression;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import org.junit.jupiter.api.Test;
+
+class RTExpressionDataIdTest {
+
+ @Test
+ void testGettersAndSetters() {
+ RTExpressionDataId idData = new RTExpressionDataId();
+
+ idData.setId(101);
+ idData.setGeneSymbol("SOD1");
+ idData.setPVal(0.05);
+
+ assertEquals(101, idData.getId());
+ assertEquals("SOD1", idData.getGeneSymbol());
+ assertEquals(0.05, idData.getPVal());
+ }
+
+ @Test
+ void testConstructor() {
+ RTExpressionDataId idData = new RTExpressionDataId(202, "GAPDH", 0.001);
+
+ assertEquals(202, idData.getId());
+ assertEquals("GAPDH", idData.getGeneSymbol());
+ assertEquals(0.001, idData.getPVal());
+ }
+
+ @Test
+ void testEqualsAndHashCode() {
+ RTExpressionDataId id1 = new RTExpressionDataId(1, "ALB", 0.01);
+ RTExpressionDataId id2 = new RTExpressionDataId(1, "ALB", 0.01);
+ RTExpressionDataId id3 = new RTExpressionDataId(2, "ALB", 0.01);
+ RTExpressionDataId id4 = new RTExpressionDataId(1, "INS", 0.01);
+
+ assertEquals(id1, id2);
+ assertNotEquals(id1, id3);
+ assertNotEquals(id1, id4);
+ assertNotEquals(null, id1);
+
+ assertEquals(id1.hashCode(), id2.hashCode());
+ assertNotEquals(id1.hashCode(), id3.hashCode());
+ }
+}
diff --git a/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java b/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java
deleted file mode 100755
index c71f2a1f..00000000
--- a/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.kpmp.geneExpression;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-import org.json.JSONObject;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-public class SCExpressionDataTest {
-
- private SCExpressionData data;
-
- @BeforeEach
- public void setUp() throws Exception {
- data = new SCExpressionData();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- data = null;
- }
-
- @Test
- public void testSetGeneSymbol() {
- data.setGeneSymbol("gene symbol");
- assertEquals("gene symbol", data.getGeneSymbol());
- }
-
- @Test
- public void testSetExpressionString() {
- data.setExpressionString("expression string");
- assertEquals("expression string", data.getExpressionString());
- }
-
- @Test
- public void testGetExpressionDataAsJson() throws Exception {
- data.setExpressionString("{'key': 'value'}");
- JSONObject expressionJson = data.getExpressionDataAsJson();
-
- assertEquals("value", expressionJson.get("key"));
- }
-
-}
diff --git a/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java b/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java
deleted file mode 100755
index 80afe5e7..00000000
--- a/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.kpmp.geneExpression;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-import org.json.JSONObject;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-public class SNExpressionDataTest {
-
- private SNExpressionData data;
-
- @BeforeEach
- public void setUp() throws Exception {
- data = new SNExpressionData();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- data = null;
- }
-
- @Test
- public void testSetGeneSymbol() {
- data.setGeneSymbol("gene symbol");
- assertEquals("gene symbol", data.getGeneSymbol());
- }
-
- @Test
- public void testSetExpressionString() {
- data.setExpressionString("expression string");
- assertEquals("expression string", data.getExpressionString());
- }
-
- @Test
- public void testGetExpressionDataAsJson() throws Exception {
- data.setExpressionString("{'key': 'value'}");
- JSONObject expressionJson = data.getExpressionDataAsJson();
-
- assertEquals("value", expressionJson.get("key"));
- }
-
-}
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java
deleted file mode 100755
index f29510da..00000000
--- a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java
+++ /dev/null
@@ -1,283 +0,0 @@
-package org.kpmp.geneExpressionSummary;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.kpmp.FullDataTypeEnum;
-import org.kpmp.dataSummary.DataTypeSummary;
-import org.kpmp.geneExpression.RPExpressionDataRepository;
-import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository;
-import org.kpmp.geneExpressionSummary.regionalProteomics.RPParticipantRepository;
-import org.kpmp.geneExpressionSummary.regionalTranscriptomics.RTParticipantRepository;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionExpressionSummaryValue;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionSummaryRepository;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionSummaryRepository2025;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAParticipantRepository;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionExpressionSummaryValue;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionExpressionSummaryValue2025;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionSummaryRepository;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionSummaryRepository2025;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAParticipantRepository;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAParticipantRepository2025;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class GeneExpressionSummaryServiceTest {
-
- private GeneExpressionSummaryService geneExpressionService;
- @Mock
- private SNRNAGeneExpressionSummaryRepository snrnaGeneExpressionRepository;
- @Mock
- private SCRNAGeneExpressionSummaryRepository scrnaGeneExpressionRepository;
- @Mock
- private SCRNAParticipantRepository scrnaParticipantRepository;
- @Mock
- private SNRNAParticipantRepository snrnaParticipantRepository;
- @Mock
- private RTExpressionDataAllSegmentsRepository rtExpressionDataAllSegmentsRepository;
- @Mock
- private RTParticipantRepository rtParticipantRepository;
-
- @Mock
- RPExpressionDataRepository rpExpressionDataRepository;
-
- @Mock
- private RPParticipantRepository rpParticipantRepository;
-
- @Mock
- private SNRNAParticipantRepository2025 snrnaParticipantRepository2025;
-
- @Mock
- private SNRNAGeneExpressionSummaryRepository2025 snrnaGeneExpressionRepository2025;
-
- @Mock
- private SCRNAGeneExpressionSummaryRepository2025 scrnaGeneExpressionRepository2025;
-
- @BeforeEach
- public void setUp() throws Exception {
- MockitoAnnotations.openMocks(this);
- geneExpressionService = new GeneExpressionSummaryService(
- scrnaGeneExpressionRepository,
- snrnaGeneExpressionRepository,snrnaGeneExpressionRepository2025,scrnaParticipantRepository, scrnaGeneExpressionRepository2025, snrnaParticipantRepository,
- rtParticipantRepository, rtExpressionDataAllSegmentsRepository, rpExpressionDataRepository, rpParticipantRepository);
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- MockitoAnnotations.openMocks(this).close();
- geneExpressionService = null;
- }
-
- @SuppressWarnings("rawtypes")
- @Test
- public void testGetByDataTypeEnrollmentCategoryAndGene() throws Exception {
- List snResults = Arrays
- .asList(new SNRNAGeneExpressionExpressionSummaryValue());
- when(snrnaGeneExpressionRepository.findByEnrollmentAndGeneAllClusters("gene", "AKI")).thenReturn(snResults);
- List snResults2025 = Arrays
- .asList(new SNRNAGeneExpressionExpressionSummaryValue2025());
- when(snrnaGeneExpressionRepository2025.findByEnrollmentAndGeneAllClusters("gene", "AKI")).thenReturn(snResults2025);
- List scResults = Arrays
- .asList(new SCRNAGeneExpressionExpressionSummaryValue());
- when(scrnaGeneExpressionRepository.findByEnrollmentAndGeneAllClusters("gene", "AKI")).thenReturn(scResults);
-
- List results = geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("", "gene", "AKI");
-
- assertEquals(2, results.size());
- List extends GeneExpressionSummary> resultsSC = geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sc",
- "gene", "aki");
- assertEquals(scResults, resultsSC);
- assertEquals("sc", resultsSC.get(0).getDataType());
- List extends GeneExpressionSummary> resultsSN = geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sn",
- "gene", "aki");
- assertEquals(snResults, resultsSN);
- assertEquals("sn", resultsSN.get(0).getDataType());
-
- }
-
- @SuppressWarnings("rawtypes")
- @Test
- public void testGetExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory() throws Exception {
- List snResults = Arrays
- .asList(new SNRNAGeneExpressionExpressionSummaryValue());
- when(snrnaGeneExpressionRepository.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("cell type", "AKI"))
- .thenReturn(snResults);
- List snResults2025 = Arrays
- .asList(new SNRNAGeneExpressionExpressionSummaryValue2025());
- when(snrnaGeneExpressionRepository2025.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("cell type", "AKI"))
- .thenReturn(snResults2025);
- List scResults = Arrays
- .asList(new SCRNAGeneExpressionExpressionSummaryValue());
- when(scrnaGeneExpressionRepository.findExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("cell type", "AKI"))
- .thenReturn(scResults);
-
- List results = geneExpressionService.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("", "cell type", "AKI");
-
- assertEquals(2, results.size());
- List extends GeneExpressionSummary> resultsSC = geneExpressionService
- .getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sc", "cell type", "AKI");
- assertEquals(scResults, resultsSC);
- assertEquals("sc", resultsSC.get(0).getDataType());
- List extends GeneExpressionSummary> resultsSN = geneExpressionService
- .getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sn", "cell type", "AKI");
- assertEquals(snResults, resultsSN);
- assertEquals("sn", resultsSN.get(0).getDataType());
- List extends GeneExpressionSummary> resultsSN2025 = geneExpressionService
- .getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory("sn", "cell type", "AKI");
- assertEquals(snResults, resultsSN2025);
- assertEquals("sn", resultsSN2025.get(0).getDataType());
-
-
- }
-
- @Test
- public void testSCDuplicatesAreRemoved() throws Exception {
- SCRNAGeneExpressionExpressionSummaryValue scv = new SCRNAGeneExpressionExpressionSummaryValue();
- SCRNAGeneExpressionExpressionSummaryValue scv2 = new SCRNAGeneExpressionExpressionSummaryValue();
- scv.setGene("gene");
- scv2.setGene("gene");
- scv.setCluster("cluster");
- scv2.setCluster("cluster");
- List summaryValues = new ArrayList<>();
- summaryValues.add(scv);
- summaryValues.add(scv2);
- when(scrnaGeneExpressionRepository.findByEnrollmentAndGeneAllClusters("gene", "all")).thenReturn(summaryValues);
-
- assertEquals(1, geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sc", "gene", "all").size());
- }
-
- @Test
- public void testSNDuplicatesAreRemoved() throws Exception {
- SNRNAGeneExpressionExpressionSummaryValue scv = new SNRNAGeneExpressionExpressionSummaryValue();
- SNRNAGeneExpressionExpressionSummaryValue scv2 = new SNRNAGeneExpressionExpressionSummaryValue();
- scv.setGene("gene");
- scv2.setGene("gene");
- scv.setCluster("cluster");
- scv2.setCluster("cluster");
- List summaryValues = new ArrayList<>();
- summaryValues.add(scv);
- summaryValues.add(scv2);
- when(snrnaGeneExpressionRepository.findByEnrollmentAndGeneAllClusters("gene", "all")).thenReturn(summaryValues);
-
- assertEquals(1, geneExpressionService.getByDataTypeEnrollmentCategoryAndGene("sn", "gene", "all").size());
- }
-
- @Test
- public void testFindDataTypesByGeneWhenBothHaveData() throws Exception {
- when(snrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(1l);
- when(scrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(1l);
- when(rtExpressionDataAllSegmentsRepository.getCountByGene("gene")).thenReturn(1l);
- when(rpExpressionDataRepository.getCountByGene("gene")).thenReturn(1l);
-
-
- List dataTypes = geneExpressionService.findDataTypesByGene("gene");
-
- assertEquals(4, dataTypes.size());
- assertEquals(Arrays.asList(FullDataTypeEnum.SINGLE_CELL.getAbbreviation(),
- FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(), FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation(), FullDataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation()),
- dataTypes);
- verify(snrnaGeneExpressionRepository).getCountByGene("gene");
- verify(scrnaGeneExpressionRepository).getCountByGene("gene");
- verify(rtExpressionDataAllSegmentsRepository).getCountByGene("gene");
- verify(rpExpressionDataRepository).getCountByGene("gene");
- }
-
- @Test
- public void testFindDataTypesByGeneWhenSingleCellHasData() throws Exception {
- when(snrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(0l);
- when(scrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(1l);
- when(rtExpressionDataAllSegmentsRepository.getCountByGene("gene")).thenReturn((long) 101);
-
- List dataTypes = geneExpressionService.findDataTypesByGene("gene");
-
- assertEquals(2, dataTypes.size());
- assertEquals(Arrays.asList(FullDataTypeEnum.SINGLE_CELL.getAbbreviation(),
- FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation()), dataTypes);
- verify(snrnaGeneExpressionRepository).getCountByGene("gene");
- verify(scrnaGeneExpressionRepository).getCountByGene("gene");
- verify(rtExpressionDataAllSegmentsRepository).getCountByGene("gene");
- }
-
- @Test
- public void testFindDataTypesByGeneWhenSingleNucHasData() throws Exception {
- when(snrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(1l);
- when(scrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(0l);
-
- List dataTypes = geneExpressionService.findDataTypesByGene("gene");
-
- assertEquals(1, dataTypes.size());
- assertEquals(Arrays.asList(FullDataTypeEnum.SINGLE_NUCLEUS.getAbbreviation()), dataTypes);
- verify(snrnaGeneExpressionRepository).getCountByGene("gene");
- verify(scrnaGeneExpressionRepository).getCountByGene("gene");
- }
-
- @Test
- public void testFindDataTypesByGeneWhenNeitherHaveData() throws Exception {
- when(snrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(0l);
- when(scrnaGeneExpressionRepository.getCountByGene("gene")).thenReturn(0l);
-
- List dataTypes = geneExpressionService.findDataTypesByGene("gene");
-
- assertEquals(0, dataTypes.size());
- assertEquals(Arrays.asList(), dataTypes);
- verify(snrnaGeneExpressionRepository).getCountByGene("gene");
- verify(scrnaGeneExpressionRepository).getCountByGene("gene");
- }
-
- @Test
- public void getDataTypeSummaryInformation() throws Exception {
-
- when(rtParticipantRepository.getCountByEnrollmentCategory("aki")).thenReturn((long) 0);
- when(rtParticipantRepository.getCountByEnrollmentCategory("ckd")).thenReturn((long) 0);
- when(rtParticipantRepository.getCountByEnrollmentCategory("hrt")).thenReturn((long) 0);
- when(rtParticipantRepository.getParticipantCount()).thenReturn((long) 0);
- when(scrnaGeneExpressionRepository.getCountByEnrollment("aki")).thenReturn(Long.valueOf(0));
- when(scrnaGeneExpressionRepository.getCountByEnrollment("ckd")).thenReturn(Long.valueOf(0));
- when(scrnaGeneExpressionRepository.getCountByEnrollment("hrt")).thenReturn(Long.valueOf(0));
- when(scrnaParticipantRepository.getParticipantCount()).thenReturn(Long.valueOf(0));
- when(snrnaGeneExpressionRepository.getCountByEnrollment("aki")).thenReturn(Long.valueOf(0));
- when(snrnaGeneExpressionRepository.getCountByEnrollment("ckd")).thenReturn(Long.valueOf(0));
- when(snrnaGeneExpressionRepository.getCountByEnrollment("hrt")).thenReturn(Long.valueOf(0));
- when(snrnaParticipantRepository.getParticipantCount()).thenReturn(Long.valueOf(0));
- when(rpParticipantRepository.getCountByEnrollmentCategory("aki")).thenReturn((long) 0);
- when(rpParticipantRepository.getCountByEnrollmentCategory("ckd")).thenReturn((long) 0);
- when(rpParticipantRepository.getCountByEnrollmentCategory("hrt")).thenReturn((long) 0);
- when(rpParticipantRepository.getParticipantCount()).thenReturn((long) 0);
-
- List result = geneExpressionService.getDataTypeSummaryInformation();
- assertEquals(4, result.size());
- DataTypeSummary resultDataSC = result.get(0);
- DataTypeSummary resultDataSN = result.get(1);
- DataTypeSummary resultDataRt = result.get(2);
- DataTypeSummary resultDataRp = result.get(3);
-
- assertEquals(Long.valueOf(0), resultDataSC.getAkiCount());
- assertEquals(Long.valueOf(0), resultDataSC.getCkdCount());
- assertEquals(Long.valueOf(0), resultDataSC.getHrtCount());
- assertEquals(Long.valueOf(0), resultDataSN.getAkiCount());
- assertEquals(Long.valueOf(0), resultDataSN.getCkdCount());
- assertEquals(Long.valueOf(0), resultDataRt.getHrtCount());
- assertEquals(Long.valueOf(0), resultDataRt.getAkiCount());
- assertEquals(Long.valueOf(0), resultDataRt.getCkdCount());
- assertEquals(Long.valueOf(0), resultDataRt.getHrtCount());
- assertEquals(Long.valueOf(0), resultDataRp.getHrtCount());
- assertEquals(Long.valueOf(0), resultDataRp.getAkiCount());
- assertEquals(Long.valueOf(0), resultDataRp.getCkdCount());
- assertEquals(Long.valueOf(0), resultDataRp.getHrtCount());
-
- assertEquals("sc", resultDataSC.getDataTypeShort());
- assertEquals("sn", resultDataSN.getDataTypeShort());
- assertEquals("rt", resultDataRt.getDataTypeShort());
- assertEquals("rp", resultDataRp.getDataTypeShort());
- assertEquals(Long.valueOf(0), resultDataSN.getParticipantCount());
-
- }
-}
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java
deleted file mode 100755
index 77086f09..00000000
--- a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.kpmp.geneExpressionSummary;
-
-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;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAGeneExpressionExpressionSummaryValue;
-
-public class SCRNAGeneExpressionSummaryValueTest {
-
- private SCRNAGeneExpressionExpressionSummaryValue scrnaGeneExpressionValue;
-
- @BeforeEach
- public void setUp() throws Exception {
- scrnaGeneExpressionValue = new SCRNAGeneExpressionExpressionSummaryValue();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- scrnaGeneExpressionValue = null;
- }
-
- @Test
- public void testGetDataType() throws Exception {
- assertEquals("sc", scrnaGeneExpressionValue.getDataType());
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetAvgExpression() throws Exception {
- scrnaGeneExpressionValue.setAvgExp(0.1);
- assertEquals(0.1, scrnaGeneExpressionValue.getAvgExp(), 0.001);
-
- }
-
- @Test
- public void testSetCluster() throws Exception {
- scrnaGeneExpressionValue.setCluster("cluster");
- assertEquals("cluster", scrnaGeneExpressionValue.getCluster());
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetFoldChange() throws Exception {
- scrnaGeneExpressionValue.setFoldChange(0.2);
- assertEquals(0.2, scrnaGeneExpressionValue.getFoldChange(), 0.001);
- }
-
- @Test
- public void testSetGene() throws Exception {
- scrnaGeneExpressionValue.setGene("gene");
- assertEquals("gene", scrnaGeneExpressionValue.getGene());
-
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetId() throws Exception {
- scrnaGeneExpressionValue.setId(1);
- assertEquals(1, scrnaGeneExpressionValue.getId(), 0.001);
-
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetPct1() throws Exception {
- scrnaGeneExpressionValue.setPct1(0.3);
- assertEquals(0.3, scrnaGeneExpressionValue.getPct1(), 0.001);
-
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetPct2() throws Exception {
- scrnaGeneExpressionValue.setPct2(0.4);
- assertEquals(0.4, scrnaGeneExpressionValue.getPct2(), 0.001);
-
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetPVal() throws Exception {
- scrnaGeneExpressionValue.setPVal(0.5);
- assertEquals(0.5, scrnaGeneExpressionValue.getPVal(), 0.001);
-
- }
-
- @SuppressWarnings("null")
- @Test
- public void testSetPValAdj() throws Exception {
- scrnaGeneExpressionValue.setPValAdj(0.6);
- assertEquals(0.6, scrnaGeneExpressionValue.getPValAdj(), 0.001);
-
- }
-
- @Test
- public void testSetEnrollmentCategory() throws Exception {
- scrnaGeneExpressionValue.setEnrollmentCategory("tissue");
- assertEquals("tissue", scrnaGeneExpressionValue.getEnrollmentCategory());
- }
-
- @Test
- public void testSetClusterName() throws Exception {
- scrnaGeneExpressionValue.setClusterName("cluster name");
- assertEquals("cluster name", scrnaGeneExpressionValue.getClusterName());
- }
-
- @Test
- public void testSetCellCount() throws Exception {
- scrnaGeneExpressionValue.setCellCount(42);
- assertEquals(Integer.valueOf(42), scrnaGeneExpressionValue.getCellCount());
- }
-
- @Test
- public void testEquals() throws Exception {
- scrnaGeneExpressionValue.setGene("gene");
- scrnaGeneExpressionValue.setCluster("cluster");
- SCRNAGeneExpressionExpressionSummaryValue value = new SCRNAGeneExpressionExpressionSummaryValue();
- value.setGene("gene");
- value.setCluster("cluster");
- assertEquals(value, scrnaGeneExpressionValue);
- }
-
-}
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java
deleted file mode 100755
index bee73189..00000000
--- a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.kpmp.geneExpressionSummary;
-
-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;
-import org.kpmp.geneExpressionSummary.singleCell.SCRNAParticipantValue;
-
-public class SCRNAParticipantValueTest {
-
- SCRNAParticipantValue scrnaParticipantValue;
-
- @BeforeEach
- public void setUp() throws Exception {
- scrnaParticipantValue = new SCRNAParticipantValue();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- scrnaParticipantValue = null;
- }
-
- @Test
- public void testSetEnrollmentCategory() throws Exception {
- scrnaParticipantValue.setEnrollmentCategory("aki");
- assertEquals("aki", scrnaParticipantValue.getEnrollmentCategory());
- }
-
- public void setRedcapId() throws Exception {
- scrnaParticipantValue.setRedcapId("27-10039");
- assertEquals("27-10039", scrnaParticipantValue.getRedcapId());
- }
-
-}
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java
deleted file mode 100755
index 3c6fc626..00000000
--- a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.kpmp.geneExpressionSummary;
-
-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;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAGeneExpressionExpressionSummaryValue;
-
-public class SNRNAGeneExpressionSummaryValueTest {
-
- SNRNAGeneExpressionExpressionSummaryValue snrnaGeneExpressionValue;
-
- @BeforeEach
- public void setUp() throws Exception {
- snrnaGeneExpressionValue = new SNRNAGeneExpressionExpressionSummaryValue();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- snrnaGeneExpressionValue = null;
- }
-
- @Test
- public void testGetDataType() throws Exception {
- assertEquals("sn", snrnaGeneExpressionValue.getDataType());
- }
-
- @Test
- public void testSetAvgExpression() throws Exception {
- snrnaGeneExpressionValue.setAvgExp(0.1);
- assertEquals(0.1, snrnaGeneExpressionValue.getAvgExp(), 0.001);
-
- }
-
- @Test
- public void testSetCluster() throws Exception {
- snrnaGeneExpressionValue.setCluster("cluster");
- assertEquals("cluster", snrnaGeneExpressionValue.getCluster());
- }
-
- @Test
- public void testSetFoldChange() throws Exception {
- snrnaGeneExpressionValue.setFoldChange(0.2);
- assertEquals(0.2, snrnaGeneExpressionValue.getFoldChange(), 0.001);
- }
-
- @Test
- public void testSetGene() throws Exception {
- snrnaGeneExpressionValue.setGene("gene");
- assertEquals("gene", snrnaGeneExpressionValue.getGene());
-
- }
-
- @Test
- public void testSetId() throws Exception {
- snrnaGeneExpressionValue.setId(1);
- assertEquals(1, snrnaGeneExpressionValue.getId(), 0.001);
-
- }
-
- @Test
- public void testSetPct1() throws Exception {
- snrnaGeneExpressionValue.setPct1(0.3);
- assertEquals(0.3, snrnaGeneExpressionValue.getPct1(), 0.001);
-
- }
-
- @Test
- public void testSetPct2() throws Exception {
- snrnaGeneExpressionValue.setPct2(0.4);
- assertEquals(0.4, snrnaGeneExpressionValue.getPct2(), 0.001);
-
- }
-
- @Test
- public void testSetPVal() throws Exception {
- snrnaGeneExpressionValue.setPVal(0.5);
- assertEquals(0.5, snrnaGeneExpressionValue.getPVal(), 0.001);
-
- }
-
- @Test
- public void testSetPValAdj() throws Exception {
- snrnaGeneExpressionValue.setPValAdj(0.6);
- assertEquals(0.6, snrnaGeneExpressionValue.getPValAdj(), 0.001);
-
- }
-
- @Test
- public void testSetEnrollmentCategory() throws Exception {
- snrnaGeneExpressionValue.setEnrollmentCategory("tissue");
- assertEquals("tissue", snrnaGeneExpressionValue.getEnrollmentCategory());
- }
-
- @Test
- public void testSetClusterName() throws Exception {
- snrnaGeneExpressionValue.setClusterName("cluster name");
- assertEquals("cluster name", snrnaGeneExpressionValue.getClusterName());
- }
-
- @Test
- public void testSetCellCount() throws Exception {
- snrnaGeneExpressionValue.setCellCount(42);
- assertEquals(Integer.valueOf(42), snrnaGeneExpressionValue.getCellCount());
- }
-
- @Test
- public void testEquals() throws Exception {
- snrnaGeneExpressionValue.setGene("gene");
- snrnaGeneExpressionValue.setCluster("cluster");
- SNRNAGeneExpressionExpressionSummaryValue value = new SNRNAGeneExpressionExpressionSummaryValue();
- value.setGene("gene");
- value.setCluster("cluster");
- assertEquals(value, snrnaGeneExpressionValue);
- }
-}
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java
deleted file mode 100755
index e359330a..00000000
--- a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.kpmp.geneExpressionSummary;
-
-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;
-import org.kpmp.geneExpressionSummary.singleNucleus.SNRNAParticipantValue;
-
-public class SNRNAParticipantValueTest {
-
- SNRNAParticipantValue snrnaParticipantValue;
-
- @BeforeEach
- public void setUp() throws Exception {
- snrnaParticipantValue = new SNRNAParticipantValue();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- snrnaParticipantValue = null;
- }
-
- @Test
- public void testSetEnrollmentCategory() throws Exception {
- snrnaParticipantValue.setEnrollmentCategory("aki");
- assertEquals("aki", snrnaParticipantValue.getEnrollmentCategory());
- }
-
- public void setRedcapId() throws Exception {
- snrnaParticipantValue.setRedcapId("27-10039");
- assertEquals("27-10039", snrnaParticipantValue.getRedcapId());
- }
-
-}
diff --git a/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java b/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java
index 203d0075..a3d20bed 100755
--- a/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java
+++ b/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java
@@ -12,11 +12,11 @@
public class ParticipantDataTypeSummaryTest {
- private ParticipantDataTypeSummary summary;
+ private ParticipantDataTypeSummary2025 summary;
@BeforeEach
public void setUp() throws Exception {
- summary = new ParticipantDataTypeSummary();
+ summary = new ParticipantDataTypeSummary2025();
}
@AfterEach
@@ -26,7 +26,7 @@ public void tearDown() throws Exception {
@Test
public void testSetSpatialViewerDataTypes() {
- List experimentInfo = Arrays.asList(mock(ParticipantDataTypeInformation.class));
+ List experimentInfo = Arrays.asList(mock(ParticipantDataTypeInformation2025.class));
summary.setSpatialViewerDataTypes(experimentInfo);
@@ -35,7 +35,7 @@ public void testSetSpatialViewerDataTypes() {
@Test
public void testSetExplorerDataType() {
- List experimentInfo = Arrays.asList(mock(ParticipantDataTypeInformation.class));
+ List experimentInfo = Arrays.asList(mock(ParticipantDataTypeInformation2025.class));
summary.setExplorerDataTypes(experimentInfo);
diff --git a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java
deleted file mode 100755
index 73ab5869..00000000
--- a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java
+++ /dev/null
@@ -1,334 +0,0 @@
-package org.kpmp.participant;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.junit.jupiter.api.Assertions.fail;
-import static org.mockito.Mockito.lenient;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-import java.util.List;
-import org.kpmp.EnrollmentCategoryEnum;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.kpmp.dataSummary.DataSummaryRepository;
-import org.kpmp.geneExpressionSummary.regionalProteomics.RPParticipantRepository;
-import org.kpmp.geneExpressionSummary.regionalTranscriptomics.RTParticipantRepository;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.springframework.test.util.ReflectionTestUtils;
-
-public class ParticipantServiceTest {
-
- private ParticipantService participantService;
- @Mock
- private ParticipantSummaryDatasetRepository participantSummaryDatasetRepository;
- @Mock
- private DataSummaryRepository dataSummaryRepo;
- @Mock
- private SpatialViewerTypeRepository svTypeRepo;
- @Mock
- private SingleCellMetadataRepository scMetadataRepo;
- @Mock
- private SingleNucleusMetadataRepository snMetadataRepo;
- @Mock
- private SingleNucleusMetadataRepository2025 snMetadataRepo2025;
- @Mock
- private RTParticipantRepository rtParticipantRepo;
- @Mock
- private ParticipantRepoDataRepository fileByParticipantRepo;
- @Mock
- private RPParticipantRepository rpParticipantRepository;
- @Mock
- private ParticipantClinicalDatasetRepository participantClinicalDatasetRepo;
-
- @BeforeEach
- public void setUp() throws Exception {
- MockitoAnnotations.openMocks(this);
- participantService = new ParticipantService(dataSummaryRepo, svTypeRepo, scMetadataRepo, snMetadataRepo,
- snMetadataRepo2025, rtParticipantRepo, participantSummaryDatasetRepository, rpParticipantRepository,fileByParticipantRepo, participantClinicalDatasetRepo);
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- MockitoAnnotations.openMocks(this).close();
- participantService = null;
- }
-
- @Test
- public void testGetParticipantClincialDataset() throws Exception {
- ParticipantSummaryDataset newPart = new ParticipantSummaryDataset();
- newPart.setRedcapId("1234");
- newPart.setParticipantId(99);
-
- ParticipantClinicalDataset expectedResult = new ParticipantClinicalDataset();
- expectedResult.setA1c("40%");
- expectedResult.setAlbuminuria("very bad");
- expectedResult.setBaselineEgfr("no good");
- expectedResult.setDiabetesDuration("40-49 Years");
- expectedResult.setDiabetesHistory("Yes");
- expectedResult.setKdigoStage("Stage 4");
- expectedResult.setOnRaasBlockade("Yes");
- expectedResult.setParticipantClinicalId(0);
- expectedResult.setParticipantId(99);
- expectedResult.setProteinuria("proteinuria");
- expectedResult.setRace("alien from outer space");
- expectedResult.setAgeBinned("age");
- expectedResult.setTissueSource("tissueSource");
- expectedResult.setProtocol("protocol");
- expectedResult.setSampleType("sample");
- expectedResult.setSex("sex");
-
-
-
- when(participantSummaryDatasetRepository.findIdByRedcapId(newPart.getRedcapId())).thenReturn(newPart.getParticipantId());
-
- when(participantService.getParticipantClinicalDataset(newPart.getRedcapId())).thenReturn(expectedResult);
-
- ParticipantClinicalDataset result = participantService.getParticipantClinicalDataset("1234");
-
- assertEquals(0, result.getParticipantClinicalId());
- assertEquals(99, result.getParticipantId());
- assertEquals("40%", result.getA1c());
- assertEquals("very bad", result.getAlbuminuria());
- assertEquals("no good", result.getBaselineEgfr());
- assertEquals("40-49 Years", result.getDiabetesDuration());
- assertEquals("Yes", result.getDiabetesHistory());
- assertEquals("Stage 4", result.getKdigoStage());
- assertEquals("Yes", result.getOnRaasBlockade());
- assertEquals("proteinuria", result.getProteinuria());
- assertEquals("alien from outer space", result.getRace());
- assertEquals("age", result.getAgeBinned());
- assertEquals("tissueSource", result.getTissueSource());
- assertEquals("protocol", result.getProtocol());
- assertEquals("sex", result.getSex());
- assertEquals("sample", result.getSampleType());
- }
-
- @Test
- public void testGetParticipantSummaryDataset() throws Exception {
-
- ParticipantSummaryDataset expectedResult = new ParticipantSummaryDataset();
- expectedResult.setParticipantId(1);
- expectedResult.setOldParticipantId("2");
- expectedResult.setRedcapId("3");
- expectedResult.setSex("4");
- expectedResult.setAgeBinned("5");
- expectedResult.setTissueSource("6");
- expectedResult.setProtocol("7");
- expectedResult.setSampleType("8");
- expectedResult.setEnrollmentCategory("9");
-
- when(participantSummaryDatasetRepository.findByRedcapId("1")).thenReturn(expectedResult);
-
- when(participantService.getParticipantSummaryDataset("1")).thenReturn(expectedResult);
-
- ParticipantSummaryDataset result = participantService.getParticipantSummaryDataset("1");
-
- assertEquals(1, result.getParticipantId());
- assertEquals("2", result.getOldParticipantId());
- assertEquals("3", result.getRedcapId());
- assertEquals("4", result.getSex());
- assertEquals("5", result.getAgeBinned());
- assertEquals("6", result.getTissueSource());
- assertEquals("7", result.getProtocol());
- assertEquals("8", result.getSampleType());
- assertEquals("9", result.getEnrollmentCategory());
- }
-
- @Test
- public void testGetExperimentCounts() {
- SpatialViewerDataType dataType1 = new SpatialViewerDataType();
- dataType1.setDataType("Light Microscopy");
- dataType1.setTableName("sv_file_v");
- SpatialViewerDataType dataType2 = new SpatialViewerDataType();
- dataType2.setDataType("Spatial Lipidomics");
- dataType2.setTableName("sv_link_v");
- when(svTypeRepo.findAll()).thenReturn(Arrays.asList(dataType1, dataType2));
- when(dataSummaryRepo.getParticipantSvFileDataTypeCount("redcapId", "Light Microscopy")).thenReturn(5);
- when(dataSummaryRepo.getParticipantSvLinkDataTypeCount("redcapId", "Spatial Lipidomics")).thenReturn(2);
- when(scMetadataRepo.existsByRedcapId("redcapId")).thenReturn(true);
- when(snMetadataRepo.existsByRedcapId("redcapId")).thenReturn(true);
- when(rtParticipantRepo.existsByRedcapId("redcapId")).thenReturn(true);
- when(rpParticipantRepository.existsByRedcapId("redcapId")).thenReturn(true);
-
- ParticipantDataTypeSummary result = participantService.getExperimentCounts("redcapId");
-
- List spatialViewerDataTypes = result.getSpatialViewerDataTypes();
- assertEquals(2, spatialViewerDataTypes.size());
- List explorerDataTypes = result.getExplorerDataTypes();
- assertEquals(4, explorerDataTypes.size());
- for (ParticipantDataTypeInformation participantDataTypeInformation : spatialViewerDataTypes) {
- if (participantDataTypeInformation.getDataType().equals("Light Microscopy")) {
- assertEquals(Integer.valueOf(5), participantDataTypeInformation.getCount());
- assertEquals(false, participantDataTypeInformation.isAggregatedData());
- } else if (participantDataTypeInformation.getDataType().equals("Spatial Lipidomics")) {
- assertEquals(Integer.valueOf(2), participantDataTypeInformation.getCount());
- assertEquals(false, participantDataTypeInformation.isAggregatedData());
- }
- }
- for (ParticipantDataTypeInformation participantDataTypeInformation : explorerDataTypes) {
- assertEquals(Integer.valueOf(1), participantDataTypeInformation.getCount());
- assertEquals(true, participantDataTypeInformation.isAggregatedData());
- }
-
- ArgumentCaptor redcapIdCaptor = ArgumentCaptor.forClass(String.class);
- ArgumentCaptor dataTypeCaptor = ArgumentCaptor.forClass(String.class);
- verify(dataSummaryRepo).getParticipantSvFileDataTypeCount(redcapIdCaptor.capture(), dataTypeCaptor.capture());
- assertEquals("redcapId", redcapIdCaptor.getValue());
- assertEquals("Light Microscopy", dataTypeCaptor.getValue());
- verify(dataSummaryRepo).getParticipantSvLinkDataTypeCount(redcapIdCaptor.capture(), dataTypeCaptor.capture());
- assertEquals("redcapId", redcapIdCaptor.getValue());
- assertEquals("Spatial Lipidomics", dataTypeCaptor.getValue());
-
- }
-
- @Test
- public void testGetDataTypeCounts() throws Exception {
- String dataType1 = "Transcriptomics", dataType2 = "Imaging";
- when(dataSummaryRepo.getRepoDataTypes()).thenReturn(Arrays.asList(dataType1, dataType2));
- when(dataSummaryRepo.getParticipantRepoFileDataTypeCount("redcapId", dataType1)).thenReturn(3);
- when(dataSummaryRepo.getParticipantRepoFileDataTypeCount("redcapId", dataType2)).thenReturn(4);
-
- ParticipantRepoDataTypeSummary result = participantService.getDataTypeCounts("redcapId");
-
- List repositoryDataTypes = result.getRepositoryDataTypes();
- assertEquals(2, repositoryDataTypes.size());
- for (ParticipantRepoDataTypeInformation participantDataTypeInformation : repositoryDataTypes) {
- if(participantDataTypeInformation.getDataType().equals("Transcriptomics")) {
- assertEquals(Integer.valueOf(3), participantDataTypeInformation.getCount());
- }
- else if (participantDataTypeInformation.getDataType().equals("Imaging")) {
- assertEquals(Integer.valueOf(4), participantDataTypeInformation.getCount());
- }
- }
- }
-
- @Test
- public void testGetEnrollmentCounts() throws Exception {
- when(participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.AKI.getParticipantEnrollmentCategory())).thenReturn(Long .valueOf(4));
- when(participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.CKD.getParticipantEnrollmentCategory())).thenReturn(Long .valueOf(5));
- when(participantSummaryDatasetRepository.getDataSummaryCount(EnrollmentCategoryEnum.HEALTHY_REFERENCE.getParticipantEnrollmentCategory())).thenReturn(Long .valueOf(6));
-
- List result = participantService.getEnrollmentData();
- ParticipantEnrollmentCategorySummary resultDataAki = result.get(0);
- ParticipantEnrollmentCategorySummary resultDataCkd = result.get(0);
- ParticipantEnrollmentCategorySummary resultDataHrt = result.get(0);
-
-
- assertEquals(Long.valueOf(4), resultDataAki.getAkiCount());
- assertEquals(Long.valueOf(5), resultDataCkd.getCkdCount());
- assertEquals(Long.valueOf(6), resultDataHrt.getHrtCount());
- }
-
- @Test
- public void testGetTotalFilesCount() throws Exception {
- when(dataSummaryRepo.getParticipantIDString("123")).thenReturn("abc");
- when(dataSummaryRepo.getParticipantTotalFileCount("abc")).thenReturn(5);
-
- ParticipantRepoDataTypeInformation result = participantService.getTotalFilesCount("123");
-
- assertEquals(Integer.valueOf(5), result.getCount());
- assertEquals("redcap_id", result.getLinkInformation().getLinkType());
- assertEquals("123", result.getLinkInformation().getLinkValue());
- }
-
- @Test
- public void testGetExperimentalStrategyCountsByParticipant() {
- ParticipantRepoData experimentGroup1 = new ParticipantRepoData();
- experimentGroup1.setExperimentalStrategy("experiment1");
- experimentGroup1.setCount(1);
- experimentGroup1.setDataCategory("something else");
- ParticipantRepoData experimentGroup2 = new ParticipantRepoData();
- experimentGroup2.setExperimentalStrategy("");
- experimentGroup2.setCount(2);
- experimentGroup2.setDataType("Clinical Study Data");
- experimentGroup2.setDataCategory("another category");
- ParticipantRepoData experimentGroup3 = new ParticipantRepoData();
- experimentGroup3.setExperimentalStrategy("biomarker data");
- experimentGroup3.setDataCategory("Biomarker");
- experimentGroup3.setCount(3);
- List experimentsByParticipant = Arrays.asList(experimentGroup1, experimentGroup2, experimentGroup3);
- when(fileByParticipantRepo.findFileCountsByParticipant("participantId")).thenReturn(experimentsByParticipant);
- ReflectionTestUtils.setField(participantService, "CLINICAL_STUDY_DATA", "Clinical Study Data");
- ReflectionTestUtils.setField(participantService, "BIOMARKERS", "Biomarkers");
- ReflectionTestUtils.setField(participantService, "BIOMARKER", "Biomarker");
-
- List actualResults = participantService.getExperimentalStrategyCountsByParticipant("participantId");
-
- assertEquals(3, actualResults.size());
- for (ParticipantRepoDataTypeInformation participantRepoDataTypeInformation : actualResults) {
- if (participantRepoDataTypeInformation.getDataType().equals("experiment1")) {
- assertEquals(Integer.valueOf(1), participantRepoDataTypeInformation.getCount());
- } else if (participantRepoDataTypeInformation.getDataType().equals("Clinical Study Data")) {
- assertEquals(Integer.valueOf(2), participantRepoDataTypeInformation.getCount());
- } else if (participantRepoDataTypeInformation.getDataType().equals("Biomarkers")) {
- assertEquals(Integer.valueOf(3), participantRepoDataTypeInformation.getCount());
- } else {
- fail("unexpected data type: " + participantRepoDataTypeInformation.getDataType());
- }
- }
- }
-
- @Test
- public void testGetExperimentalStrategyCountsByParticipant_combinesClinicalDataCounts() {
- ParticipantRepoData experimentGroup1 = new ParticipantRepoData();
- experimentGroup1.setExperimentalStrategy("");
- experimentGroup1.setCount(1);
- experimentGroup1.setDataType("Clinical Study Data");
- experimentGroup1.setDataCategory("something else");
- ParticipantRepoData experimentGroup2 = new ParticipantRepoData();
- experimentGroup2.setExperimentalStrategy("");
- experimentGroup2.setCount(2);
- experimentGroup2.setDataType("Clinical Study Data");
- experimentGroup2.setDataCategory("another category");
- List experimentsByParticipant = Arrays.asList(experimentGroup1, experimentGroup2);
- when(fileByParticipantRepo.findFileCountsByParticipant("participantId")).thenReturn(experimentsByParticipant);
- ReflectionTestUtils.setField(participantService, "CLINICAL_STUDY_DATA", "Clinical Study Data");
- ReflectionTestUtils.setField(participantService, "BIOMARKERS", "Biomarkers");
- ReflectionTestUtils.setField(participantService, "BIOMARKER", "Biomarker");
-
- List actualResults = participantService.getExperimentalStrategyCountsByParticipant("participantId");
-
- assertEquals(1, actualResults.size());
- for (ParticipantRepoDataTypeInformation participantRepoDataTypeInformation : actualResults) {
- if (participantRepoDataTypeInformation.getDataType().equals("Clinical Study Data")) {
- assertEquals(Integer.valueOf(3), participantRepoDataTypeInformation.getCount());
- } else {
- fail("unexpected data type: " + participantRepoDataTypeInformation.getDataType());
- }
- }
- }
-
- @Test
- public void testGetExperimentalStrategyCountsByParticipant_combinesBiomarkerCounts() {
- ParticipantRepoData experimentGroup1 = new ParticipantRepoData();
- experimentGroup1.setExperimentalStrategy("strat1");
- experimentGroup1.setCount(1);
- experimentGroup1.setDataType("stuff");
- experimentGroup1.setDataCategory("Biomarker");
- ParticipantRepoData experimentGroup2 = new ParticipantRepoData();
- experimentGroup2.setExperimentalStrategy("strat2");
- experimentGroup2.setCount(2);
- experimentGroup2.setDataType("more stuff");
- experimentGroup2.setDataCategory("Biomarker");
- List experimentsByParticipant = Arrays.asList(experimentGroup1, experimentGroup2);
- when(fileByParticipantRepo.findFileCountsByParticipant("participantId")).thenReturn(experimentsByParticipant);
- ReflectionTestUtils.setField(participantService, "CLINICAL_STUDY_DATA", "Clinical Study Data");
- ReflectionTestUtils.setField(participantService, "BIOMARKERS", "Biomarkers");
- ReflectionTestUtils.setField(participantService, "BIOMARKER", "Biomarker");
-
- List actualResults = participantService.getExperimentalStrategyCountsByParticipant("participantId");
-
- assertEquals(1, actualResults.size());
- for (ParticipantRepoDataTypeInformation participantRepoDataTypeInformation : actualResults) {
- if (participantRepoDataTypeInformation.getDataType().equals("Biomarkers")) {
- assertEquals(Integer.valueOf(3), participantRepoDataTypeInformation.getCount());
- } else {
- fail("unexpected data type: " + participantRepoDataTypeInformation.getDataType());
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
deleted file mode 100755
index 715d8f4f..00000000
--- a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.kpmp.participant;
-
-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;
-
-public class SingleCellMetadataTest {
-
- private SingleCellMetadata scMetadata;
-
- @BeforeEach
- public void setUp() throws Exception {
- scMetadata = new SingleCellMetadata();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- scMetadata = null;
- }
-
- @Test
- public void testSetBarcode() {
- scMetadata.setBarcode("barcode");
- assertEquals("barcode", scMetadata.getBarcode());
- }
-
- @Test
- public void testSetRedcapId() {
- scMetadata.setRedcapId("redcapid");
- assertEquals("redcapid", scMetadata.getRedcapId());
- }
-
-}
diff --git a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
deleted file mode 100755
index 9b3420aa..00000000
--- a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.kpmp.participant;
-
-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;
-
-public class SingleNucleusMetadataTest {
-
- private SingleNucleusMetadata snMetadata;
-
- @BeforeEach
- public void setUp() throws Exception {
- snMetadata = new SingleNucleusMetadata();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- snMetadata = null;
- }
-
- @Test
- public void testSetBarcode() {
- snMetadata.setBarcode("barcode");
- assertEquals("barcode", snMetadata.getBarcode());
- }
-
- @Test
- public void testSetRedcapId() {
- snMetadata.setRedcapId("redcapid");
- assertEquals("redcapid", snMetadata.getRedcapId());
- }
-
-}
diff --git a/src/test/java/org/kpmp/umap/SCMetadataTest.java b/src/test/java/org/kpmp/umap/SCMetadataTest.java
deleted file mode 100755
index 64610cfe..00000000
--- a/src/test/java/org/kpmp/umap/SCMetadataTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.kpmp.umap;
-
-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;
-
-public class SCMetadataTest {
-
- private static double DOUBLE_PRECISION = 0.000001d;
- private SCMetadata point;
-
- @BeforeEach
- public void setUp() throws Exception {
- point = new SCMetadata();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- point = null;
- }
-
- @Test
- public void testSetUmapX() {
- point.setUmapX(2.4d);
- assertEquals(2.4d, point.getUmapX(), DOUBLE_PRECISION);
- }
-
- @Test
- public void testSetUmapY() {
- point.setUmapY(2.5d);
- assertEquals(2.5d, point.getUmapY(), DOUBLE_PRECISION);
- }
-
- @Test
- public void testSetClusterName() {
- point.setClusterName("cluster name");
- assertEquals("cluster name", point.getClusterName());
- }
-
- @Test
- public void testSetClusterAbbreviation() {
- point.setClusterAbbreviation("cluster abbr");
- assertEquals("cluster abbr", point.getClusterAbbreviation());
- }
-
- @Test
- public void testSetClusterColor() {
- point.setClusterColor("cluster color");
- assertEquals("cluster color", point.getClusterColor());
- }
-
- @Test
- public void testSetExpressionValue() throws Exception {
- point.setExpressionValue(4d);
- assertEquals(4d, point.getExpressionValue(), DOUBLE_PRECISION);
- }
-
- @Test
- public void testSetBarcode() throws Exception {
- point.setBarcode("barcode");
- assertEquals("barcode", point.getBarcode());
- }
-
- @Test
- public void testSetEnrollmentCategory() throws Exception {
- point.setEnrollmentCategory("enrollmentCategory");
- assertEquals("enrollmentCategory", point.getEnrollmentCategory());
- }
-
-}
\ No newline at end of file
diff --git a/src/test/java/org/kpmp/umap/SNMetadataTest.java b/src/test/java/org/kpmp/umap/SNMetadataTest.java
deleted file mode 100755
index 884d81e6..00000000
--- a/src/test/java/org/kpmp/umap/SNMetadataTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.kpmp.umap;
-
-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;
-
-public class SNMetadataTest {
-
- private static double DOUBLE_PRECISION = 0.000001d;
- private SNMetadata point;
-
- @BeforeEach
- public void setUp() throws Exception {
- point = new SNMetadata();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- point = null;
- }
-
- @Test
- public void testSetUmapX() {
- point.setUmapX(2.4d);
- assertEquals(2.4d, point.getUmapX(), DOUBLE_PRECISION);
- }
-
- @Test
- public void testSetUmapY() {
- point.setUmapY(2.5d);
- assertEquals(2.5d, point.getUmapY(), DOUBLE_PRECISION);
- }
-
- @Test
- public void testSetClusterName() {
- point.setClusterName("cluster name");
- assertEquals("cluster name", point.getClusterName());
- }
-
- @Test
- public void testSetClusterAbbreviation() {
- point.setClusterAbbreviation("cluster abbr");
- assertEquals("cluster abbr", point.getClusterAbbreviation());
- }
-
- @Test
- public void testSetClusterColor() {
- point.setClusterColor("cluster color");
- assertEquals("cluster color", point.getClusterColor());
- }
-
- @Test
- public void testSetExpressionValue() throws Exception {
- point.setExpressionValue(4d);
- assertEquals(4d, point.getExpressionValue(), DOUBLE_PRECISION);
- }
-
- @Test
- public void testSetBarcode() throws Exception {
- point.setBarcode("barcode");
- assertEquals("barcode", point.getBarcode());
- }
-
- @Test
- public void testSetEnrollmentCategory() throws Exception {
- point.setEnrollmentCategory("enrollmentCategory");
- assertEquals("enrollmentCategory", point.getEnrollmentCategory());
- }
-
-}
diff --git a/src/test/java/org/kpmp/umap/UmapDataServiceTest.java b/src/test/java/org/kpmp/umap/UmapDataServiceTest.java
deleted file mode 100755
index 6db738a8..00000000
--- a/src/test/java/org/kpmp/umap/UmapDataServiceTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.kpmp.umap;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.json.JSONObject;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.kpmp.geneExpression.SNSCExpressionDataService;
-import org.kpmp.geneExpression.SNSCExpressionDataService2025;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class UmapDataServiceTest {
-
- private UmapDataService service;
- @Mock
- private SNSCExpressionDataService expressionDataService;
- @Mock
- private SNSCExpressionDataService2025 expressionDataService2025;
- @Mock
- private SCMetadataRepository scMetadataRepository;
- @Mock
- private SNMetadataRepository snMetadataRepository;
- @Mock
- private SNMetadataRepository2025 snMetadataRepository2025;
-
- private static double DOUBLE_PRECISION = 0.000001d;
-
- @BeforeEach
- public void setUp() throws Exception {
- MockitoAnnotations.openMocks(this);
- service = new UmapDataService(scMetadataRepository, snMetadataRepository, expressionDataService);
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- MockitoAnnotations.openMocks(this).close();
- service = null;
- }
-
- @Test
- public void testGetPlotDataFeatureData() throws Exception {
- SNMetadata snMetadata = new SNMetadata();
- snMetadata.setUmapX(3d);
- snMetadata.setUmapY(4d);
- snMetadata.setClusterName("clusterName");
- snMetadata.setClusterAbbreviation("clusterAbbrev");
- snMetadata.setBarcode("barcodeNotInExpression");
- SNMetadata snMetadata2 = new SNMetadata();
- snMetadata2.setUmapX(5d);
- snMetadata2.setUmapY(6d);
- snMetadata2.setClusterName("clusterName");
- snMetadata2.setClusterAbbreviation("clusterAbbrev");
- snMetadata2.setBarcode("barcode");
- List expectedPoints = Arrays.asList(snMetadata, snMetadata2);
- when(snMetadataRepository.findCount()).thenReturn(7);
- when(snMetadataRepository.findLimited(2)).thenReturn(expectedPoints);
- when(expressionDataService.getGeneExpressionValues("sn", "gene"))
- .thenReturn(new JSONObject("{ 'barcode': 0.4d , 'barcode2': 2.2d}"));
-
- PlotData plotData = service.getPlotData("sn", "gene", "all");
-
- List featureData = plotData.getFeatureData();
- assertEquals(2, featureData.size());
- FeatureData featureDataWithExpressionValues = featureData.get(0);
- assertEquals(1, featureDataWithExpressionValues.getXValues().size());
- assertEquals(1, featureDataWithExpressionValues.getXValues().size());
- assertEquals(5d, featureDataWithExpressionValues.getXValues().get(0), DOUBLE_PRECISION);
- assertEquals(1, featureDataWithExpressionValues.getYValues().size());
- assertEquals(6d, featureDataWithExpressionValues.getYValues().get(0), DOUBLE_PRECISION);
- assertEquals(1, featureDataWithExpressionValues.getExpression().size());
- assertEquals(0.4d, featureDataWithExpressionValues.getExpression().get(0), DOUBLE_PRECISION);
- assertEquals("0.4
clusterName", featureDataWithExpressionValues.getHoverDisplay().get(0));
-
- FeatureData featureDataWithZeroExpressionValue = featureData.get(1);
- assertEquals(1, featureDataWithZeroExpressionValue.getXValues().size());
- assertEquals(3d, featureDataWithZeroExpressionValue.getXValues().get(0), DOUBLE_PRECISION);
- assertEquals(1, featureDataWithZeroExpressionValue.getYValues().size());
- assertEquals(4d, featureDataWithZeroExpressionValue.getYValues().get(0), DOUBLE_PRECISION);
- assertEquals(1, featureDataWithZeroExpressionValue.getExpression().size());
- assertEquals(0d, featureDataWithZeroExpressionValue.getExpression().get(0), DOUBLE_PRECISION);
- assertEquals("clusterName", featureDataWithZeroExpressionValue.getHoverDisplay().get(0));
-
- }
-
- @Test
- public void testGetPlotDataReferenceDataOneCluster() throws Exception {
- SNMetadata snMetadata = new SNMetadata();
- snMetadata.setUmapX(3d);
- snMetadata.setUmapY(4d);
- snMetadata.setClusterName("clusterName");
- snMetadata.setClusterAbbreviation("clusterAbbreviation");
- snMetadata.setClusterColor("color");
- snMetadata.setBarcode("barcodeNotInExpression");
- SNMetadata snMetadata2 = new SNMetadata();
- snMetadata2.setUmapX(5d);
- snMetadata2.setUmapY(6d);
- snMetadata2.setClusterName("clusterName");
- snMetadata2.setClusterAbbreviation("clusterAbbreviation");
- snMetadata2.setClusterColor("color");
- snMetadata2.setBarcode("barcode");
- List expectedPoints = Arrays.asList(snMetadata, snMetadata2);
- when(snMetadataRepository.findCount()).thenReturn(7);
- when(snMetadataRepository.findLimited(2)).thenReturn(expectedPoints);
- when(expressionDataService.getGeneExpressionValues("sn", "gene")).thenReturn(new JSONObject());
-
- PlotData plotData = service.getPlotData("sn", "gene", "all");
-
- List clusters = plotData.getReferenceData();
- assertEquals(1, clusters.size());
- assertEquals("clusterAbbreviation", clusters.get(0).getClusterAbbreviation());
- assertEquals("color", clusters.get(0).getColor());
- List xValues = clusters.get(0).getXValues();
- assertEquals(2, xValues.size());
- assertEquals(3d, xValues.get(0), DOUBLE_PRECISION);
- assertEquals(5d, xValues.get(1), DOUBLE_PRECISION);
- List yValues = clusters.get(0).getYValues();
- assertEquals(2, yValues.size());
- assertEquals(4d, yValues.get(0), DOUBLE_PRECISION);
- assertEquals(6d, yValues.get(1), DOUBLE_PRECISION);
-
- }
-
- @Test
- public void testGetPlotDataReferenceDataMultipleClusters() throws Exception {
- SNMetadata snMetadata = new SNMetadata();
- snMetadata.setUmapX(3d);
- snMetadata.setUmapY(4d);
- snMetadata.setClusterAbbreviation("clusterAbbrev1");
- snMetadata.setClusterColor("color1");
- snMetadata.setBarcode("barcodeNotInExpression");
- SNMetadata snMetadata2 = new SNMetadata();
- snMetadata2.setUmapX(5d);
- snMetadata2.setUmapY(6d);
- snMetadata2.setClusterAbbreviation("clusterAbbrev2");
- snMetadata2.setClusterColor("color2");
- snMetadata2.setBarcode("barcode");
- List expectedPoints = Arrays.asList(snMetadata, snMetadata2);
- when(snMetadataRepository.findCount()).thenReturn(7);
- when(snMetadataRepository.findLimited(2)).thenReturn(expectedPoints);
- when(expressionDataService.getGeneExpressionValues("sn", "gene")).thenReturn(new JSONObject());
-
- PlotData plotData = service.getPlotData("sn", "gene", "all");
-
- List clusters = plotData.getReferenceData();
- assertEquals(2, clusters.size());
- assertEquals("clusterAbbrev2", clusters.get(0).getClusterAbbreviation());
- assertEquals("color2", clusters.get(0).getColor());
- assertEquals("clusterAbbrev1", clusters.get(1).getClusterAbbreviation());
- assertEquals("color1", clusters.get(1).getColor());
- List xValues = clusters.get(1).getXValues();
- assertEquals(1, xValues.size());
- assertEquals(3d, xValues.get(0), DOUBLE_PRECISION);
- List yValues = clusters.get(1).getYValues();
- assertEquals(1, yValues.size());
- assertEquals(4d, yValues.get(0), DOUBLE_PRECISION);
- xValues = clusters.get(0).getXValues();
- yValues = clusters.get(0).getYValues();
- assertEquals(5d, xValues.get(0), DOUBLE_PRECISION);
- assertEquals(6d, yValues.get(0), DOUBLE_PRECISION);
-
- }
-
-}