diff --git a/.classpath b/.classpath
old mode 100644
new mode 100755
index f00842b..639c8b2
--- a/.classpath
+++ b/.classpath
@@ -1,25 +1,638 @@
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
index 7728c0a..e91f6df
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,4 @@ build
.settings
bin
.gradle
+.DS_Store
diff --git a/.project b/.project
old mode 100644
new mode 100755
index 974292e..b0a8cd9
--- a/.project
+++ b/.project
@@ -2,29 +2,27 @@
pegasus-data
-
-
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.buildship.core.gradleprojectnature
+
org.eclipse.jdt.core.javabuilder
-
-
+
org.eclipse.buildship.core.gradleprojectbuilder
-
-
+
-
- org.eclipse.jdt.core.javanature
- org.eclipse.buildship.core.gradleprojectnature
-
+
1
-
30
+
org.eclipse.core.resources.regexFilterMatcher
node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
diff --git a/.travis.yml b/.travis.yml
old mode 100644
new mode 100755
diff --git a/Dockerfile b/Dockerfile
old mode 100644
new mode 100755
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index 6931273..821d0e8
--- a/README.md
+++ b/README.md
@@ -34,3 +34,11 @@ Repository for the Atlas Explorer Tool service layer
2. Update .env ENV_MYSQL_PASSWORD to the password for QA KE
3. Add your IP address to a new security group called sg-0597e054f11d2e31a (Developer to KE Mariadb)
4. Restart your knowledge-environment (don't worry that you have your own copy of mariadb, it'll be ignored)
+
+If you have already followed these steps and are still having trouble connecting, check to see if your ip address has changed, you may need to update the security group rules
+
+# Talking to GraphQL
+
+1. Start up your atlas/knowledge-environment server
+2. Open a tool like GraphQLPlayground and connect to "http://localhost:3030/graphql"
+3. Write and execute your query
diff --git a/build.gradle b/build.gradle
old mode 100644
new mode 100755
index b055981..275a5e4
--- a/build.gradle
+++ b/build.gradle
@@ -21,7 +21,7 @@ apply plugin: 'io.spring.dependency-management'
jar {
baseName='pegasus-data'
- version= '2.0'
+ version= '1.7'
}
repositories {
@@ -46,6 +46,7 @@ dependencies {
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.0.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-cache'
+ implementation 'com.hazelcast:hazelcast-all:4.2.5'
}
springBoot {
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
old mode 100644
new mode 100755
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
old mode 100644
new mode 100755
index ff1ea5b..534a9cb
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
diff --git a/gradlew.bat b/gradlew.bat
old mode 100644
new mode 100755
diff --git a/src/main/java/org/.DS_Store b/src/main/java/org/.DS_Store
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/Application.java b/src/main/java/org/kpmp/Application.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/DataTypeEnum.java b/src/main/java/org/kpmp/DataTypeEnum.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/FullDataTypeEnum.java b/src/main/java/org/kpmp/FullDataTypeEnum.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/OmicsTypeEnum.java b/src/main/java/org/kpmp/OmicsTypeEnum.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java
old mode 100644
new mode 100755
index 29e8ded..be63d44
--- a/src/main/java/org/kpmp/Query.java
+++ b/src/main/java/org/kpmp/Query.java
@@ -10,8 +10,9 @@
import org.kpmp.cellType.CellTypeService;
import org.kpmp.cellTypeSummary.ClusterHierarchy;
import org.kpmp.cellTypeSummary.ClusterHierarchyService;
+import org.kpmp.dataSummary.AtlasRepoSummaryResult;
import org.kpmp.dataSummary.DataSummaryService;
-import org.kpmp.datasetSummary.DatasetSummary;
+import org.kpmp.dataSummary.DataTypeSummary;
import org.kpmp.gene.GeneService;
import org.kpmp.gene.MyGeneInfoHit;
import org.kpmp.geneExpression.RTExpressionByTissueType;
@@ -22,6 +23,7 @@
import org.kpmp.participant.ParticipantDataTypeSummary;
import org.kpmp.participant.ParticipantService;
import org.kpmp.participant.ParticipantSummaryDataset;
+import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.UmapDataService;
import org.slf4j.Logger;
@@ -99,7 +101,7 @@ public PlotData getUmapPlotData(String dataType, String geneSymbol, String tissu
}
}
- public List getGeneDatasetInformation(String geneSymbol) throws Exception {
+ public List getGeneDatasetInformation(String geneSymbol) throws Exception {
try {
return geneExpressionSummaryService.getGeneDatasetInformation(geneSymbol);
} catch (Exception e) {
@@ -108,7 +110,7 @@ public List getGeneDatasetInformation(String geneSymbol) throws
}
}
- public List getSummaryData() throws Exception {
+ public List getSummaryData() throws Exception {
try {
return dataSummaryService.getSummaryData();
} catch (Exception e) {
@@ -165,4 +167,22 @@ public ParticipantSummaryDataset participantSummaryDataset(String redcap_id) thr
public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) throws Exception {
return this.participantSummaryDataset(redcap_id);
}
-}
+
+ public List getTissueTypeSummaryData() throws Exception {
+ try {
+ return participantService.getTissueData();
+ } catch (Exception e) {
+ logger.error(e.getMessage());
+ throw e;
+ }
+ }
+
+ public AtlasRepoSummaryResult getAtlasSummaryRows() throws Exception {
+ try {
+ return dataSummaryService.getAtlasRepoSummary();
+ } catch (Exception e) {
+ logger.error("Unable to get Atlas Summary data: ", e.getMessage());
+ throw e;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/RTComparisonTypeEnum.java b/src/main/java/org/kpmp/RTComparisonTypeEnum.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/TissueTypeEnum.java b/src/main/java/org/kpmp/TissueTypeEnum.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/WebConfig.java b/src/main/java/org/kpmp/WebConfig.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java
old mode 100644
new mode 100755
index 90e17e0..3d07095
--- a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java
+++ b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java
@@ -1,9 +1,11 @@
package org.kpmp.autocomplete;
+import java.io.Serializable;
import java.util.List;
-public class AutocompleteResult {
+public class AutocompleteResult implements Serializable {
+ private static final long serialVersionUID = 762733408490639258L;
private String value;
private String name;
private String id;
diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteService.java b/src/main/java/org/kpmp/autocomplete/AutocompleteService.java
old mode 100644
new mode 100755
index 9be99ed..f0d65e6
--- a/src/main/java/org/kpmp/autocomplete/AutocompleteService.java
+++ b/src/main/java/org/kpmp/autocomplete/AutocompleteService.java
@@ -11,6 +11,7 @@
import org.kpmp.gene.GeneService;
import org.kpmp.gene.MyGeneInfoHit;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@Service
@@ -28,6 +29,7 @@ public AutocompleteService(GeneService geneService, CellTypeRepository cellTypeR
this.cellTypeRepository = cellTypeRepository;
}
+ @Cacheable("autocompleteQuery")
public List query(String searchTerm) throws IOException, Exception {
List myGeneInfoHits = geneService.querySymbolAndAlias(searchTerm);
List cellTypes = cellTypeRepository.findByCellTypeContainingOrSynonymContaining(searchTerm);
@@ -40,6 +42,7 @@ public List query(String searchTerm) throws IOException, Exc
return myGeneResults;
}
+ @Cacheable("myGeneInfoHitsToAutocompleteResults")
public List convertMyGeneInfoHitsToAutocompleteResults(List hits) {
List autocompleteResults = new ArrayList<>();
for (MyGeneInfoHit hit : hits) {
@@ -49,6 +52,7 @@ public List convertMyGeneInfoHitsToAutocompleteResults(List<
return autocompleteResults;
}
+ @Cacheable("cellTypesToAutocompleteResults")
public List convertCellTypesToAutocompleteResults(List cellTypes,
List regions, List subregions) {
List cellTypeListNoDupes = cellTypes.stream().distinct().collect(Collectors.toList());
diff --git a/src/main/java/org/kpmp/cellType/CellType.java b/src/main/java/org/kpmp/cellType/CellType.java
old mode 100644
new mode 100755
index 8c71d82..e336d0d
--- a/src/main/java/org/kpmp/cellType/CellType.java
+++ b/src/main/java/org/kpmp/cellType/CellType.java
@@ -1,5 +1,6 @@
package org.kpmp.cellType;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -14,7 +15,9 @@
@Entity
@Table(name = "cell_type")
-public class CellType {
+public class CellType implements Serializable {
+
+ private static final long serialVersionUID = -7240769211757430938L;
@Id
@Column(name = "cell_type_id")
diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
old mode 100644
new mode 100755
index 46a536f..dfc7470
--- a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
@@ -1,5 +1,6 @@
package org.kpmp.cellType;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -8,8 +9,9 @@
import org.springframework.stereotype.Component;
@Component
-public class CellTypeHierarchy {
-
+public class CellTypeHierarchy implements Serializable {
+
+ private static final long serialVersionUID = 4174487460309851924L;
private Map cellTypeRegionMap = new HashMap<>();
public List getCellTypeRegions() {
@@ -19,7 +21,7 @@ public List getCellTypeRegions() {
}
public void addCellTypeStructureRegion(CellTypeStructureRegion region) {
-
+
if (cellTypeRegionMap.containsKey(region.getRegionName())) {
CellTypeStructureRegion existingRegion = cellTypeRegionMap.get(region.getRegionName());
List subregions = region.getCellTypeSubregions();
@@ -31,7 +33,4 @@ public void addCellTypeStructureRegion(CellTypeStructureRegion region) {
}
}
-
-
}
-
diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchyResolver.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchyResolver.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cellType/CellTypeRepository.java b/src/main/java/org/kpmp/cellType/CellTypeRepository.java
old mode 100644
new mode 100755
index 13851e1..0fc449b
--- a/src/main/java/org/kpmp/cellType/CellTypeRepository.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeRepository.java
@@ -2,6 +2,7 @@
import java.util.List;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
@@ -10,6 +11,7 @@
@Repository
public interface CellTypeRepository extends CrudRepository {
+ @Cacheable("cellTypeContainingOrSynonymContaining")
@Query(value = "SELECT ct.*, cs.* " + " FROM cell_type ct "
+ " JOIN celltype_synonym cs ON (ct.cell_type_id = cs.cell_type_id AND cs.cell_type_synonym LIKE %:searchTerm%) "
+ " UNION " + " SELECT ct.*, cs.* " + " FROM cell_type ct "
@@ -17,10 +19,13 @@ public interface CellTypeRepository extends CrudRepository {
+ " WHERE ct.cell_type LIKE %:searchTerm% ", nativeQuery = true)
List findByCellTypeContainingOrSynonymContaining(@Param("searchTerm") String searchTerm);
+ @Cacheable("cellTypeIsNotNullOrderByCellTypeOrdering")
List findAllByCellTypeIsNotNullOrderByCellTypeOrdering();
+ @Cacheable("structureRegionContaining")
List findByStructureRegionContaining(String searchTerm);
+ @Cacheable("structureSubregionContaining")
List findByStructureSubregionContaining(String searchTerm);
}
diff --git a/src/main/java/org/kpmp/cellType/CellTypeService.java b/src/main/java/org/kpmp/cellType/CellTypeService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java
old mode 100644
new mode 100755
index 3a41f45..185fe66
--- a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java
@@ -1,12 +1,14 @@
package org.kpmp.cellType;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class CellTypeStructureRegion {
+public class CellTypeStructureRegion implements Serializable {
+ private static final long serialVersionUID = 3141535632314917816L;
private String regionName;
private Map subregionMap = new HashMap<>();
private List subregionOrderdList = new ArrayList<>();
diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegionResolver.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegionResolver.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java
old mode 100644
new mode 100755
index 7758793..b6be2c0
--- a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java
@@ -1,12 +1,14 @@
package org.kpmp.cellType;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.google.common.base.Objects;
-public class CellTypeStructureSubregion {
+public class CellTypeStructureSubregion implements Serializable {
+ private static final long serialVersionUID = 1366955014710403152L;
private String subregionName;
private List cellTypes = new ArrayList<>();
diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java
old mode 100644
new mode 100755
index 664ac21..f33f904
--- a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java
@@ -1,9 +1,11 @@
package org.kpmp.cellType;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -12,33 +14,35 @@
@Entity
@Table(name = "celltype_synonym")
@IdClass(CellTypeSynonymId.class)
-public class CellTypeSynonym {
+public class CellTypeSynonym implements Serializable {
+
+ private static final long serialVersionUID = -5650797130903696615L;
- @Id
- @Column(name="cell_type_id")
- private int cellTypeId;
+ @Id
+ @Column(name = "cell_type_id")
+ private int cellTypeId;
- @Id
- @Column(name="cell_type_synonym")
- private String cellTypeSynonym;
+ @Id
+ @Column(name = "cell_type_synonym")
+ private String cellTypeSynonym;
- @ManyToOne(fetch = FetchType.EAGER)
- @JoinColumn(name="cell_type_id", nullable = false, insertable = false, updatable = false)
- private CellType cellType;
+ @ManyToOne(fetch = FetchType.EAGER)
+ @JoinColumn(name = "cell_type_id", nullable = false, insertable = false, updatable = false)
+ private CellType cellType;
- public int getCellTypeId() {
- return cellTypeId;
- }
+ public int getCellTypeId() {
+ return cellTypeId;
+ }
- public void setCellTypeId(int cellTypeId) {
- this.cellTypeId = cellTypeId;
- }
+ public void setCellTypeId(int cellTypeId) {
+ this.cellTypeId = cellTypeId;
+ }
- public String getCellTypeSynonym() {
- return cellTypeSynonym;
- }
+ public String getCellTypeSynonym() {
+ return cellTypeSynonym;
+ }
- public void setCellTypeSynonym(String cellTypeSynonym) {
- this.cellTypeSynonym = cellTypeSynonym;
- }
+ public void setCellTypeSynonym(String cellTypeSynonym) {
+ this.cellTypeSynonym = cellTypeSynonym;
+ }
}
diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonymId.java b/src/main/java/org/kpmp/cellType/CellTypeSynonymId.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java
old mode 100644
new mode 100755
index 1a69c21..59b1da1
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java
+++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHiearchyRepository.java
@@ -2,6 +2,7 @@
import java.util.List;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
@@ -9,11 +10,14 @@
interface ClusterHiearchyRepository extends CrudRepository {
@Override
+ @Cacheable("clusterHierarchy")
List findAll();
+ @Cacheable("clusterHierarchyCt")
@Query(value = "CALL cluster_hierarchy_sp(:cell_type);", nativeQuery = true)
List findByCellType(@Param("cell_type") String cellType);
- @Query(value = "CALL cluster_hierarchy_by_cluster_sp(:cluster);", nativeQuery = true)
+ @Cacheable("clusterHierarchyCluster")
+ @Query(value = "CALL cluster_hierarchy_by_cluster_sp(:cluster);", nativeQuery = true)
ClusterHierarchy findFirstByClusterOrRegion(String cluster);
}
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
old mode 100644
new mode 100755
index 7212d20..8313e73
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
+++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
@@ -1,6 +1,6 @@
package org.kpmp.cellTypeSummary;
-import org.springframework.lang.Nullable;
+import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -8,11 +8,14 @@
import javax.persistence.IdClass;
import javax.persistence.Table;
+import org.springframework.lang.Nullable;
+
@Entity
@Table(name = "cluster_hierarchy_v")
@IdClass(ClusterHierarchyId.class)
-public class ClusterHierarchy {
+public class ClusterHierarchy implements Serializable {
+ private static final long serialVersionUID = -7707637379989017634L;
@Id
@Column(name = "cell_type_id")
private int cellTypeId;
@@ -30,11 +33,11 @@ public class ClusterHierarchy {
@Column(name = "is_single_nuc")
private String isSingleNucCluster;
@Column(name = "is_rt")
- private String isRegionalTranscriptomics;
+ private String isRegionalTranscriptomics;
@Column(name = "cell_type")
private String cellType;
@Column(name = "cell_type_order")
- private Double cellTypeOrder;
+ private Double cellTypeOrder;
public int getCellTypeId() {
return cellTypeId;
@@ -44,7 +47,7 @@ public void setCellTypeId(int cellTypeId) {
this.cellTypeId = cellTypeId;
}
- @Nullable
+ @Nullable
public int getClusterId() {
return clusterId;
}
@@ -61,7 +64,7 @@ public void setStructureRegion(String structureRegion) {
this.structureRegion = structureRegion;
}
- @Nullable
+ @Nullable
public String getStructureSubregion() {
return structureSubregion;
}
@@ -70,7 +73,7 @@ public void setStructureSubregion(String structureSubregion) {
this.structureSubregion = structureSubregion;
}
- @Nullable
+ @Nullable
public String getClusterName() {
return clusterName;
}
@@ -95,29 +98,29 @@ public void setIsSingleNucCluster(String isSingleNucCluster) {
this.isSingleNucCluster = isSingleNucCluster;
}
- public String getIsRegionalTranscriptomics() {
- return isRegionalTranscriptomics;
- }
+ public String getIsRegionalTranscriptomics() {
+ return isRegionalTranscriptomics;
+ }
- public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
- this.isRegionalTranscriptomics = isRegionalTranscriptomics;
- }
+ public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
+ this.isRegionalTranscriptomics = isRegionalTranscriptomics;
+ }
- @Nullable
- public Double getCellTypeOrder() {
- return cellTypeOrder;
- }
+ @Nullable
+ public Double getCellTypeOrder() {
+ return cellTypeOrder;
+ }
- public void setCellTypeOrder(Double cellTypeOrder) {
- this.cellTypeOrder = cellTypeOrder;
- }
+ public void setCellTypeOrder(Double cellTypeOrder) {
+ this.cellTypeOrder = cellTypeOrder;
+ }
- @Nullable
- public String getCellType() {
- return cellType;
- }
+ @Nullable
+ public String getCellType() {
+ return cellType;
+ }
- public void setCellType(String cellType) {
- this.cellType = cellType;
- }
+ public void setCellType(String cellType) {
+ this.cellType = cellType;
+ }
}
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyId.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyId.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cluster/Cluster.java b/src/main/java/org/kpmp/cluster/Cluster.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/cluster/ClusterRepository.java b/src/main/java/org/kpmp/cluster/ClusterRepository.java
old mode 100644
new mode 100755
index 2d9594e..9d0d459
--- a/src/main/java/org/kpmp/cluster/ClusterRepository.java
+++ b/src/main/java/org/kpmp/cluster/ClusterRepository.java
@@ -2,13 +2,16 @@
import java.util.List;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.CrudRepository;
public interface ClusterRepository extends CrudRepository {
@Override
+ @Cacheable("cluster")
List findAll();
+ @Cacheable("clusterAbbrev")
List findByAbbreviation(String abbreviation);
}
diff --git a/src/main/java/org/kpmp/cluster/ClusterService.java b/src/main/java/org/kpmp/cluster/ClusterService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java
new file mode 100644
index 0000000..0c94d87
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformation.java
@@ -0,0 +1,49 @@
+package org.kpmp.dataSummary;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+public class AtlasRepoSummaryLinkInformation {
+
+ private String linkType;
+ private String linkValue;
+
+ public AtlasRepoSummaryLinkInformation(String linkType, String linkValue) {
+ this.setLinkType(linkType);
+ this.setLinkValue(linkValue);
+ }
+
+ public String getLinkType() {
+ return linkType;
+ }
+
+ public void setLinkType(String linkType) {
+ this.linkType = linkType;
+ }
+
+ public String getLinkValue() {
+ return linkValue;
+ }
+
+ public void setLinkValue(String linkValue) {
+ this.linkValue = linkValue;
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(linkType).append(linkValue).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof AtlasRepoSummaryLinkInformation) {
+ final AtlasRepoSummaryLinkInformation other = (AtlasRepoSummaryLinkInformation) obj;
+ return new EqualsBuilder().append(linkType, other.getLinkType()).append(linkValue, other.getLinkValue())
+ .isEquals();
+ } else {
+ return false;
+ }
+
+ }
+
+}
diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java
new file mode 100644
index 0000000..639679b
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRepository.java
@@ -0,0 +1,14 @@
+package org.kpmp.dataSummary;
+
+import java.util.List;
+
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.repository.CrudRepository;
+
+interface AtlasRepoSummaryRepository extends CrudRepository {
+
+ @Override
+ @Cacheable("repoSummaryCounts")
+ List findAll();
+
+}
diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java
new file mode 100644
index 0000000..387037d
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryResult.java
@@ -0,0 +1,37 @@
+package org.kpmp.dataSummary;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AtlasRepoSummaryResult {
+
+ private List summaryRows;
+ private int totalFiles;
+
+ public AtlasRepoSummaryResult(List summaryRows, int totalFiles) {
+ this.summaryRows = summaryRows;
+ this.totalFiles = totalFiles;
+
+ }
+
+ public AtlasRepoSummaryResult() {
+ summaryRows = new ArrayList<>();
+ }
+
+ public List getSummaryRows() {
+ return summaryRows;
+ }
+
+ public void setSummaryRows(List summaryRows) {
+ this.summaryRows = summaryRows;
+ }
+
+ public int getTotalFiles() {
+ return totalFiles;
+ }
+
+ public void setTotalFiles(int totalFiles) {
+ this.totalFiles = totalFiles;
+ }
+
+}
diff --git a/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java
new file mode 100644
index 0000000..60e356a
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java
@@ -0,0 +1,53 @@
+package org.kpmp.dataSummary;
+
+public class AtlasRepoSummaryRow {
+ private int openCount;
+ private int controlledCount;
+ private String omicsType;
+ private AtlasRepoSummaryLinkInformation linkInformation;
+
+ public AtlasRepoSummaryRow(String omicsType, AtlasRepoSummaryLinkInformation linkInformation) {
+ this.omicsType = omicsType;
+ this.linkInformation = linkInformation;
+ }
+
+ public int getOpenCount() {
+ return openCount;
+ }
+
+ public void setOpenCount(int openCount) {
+ this.openCount = openCount;
+ }
+
+ public int getControlledCount() {
+ return controlledCount;
+ }
+
+ public void setControlledCount(int controlledCount) {
+ this.controlledCount = controlledCount;
+ }
+
+ public String getOmicsType() {
+ return omicsType;
+ }
+
+ public void setOmicsType(String omicsType) {
+ this.omicsType = omicsType;
+ }
+
+ public void addToControlledCount(int count) {
+ this.controlledCount = this.controlledCount + count;
+ }
+
+ public void addToOpenCount(int count) {
+ this.openCount = this.openCount + count;
+ }
+
+ public AtlasRepoSummaryLinkInformation getLinkInformation() {
+ return linkInformation;
+ }
+
+ public void setLinkInformation(AtlasRepoSummaryLinkInformation linkInformation) {
+ this.linkInformation = linkInformation;
+ }
+}
diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java b/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java
old mode 100644
new mode 100755
index 95b3fc2..a0f4d87
--- a/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java
+++ b/src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java
@@ -28,9 +28,11 @@ public interface DataSummaryRepository extends CrudRepository getSummaryData() {
- List summaryData = new ArrayList<>();
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(),
- DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName())));
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName(),
- DataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D.getAbbreviation(),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName())));
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName(),
- DataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES.getAbbreviation(),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName())));
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.CODEX_FULL.getFullName(),
- DataTypeEnum.CODEX.getAbbreviation(),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.CODEX_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName())));
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName(),
- DataTypeEnum.SPATIAL_LIPIDOMICS.getAbbreviation(),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName())));
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName(),
- DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation(),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName())));
-
- summaryData.add(new DatasetSummary(
- OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
- FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName(),
- DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation(),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
- dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
- dataSummaryRepository.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName())));
+ public AtlasRepoSummaryResult getAtlasRepoSummary() throws Exception {
+ List experimentalStrategies = repoSummaryRepository.findAll();
+ Map summaryMap = new HashMap<>();
+ int totalFiles = 0;
+ for (ExperimentalStrategyValue experimentalStrategyValue : experimentalStrategies) {
+ String experimentalStrategy = experimentalStrategyValue.getExperimentalStrategy();
+ if (experimentalStrategy.isEmpty()
+ && experimentalStrategyValue.getDataType().equalsIgnoreCase(CLINICAL_STUDY_DATA)) {
+ experimentalStrategy = CLINICAL_STUDY_DATA;
+ } else if (experimentalStrategyValue.getDataCategory().equalsIgnoreCase(BIOMARKER)) {
+ experimentalStrategy = BIOMARKERS;
+ }
+
+ if (summaryMap.containsKey(experimentalStrategy)) {
+ AtlasRepoSummaryRow atlasRepoSummaryRow = summaryMap.get(experimentalStrategy);
+ setCounts(experimentalStrategyValue, atlasRepoSummaryRow);
+ totalFiles += experimentalStrategyValue.getCount();
+ } else {
+ AtlasRepoSummaryRow row = new AtlasRepoSummaryRow(experimentalStrategy,
+ getLinkInformation(experimentalStrategyValue));
+ setCounts(experimentalStrategyValue, row);
+ summaryMap.put(experimentalStrategy, row);
+ totalFiles += experimentalStrategyValue.getCount();
+ }
+ }
+
+ Collection values = summaryMap.values();
+ List results = new ArrayList<>(values);
+ results.sort(new Comparator() {
+ @Override
+ public int compare(AtlasRepoSummaryRow one, AtlasRepoSummaryRow two) {
+ return one.getOmicsType().compareToIgnoreCase(two.getOmicsType());
+ }
+ });
+
+ return new AtlasRepoSummaryResult(results, totalFiles);
+ }
+
+ private AtlasRepoSummaryLinkInformation getLinkInformation(ExperimentalStrategyValue experimentalStrategy) {
+ if (experimentalStrategy.getDataCategory().equalsIgnoreCase(BIOMARKER)
+ || experimentalStrategy.getDataType().equalsIgnoreCase(CLINICAL_STUDY_DATA)) {
+ return new AtlasRepoSummaryLinkInformation(DATA_CATEGORY, experimentalStrategy.getDataCategory());
+ } else {
+ return new AtlasRepoSummaryLinkInformation(EXPERIMENTAL_STRATEGY,
+ experimentalStrategy.getExperimentalStrategy());
+ }
+ }
+
+ private void setCounts(ExperimentalStrategyValue experimentalStrategyValue, AtlasRepoSummaryRow atlasRepoSummaryRow)
+ throws Exception {
+ if (experimentalStrategyValue.getAccess().equalsIgnoreCase(OPEN_ACCESS)) {
+ atlasRepoSummaryRow.addToOpenCount(experimentalStrategyValue.getCount());
+ } else if (experimentalStrategyValue.getAccess().equalsIgnoreCase(CONTROLLED_ACCESS)) {
+ atlasRepoSummaryRow.addToControlledCount(experimentalStrategyValue.getCount());
+ } else {
+ throw new Exception(
+ "Unexpected access value while getting summary counts: " + experimentalStrategyValue.getAccess());
+ }
+ }
+
+ public List getSummaryData() {
+ List summaryData = new ArrayList<>();
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(),
+ DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
+ dataSummaryRepository
+ .getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName())));
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName(),
+ DataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
+ dataSummaryRepository.getParticipantSummaryCount(
+ FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName())));
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName(),
+ DataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
+ dataSummaryRepository.getParticipantSummaryCount(
+ FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName())));
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.CODEX_FULL.getFullName(), DataTypeEnum.CODEX.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.CODEX_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.CODEX_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.CODEX_FULL.getFullName()),
+ dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName())));
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName(),
+ DataTypeEnum.SPATIAL_LIPIDOMICS.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryLinkCount(
+ TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
+ dataSummaryRepository
+ .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName())));
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName(),
+ DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryLinkCount(
+ TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
+ dataSummaryRepository
+ .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName())));
+
+ summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName(),
+ DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation(),
+ dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.AKI.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.CKD.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
+ dataSummaryRepository.getDataSummaryLinkCount(
+ TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
+ FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
+ dataSummaryRepository
+ .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName())));
return summaryData;
}
}
diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java
old mode 100644
new mode 100755
index ce2ad5c..476517c
--- a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java
+++ b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java
@@ -1,14 +1,18 @@
package org.kpmp.dataSummary;
-import org.springframework.lang.Nullable;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
+import org.springframework.lang.Nullable;
+
@Entity
@Table(name = "sv_file_v")
-public class DataSummaryValue {
+public class DataSummaryValue implements Serializable {
+ private static final long serialVersionUID = -1934662137113288596L;
@Id
@Column(name = "file_id")
private Integer fileId;
@@ -24,9 +28,9 @@ public class DataSummaryValue {
private String fileName;
@Column(name = "package_id")
private String packageId;
- @Column(name = "file_size")
+ @Column(name = "file_size")
private Long fileSize;
- @Column(name = "participant_id")
+ @Column(name = "participant_id")
private Integer participantId;
@Column(name = "redcap_id")
private String redcapId;
@@ -36,130 +40,130 @@ public class DataSummaryValue {
private String protocol;
@Column(name = "sample_type")
private String sampleType;
- @Column(name = "sex")
+ @Column(name = "sex")
private String sex;
- @Column(name = "tissue_source")
+ @Column(name = "tissue_source")
private String tissueSource;
- @Column(name = "tissue_type")
+ @Column(name = "tissue_type")
private String tissueType;
- @Column(name = "spectrack_sample_id")
+ @Column(name = "spectrack_sample_id")
private String spectrackSampleId;
@Nullable
public Integer getFileId() {
return fileId;
}
-
+
public void setFileId(Integer fileId) {
this.fileId = fileId;
}
-
+
@Nullable
public String getConfigType() {
return configType;
}
-
+
public void setConfigType(String configType) {
this.configType = configType;
}
-
+
@Nullable
public String getImageType() {
return imageType;
}
-
+
public void setImageType(String imageType) {
this.imageType = imageType;
}
-
+
@Nullable
public String getDataType() {
return dataType;
}
-
+
public void setDataType(String dataType) {
this.dataType = dataType;
}
-
+
public String getDlFileId() {
return dlFileId;
}
-
+
public void setDlFileIdd(String dlFileId) {
this.dlFileId = dlFileId;
}
-
+
public String getFileName() {
return fileName;
}
-
+
public void setFileName(String fileName) {
this.fileName = fileName;
}
-
+
@Nullable
public String getPackageId() {
return packageId;
}
-
+
public void setPackageId(String packageId) {
this.packageId = packageId;
}
-
+
@Nullable
public Long getFileSize() {
return fileSize;
}
-
+
public void setFileSize(Long fileSize) {
this.fileSize = fileSize;
}
-
+
@Nullable
public Integer getParticipantId() {
return participantId;
}
-
+
public void setParticipantId(Integer participantId) {
this.participantId = participantId;
}
-
+
@Nullable
public String getRedcapId() {
return redcapId;
}
-
+
public void setRedcapId(String redcapId) {
this.redcapId = redcapId;
}
-
+
@Nullable
public String getAge() {
return age;
}
-
+
public void setAge(String age) {
this.age = age;
}
-
+
@Nullable
public String getProtocol() {
return protocol;
}
-
+
public void setProtocol(String protocol) {
this.protocol = protocol;
}
-
+
@Nullable
public String getSampleType() {
return sampleType;
}
-
+
public void setSampleType(String sampleType) {
this.sampleType = sampleType;
}
-
+
@Nullable
public String getSex() {
return sex;
@@ -173,7 +177,7 @@ public void setSex(String sex) {
public String getTissueSource() {
return tissueSource;
}
-
+
public void setTissueSource(String tissueSource) {
this.tissueSource = tissueSource;
}
@@ -186,7 +190,7 @@ public String getTissueType() {
public void setTissueType(String tissueType) {
this.tissueType = tissueType;
}
-
+
@Nullable
public String getSpectrackSampleId() {
return spectrackSampleId;
diff --git a/src/main/java/org/kpmp/dataSummary/DataTypeSummary.java b/src/main/java/org/kpmp/dataSummary/DataTypeSummary.java
new file mode 100755
index 0000000..819a9ca
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/DataTypeSummary.java
@@ -0,0 +1,81 @@
+package org.kpmp.dataSummary;
+
+import java.io.Serializable;
+
+public class DataTypeSummary implements Serializable {
+ private static final long serialVersionUID = 114808450473696153L;
+ private String omicsType;
+ private String dataType;
+ private String dataTypeShort;
+ private Long akiCount;
+ private Long ckdCount;
+ private Long hrtCount;
+ private Long participantCount;
+
+ public DataTypeSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount,
+ Long hrtCount, Long participantCount) {
+ this.omicsType = omicsType;
+ this.dataType = dataType;
+ this.dataTypeShort = dataTypeShort;
+ this.akiCount = akiCount;
+ this.ckdCount = ckdCount;
+ this.hrtCount = hrtCount;
+ this.participantCount = participantCount;
+ }
+
+ public String getOmicsType() {
+ return this.omicsType;
+ }
+
+ public void setOmicsType(String omicsType) {
+ this.omicsType = omicsType;
+ }
+
+ public String getDataType() {
+ return this.dataType;
+ }
+
+ public void setDataTypeType(String dataType) {
+ this.dataType = dataType;
+ }
+
+ public String getDataTypeShort() {
+ return this.dataTypeShort;
+ }
+
+ public void setDataTypeShort(String dataTypeShort) {
+ this.dataTypeShort = dataTypeShort;
+ }
+
+ public Long getAkiCount() {
+ return this.akiCount;
+ }
+
+ public void setAkiCount(Long akiCount) {
+ this.akiCount = akiCount;
+ }
+
+ public Long getCkdCount() {
+ return this.ckdCount;
+ }
+
+ public void setCkdCount(Long ckdCount) {
+ this.ckdCount = ckdCount;
+ }
+
+ public Long getHrtCount() {
+ return this.hrtCount;
+ }
+
+ public void setHrtCount(Long hrtCount) {
+ this.hrtCount = hrtCount;
+ }
+
+ public Long getParticipantCount() {
+ return this.participantCount;
+ }
+
+ public void setParticipantCount(Long participantCount) {
+ this.participantCount = participantCount;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java
new file mode 100644
index 0000000..ddbe8d1
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyId.java
@@ -0,0 +1,28 @@
+package org.kpmp.dataSummary;
+
+import java.io.Serializable;
+
+public class ExperimentalStrategyId implements Serializable {
+
+ private static final long serialVersionUID = 938153099192129678L;
+
+ private String experimentalStrategy;
+ private String access;
+
+ public String getExperimentalStrategy() {
+ return experimentalStrategy;
+ }
+
+ public void setExperimentalStrategy(String experimentalStrategy) {
+ this.experimentalStrategy = experimentalStrategy;
+ }
+
+ public String getAccess() {
+ return access;
+ }
+
+ public void setAccess(String access) {
+ this.access = access;
+ }
+
+}
diff --git a/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java
new file mode 100644
index 0000000..99d0887
--- /dev/null
+++ b/src/main/java/org/kpmp/dataSummary/ExperimentalStrategyValue.java
@@ -0,0 +1,64 @@
+package org.kpmp.dataSummary;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "repository_summary_v")
+@IdClass(ExperimentalStrategyId.class)
+public class ExperimentalStrategyValue implements Serializable {
+
+ private static final long serialVersionUID = 8063582327279878125L;
+ private int count;
+ @Id
+ private String experimentalStrategy;
+ @Id
+ private String access;
+ private String dataType;
+ private String dataCategory;
+
+ public int getCount() {
+ return count;
+ }
+
+ public void setCount(int count) {
+ this.count = count;
+ }
+
+ public String getExperimentalStrategy() {
+ return experimentalStrategy;
+ }
+
+ public void setExperimentalStrategy(String experimentalStrategy) {
+ this.experimentalStrategy = experimentalStrategy;
+ }
+
+ public String getAccess() {
+ return access;
+ }
+
+ public void setAccess(String access) {
+ this.access = access;
+ }
+
+ public String getDataType() {
+ return dataType;
+ }
+
+ public void setDataType(String dataType) {
+ this.dataType = dataType;
+ }
+
+ public String getDataCategory() {
+ return dataCategory;
+ }
+
+ public void setDataCategory(String dataCategory) {
+ this.dataCategory = dataCategory;
+ }
+
+}
diff --git a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java b/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java
deleted file mode 100644
index de0d659..0000000
--- a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.kpmp.datasetSummary;
-
-public class DatasetSummary {
- private String omicsType;
- private String dataType;
- private String dataTypeShort;
- private Long akiCount;
- private Long ckdCount;
- private Long hrtCount;
- private Long participantCount;
-
- public DatasetSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount, Long hrtCount, Long participantCount) {
- this.omicsType = omicsType;
- this.dataType = dataType;
- this.dataTypeShort = dataTypeShort;
- this.akiCount = akiCount;
- this.ckdCount = ckdCount;
- this.hrtCount = hrtCount;
- this.participantCount = participantCount;
- }
- public String getOmicsType() {
- return this.omicsType;
- }
- public void setOmicsType(String omicsType) {
- this.omicsType = omicsType;
- }
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataTypeType(String dataType) {
- this.dataType = dataType;
- }
-
- public String getDataTypeShort() {
- return this.dataTypeShort;
- }
- public void setDataTypeShort(String dataTypeShort) {
- this.dataTypeShort = dataTypeShort;
- }
-
- public Long getAkiCount() {
- return this.akiCount;
- }
-
- public void setAkiCount(Long akiCount) {
- this.akiCount = akiCount;
- }
-
- public Long getCkdCount() {
- return this.ckdCount;
- }
-
- public void setCkdCount(Long ckdCount) {
- this.ckdCount = ckdCount;
- }
-
- public Long getHrtCount() {
- return this.hrtCount;
- }
-
- public void setHrtCount(Long hrtCount) {
- this.hrtCount = hrtCount;
- }
-
- public Long getParticipantCount() {
- return this.participantCount;
- }
-
- public void setParticipantCount(Long participantCount) {
- this.participantCount = participantCount;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/errors/ErrorController.java b/src/main/java/org/kpmp/errors/ErrorController.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/errors/FrontEndError.java b/src/main/java/org/kpmp/errors/FrontEndError.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/gene/GeneService.java b/src/main/java/org/kpmp/gene/GeneService.java
old mode 100644
new mode 100755
index 2ebf3a8..ed16a67
--- a/src/main/java/org/kpmp/gene/GeneService.java
+++ b/src/main/java/org/kpmp/gene/GeneService.java
@@ -14,6 +14,7 @@
import org.kpmp.Query;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -65,13 +66,14 @@ HttpURLConnection getUrlConnection(URL queryUrl) throws IOException {
return (HttpURLConnection) queryUrl.openConnection();
}
+ @Cacheable("geneSymbolAlias")
public List querySymbolAndAlias(String queryString) throws IOException, Exception {
List symbolResults = query(GET_MY_GENE_INFO_QUERY_SYMBOL, queryString).getHits();
List aliasResults = query(GET_MY_GENE_INFO_QUERY_ALIAS, queryString).getHits();
List finalResults = new ArrayList<>();
finalResults.addAll(sortAndSlice(symbolResults, 10));
finalResults.addAll(sortAndSlice(aliasResults, 10));
- return finalResults.size() <= 10 ? finalResults : finalResults.subList(0, 10);
+ return finalResults.size() <= 10 ? finalResults : new ArrayList<>(finalResults.subList(0, 10));
}
private List sortAndSlice(List hits, int max) {
@@ -79,7 +81,7 @@ private List sortAndSlice(List hits, int max) {
return new ArrayList();
}
Collections.sort(hits);
- return hits.size() <= max ? hits : hits.subList(0, max);
+ return hits.size() <= max ? hits : new ArrayList<>(hits.subList(0, max));
}
}
diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java
old mode 100644
new mode 100755
index 4d66ae3..82cf3bc
--- a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java
+++ b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java
@@ -1,61 +1,63 @@
package org.kpmp.gene;
+import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
-public class MyGeneInfoHit implements Comparable {
- private String id;
- private String symbol;
- private String name;
- private String entrezgene;
- @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
- private List alias;
-
- public String getId() {
- return id;
- }
-
- @JsonProperty("_id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSymbol() {
- return symbol;
- }
-
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
-
- public String getEntrezgene() {
- return entrezgene;
- }
-
- public void setEntrezgene(String entrezgene) {
- this.entrezgene = entrezgene;
- }
-
- public List getAlias() {
- return alias;
- }
-
- public void setAlias(List alias) {
- this.alias = alias;
- }
-
- @Override
- public int compareTo(MyGeneInfoHit hit) {
- return this.getSymbol().compareTo(hit.getSymbol());
- }
+public class MyGeneInfoHit implements Comparable, Serializable {
+ private static final long serialVersionUID = 7498017467676968095L;
+ private String id;
+ private String symbol;
+ private String name;
+ private String entrezgene;
+ @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+ private List alias;
+
+ public String getId() {
+ return id;
+ }
+
+ @JsonProperty("_id")
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public String getEntrezgene() {
+ return entrezgene;
+ }
+
+ public void setEntrezgene(String entrezgene) {
+ this.entrezgene = entrezgene;
+ }
+
+ public List getAlias() {
+ return alias;
+ }
+
+ public void setAlias(List alias) {
+ this.alias = alias;
+ }
+
+ @Override
+ public int compareTo(MyGeneInfoHit hit) {
+ return this.getSymbol().compareTo(hit.getSymbol());
+ }
}
diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java
old mode 100644
new mode 100755
index 5cc8457..2214db2
--- a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java
+++ b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java
@@ -1,24 +1,26 @@
package org.kpmp.gene;
+import java.io.Serializable;
import java.util.List;
-public class MyGeneInfoResult {
- private int total;
- private List hits;
+public class MyGeneInfoResult implements Serializable {
+ private static final long serialVersionUID = 2296351561705106315L;
+ private int total;
+ private List hits;
- public int getTotal() {
- return total;
- }
+ public int getTotal() {
+ return total;
+ }
- public void setTotal(int total) {
- this.total = total;
- }
+ public void setTotal(int total) {
+ this.total = total;
+ }
- public List getHits() {
- return hits;
- }
+ public List getHits() {
+ return hits;
+ }
- public void setHits(List hits) {
- this.hits = hits;
- }
+ public void setHits(List hits) {
+ this.hits = hits;
+ }
}
diff --git a/src/main/java/org/kpmp/geneExpression/ExpressionDataService.java b/src/main/java/org/kpmp/geneExpression/ExpressionDataService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionByTissueType.java b/src/main/java/org/kpmp/geneExpression/RTExpressionByTissueType.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionData.java b/src/main/java/org/kpmp/geneExpression/RTExpressionData.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
old mode 100644
new mode 100755
index 0d269c0..30cb93b
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -7,8 +9,9 @@
@Entity
@Table(name = "rt_segments")
-public class RTExpressionDataAllSegments implements RTExpressionData {
+public class RTExpressionDataAllSegments implements RTExpressionData, Serializable {
+ private static final long serialVersionUID = 9029734049386312455L;
@Id
@Column(name = "id")
private Integer id;
@@ -121,10 +124,12 @@ public void setSampleCount(Integer sampleCount) {
this.sampleCount = sampleCount;
}
+ @Override
public String getSegmentName() {
return segmentName;
}
+ @Override
public void setSegmentName(String segmentName) {
this.segmentName = segmentName;
}
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java
old mode 100644
new mode 100755
index 592fdcb..f974986
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsRepository.java
@@ -2,6 +2,7 @@
import java.util.List;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
@@ -9,15 +10,18 @@
@Repository
public interface RTExpressionDataAllSegmentsRepository extends CrudRepository {
+ @Cacheable("rtExpGeneSymbolAndTissueTypeWithCounts")
@Query(value = "SELECT rts.*, rsv.sample_count, s.segment_name FROM rt_segments rts "
+ "LEFT JOIN rt_summary_v rsv ON rts.segment = rsv.segment AND rts.tissue_type = rsv.tissue_type "
+ "LEFT JOIN segment s on rts.segment = s.abbreviation "
+ "WHERE rts.tissue_type = :tissueType AND rts.gene_symbol = :geneSymbol", nativeQuery = true)
List findByGeneSymbolAndTissueTypeWithCounts(String geneSymbol, String tissueType);
+ @Cacheable("rtExpByStructure")
@Query(value = "CALL rt_diffex_sp(:structure);", nativeQuery = true)
List findByStructure(@Param("structure") String structure);
+ @Cacheable("rtExpCountByGene")
@Query(value = "SELECT COUNT(*) FROM rt_segments WHERE gene_symbol = :gene", nativeQuery = true)
long getCountByGene(@Param("gene") String gene);
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java
old mode 100644
new mode 100755
index ba5f6a9..0a33cf2
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -7,8 +9,9 @@
@Entity
@Table(name = "rt_gti")
-public class RTExpressionDataGTI implements RTExpressionData {
+public class RTExpressionDataGTI implements RTExpressionData, Serializable {
+ private static final long serialVersionUID = 4789000526795024990L;
@Id
@Column(name = "id")
private Integer id;
@@ -121,10 +124,12 @@ public void setSampleCount(Integer sampleCount) {
this.sampleCount = sampleCount;
}
+ @Override
public String getSegmentName() {
return segmentName;
}
+ @Override
public void setSegmentName(String segmentName) {
this.segmentName = segmentName;
}
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java
old mode 100644
new mode 100755
index 241bf7d..3b7b4eb
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTIRepository.java
@@ -2,12 +2,14 @@
import java.util.List;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface RTExpressionDataGTIRepository extends CrudRepository {
+ @Cacheable("rtGTIByGeneAndTissue")
@Query(value = "SELECT rtg.*, rsv.sample_count, s.segment_name FROM rt_gti rtg "
+ "LEFT JOIN rt_summary_v rsv ON rtg.segment = rsv.segment AND rtg.tissue_type = rsv.tissue_type "
+ "LEFT JOIN segment s on rtg.segment = s.abbreviation "
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataService.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
old mode 100644
new mode 100755
index 71d80cc..7a738ff
--- a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
+++ b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -10,8 +12,9 @@
@Entity
@Table(name = "sc_feature_data")
-class SCExpressionData {
+class SCExpressionData implements Serializable {
+ private static final long serialVersionUID = 1079445825708102694L;
@Id
@Column(name = "gene_symbol")
private String geneSymbol;
diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java b/src/main/java/org/kpmp/geneExpression/SCExpressionDataRepository.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
old mode 100644
new mode 100755
index 1ecd5f2..1e21871
--- a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
+++ b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -10,8 +12,9 @@
@Entity
@Table(name = "sn_feature_data")
-class SNExpressionData {
+class SNExpressionData implements Serializable {
+ private static final long serialVersionUID = -3363426907715685587L;
@Id
@Column(name = "gene_symbol")
private String geneSymbol;
diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java b/src/main/java/org/kpmp/geneExpression/SNExpressionDataRepository.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionId.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionId.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummary.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java
old mode 100644
new mode 100755
index 0e32c16..91e0452
--- a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java
@@ -8,7 +8,7 @@
import org.kpmp.FullDataTypeEnum;
import org.kpmp.OmicsTypeEnum;
import org.kpmp.TissueTypeEnum;
-import org.kpmp.datasetSummary.DatasetSummary;
+import org.kpmp.dataSummary.DataTypeSummary;
import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -110,23 +110,23 @@ public List findDataTypesByGene(String gene) {
return dataTypes;
}
- public List getGeneDatasetInformation(String geneSymbol) {
- List geneSummary = new ArrayList<>();
- geneSummary.add(new DatasetSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ public List getGeneDatasetInformation(String geneSymbol) {
+ List geneSummary = new ArrayList<>();
+ geneSummary.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(),
scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.AKI.getParticipantTissueType()),
scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.CKD.getParticipantTissueType()),
scrnaGeneExpressionRepository
.getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()),
scrnaParticipantRepository.getParticipantCount()));
- geneSummary.add(new DatasetSummary(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(),
+ geneSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(), FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(),
DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(),
snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.AKI.getParticipantTissueType()),
snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.CKD.getParticipantTissueType()),
snrnaGeneExpressionRepository
.getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()),
snrnaParticipantRepository.getParticipantCount()));
- geneSummary.add(new DatasetSummary(OmicsTypeEnum.NONE.getEnum(),
+ geneSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS_FULL.getFullName(),
DataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation(),
rtParticipantRepository.getCountByTissueType(TissueTypeEnum.AKI.getParticipantTissueType()),
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/Participant.java b/src/main/java/org/kpmp/geneExpressionSummary/Participant.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/ParticipantId.java b/src/main/java/org/kpmp/geneExpressionSummary/ParticipantId.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java
old mode 100644
new mode 100755
index 641b574..08dd2cd
--- a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantRepository.java
@@ -10,7 +10,7 @@ public interface RTParticipantRepository extends CrudRepository {
- @Cacheable("scCounts")
+ @Cacheable("scCountsAllClusters")
@Query(value = "SELECT DISTINCT scc.cluster, scc.cluster_name, scc.cell_count, scc.cluster_id as id, IF(isnull(scr.tissue_type), :tissueType, scr.tissue_type) as tissue_type, IF(isnull(scr.gene), :geneSymbol, scr.gene) as gene, scr.p_val as p_val, scr.p_val_adj as p_val_adj, scr.fold_change, scr.pct_1, scr.pct_2, scr.avg_exp as avg_exp "
+ "FROM sc_cluster_v scc "
+ "LEFT JOIN sc_rnaseq scr ON scc.cluster = scr.cluster AND scr.gene = :geneSymbol AND scr.tissue_type = LCASE(:tissueType) "
@@ -20,18 +20,18 @@ public interface SCRNAGeneExpressionSummaryRepository
List findByTissueAndGeneAllClusters(
@Param("geneSymbol") String geneSymbol, @Param("tissueType") String tissueType);
- @Cacheable("scCounts")
+ @Cacheable("scCountsSummaryPerGene")
@Query(value = "SELECT DISTINCT scr.cluster, c.cluster_name, 0 as cell_count, scr.id, scr.tissue_type, scr.gene, scr.p_val as p_val, scr.p_val_adj as p_val_adj, scr.fold_change, scr.pct_1, scr.pct_2, scr.avg_exp as avg_exp "
+ "FROM sc_rnaseq scr " + "JOIN cluster c ON scr.cluster = c.abbreviation AND c.cluster_name = :cellType "
+ "WHERE scr.tissue_type = LCASE(:tissueType) " + "ORDER BY scr.fold_change DESC", nativeQuery = true)
List findExpressionSummaryPerGeneByCellTypeAndTissueType(
@Param("cellType") String cellType, @Param("tissueType") String tissueType);
- @Cacheable("scCounts")
+ @Cacheable("scCountsByGene")
@Query(value = "SELECT COUNT(*) FROM sc_rnaseq scr WHERE scr.gene= :gene", nativeQuery = true)
long getCountByGene(@Param("gene") String gene);
- @Cacheable("scCounts")
+ @Cacheable("scCountsByTissue")
@Query(value = "select count(*) from (select p.redcap_id from sc_metadata sc "
+ "join participant p on sc.specimen_id = p.redcap_id "
+ "where p.tissue_type=:tissueType group by p.redcap_id) as mycount", nativeQuery = true)
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java
old mode 100644
new mode 100755
index f5eddae..08c5e71
--- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantRepository.java
@@ -1,11 +1,13 @@
package org.kpmp.geneExpressionSummary;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface SCRNAParticipantRepository extends CrudRepository {
+ @Cacheable("scParticipantCount")
@Query(value = "SELECT COUNT(DISTINCT scp.redcap_id) FROM sc_participant_tissue_v scp", nativeQuery = true)
Long getParticipantCount();
}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java
old mode 100644
new mode 100755
index 7a583f0..a758ab5
--- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpressionSummary;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -9,7 +11,9 @@
@Entity
@Table(name = "sn_participant_tissue_v")
@IdClass(ParticipantId.class)
-public class SCRNAParticipantValue {
+public class SCRNAParticipantValue implements Serializable {
+
+ private static final long serialVersionUID = 8746341469788157316L;
@Column(name = "tissue_type")
private String tissueType;
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java
old mode 100644
new mode 100755
index 51aeabe..7093151
--- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java
@@ -1,7 +1,6 @@
package org.kpmp.geneExpressionSummary;
-import org.kpmp.DataTypeEnum;
-import org.springframework.lang.Nullable;
+import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -10,10 +9,15 @@
import javax.persistence.Table;
import javax.persistence.Transient;
+import org.kpmp.DataTypeEnum;
+import org.springframework.lang.Nullable;
+
@Entity
@Table(name = "sn_rnaseq")
@IdClass(GeneExpressionId.class)
-public class SNRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary {
+public class SNRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable {
+
+ private static final long serialVersionUID = -443713903175981503L;
@Column(name = "id")
private Integer id;
@@ -95,20 +99,24 @@ public void setGene(String gene) {
this.gene = gene;
}
+ @Override
@Nullable
public Double getPVal() {
return pVal;
}
+ @Override
public void setPVal(Double pVal) {
this.pVal = pVal;
}
+ @Override
@Nullable
public Double getPValAdj() {
return pValAdj;
}
+ @Override
public void setPValAdj(Double pValAdj) {
this.pValAdj = pValAdj;
}
@@ -202,6 +210,7 @@ public boolean equals(Object obj) {
if (!(obj instanceof SNRNAGeneExpressionExpressionSummaryValue))
return false;
SNRNAGeneExpressionExpressionSummaryValue snrnaGeneExpressionExpressionSummaryValue = (SNRNAGeneExpressionExpressionSummaryValue) obj;
- return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene()) && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster()));
+ return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene())
+ && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster()));
}
}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java
old mode 100644
new mode 100755
index 2eef341..9f79f93
--- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryRepository.java
@@ -12,7 +12,7 @@
public interface SNRNAGeneExpressionSummaryRepository
extends CrudRepository {
- @Cacheable("snCounts")
+ @Cacheable("snCountsBy")
@Query(value = "SELECT DISTINCT snc.cluster, snc.cluster_name, snc.cell_count as cell_count, snc.cluster_id as id, IF(isnull(snr.tissue_type), :tissueType, snr.tissue_type) as tissue_type, IF(isnull(snr.gene), :geneSymbol, snr.gene) as gene, snr.p_val as pval, snr.p_val_adj as pval_adj, snr.fold_change, snr.pct_1 as pct1, snr.pct_2 as pct2, snr.avg_exp as avg_exp "
+ "FROM sn_cluster_v snc "
+ "LEFT JOIN sn_rnaseq snr ON snc.cluster = snr.cluster AND snr.gene = :geneSymbol AND snr.tissue_type = LCASE(:tissueType) "
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java
old mode 100644
new mode 100755
index 4a77bf3..6b306ba
--- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantRepository.java
@@ -1,11 +1,14 @@
package org.kpmp.geneExpressionSummary;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface SNRNAParticipantRepository extends CrudRepository {
+
+ @Cacheable("snParticipantCount")
@Query(value = "SELECT COUNT(DISTINCT snp.redcap_id) FROM sn_participant_tissue_v snp", nativeQuery = true)
Long getParticipantCount();
}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java
old mode 100644
new mode 100755
index d61ec4e..6c9dadc
--- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpressionSummary;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -9,7 +11,9 @@
@Entity
@Table(name = "sn_participant_tissue_v")
@IdClass(ParticipantId.class)
-public class SNRNAParticipantValue implements Participant {
+public class SNRNAParticipantValue implements Participant, Serializable {
+
+ private static final long serialVersionUID = -2404700991479961255L;
@Column(name = "tissue_type")
private String tissueType;
diff --git a/src/main/java/org/kpmp/logging/LoggingService.java b/src/main/java/org/kpmp/logging/LoggingService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeInformation.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java
old mode 100644
new mode 100755
index 39859e0..51ba482
--- a/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java
+++ b/src/main/java/org/kpmp/participant/ParticipantDataTypeSummary.java
@@ -6,10 +6,8 @@
@Component
public class ParticipantDataTypeSummary {
-
private List spatialViewerDataTypes;
private List explorerDataTypes;
-
public List getSpatialViewerDataTypes() {
return spatialViewerDataTypes;
}
@@ -25,5 +23,4 @@ public List getExplorerDataTypes() {
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
old mode 100644
new mode 100755
index 684abad..02a15bd
--- a/src/main/java/org/kpmp/participant/ParticipantService.java
+++ b/src/main/java/org/kpmp/participant/ParticipantService.java
@@ -4,6 +4,7 @@
import java.util.List;
import org.kpmp.FullDataTypeEnum;
+import org.kpmp.TissueTypeEnum;
import org.kpmp.dataSummary.DataSummaryRepository;
import org.kpmp.geneExpressionSummary.RTParticipantRepository;
import org.slf4j.Logger;
@@ -36,11 +37,21 @@ public ParticipantService(DataSummaryRepository dataSummaryRepo, SpatialViewerTy
this.rtParticipantRepo = rtParticipantRepo;
this.participantSummaryDatasetRepository = participantSummaryDatasetRepository;
}
-
+
public ParticipantSummaryDataset getParticipantSummaryDataset(String redcapId) {
return participantSummaryDatasetRepository.findByRedcapId(redcapId);
}
+ public List getTissueData(){
+ List tissueData = new ArrayList<>();
+
+ tissueData.add(new ParticipantTissueTypeSummary(
+ participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType()),
+ participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType()),
+ participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())));
+ return tissueData;
+ }
+
public ParticipantDataTypeSummary getExperimentCounts(String redcapId) {
ParticipantDataTypeSummary summaryData = new ParticipantDataTypeSummary();
summaryData.setSpatialViewerDataTypes(getSpatialViewerCounts(redcapId));
diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java
old mode 100644
new mode 100755
index 7b144a2..c90a5a0
--- a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java
+++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java
@@ -1,5 +1,7 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -7,105 +9,106 @@
@Entity
@Table(name = "participant")
-public class ParticipantSummaryDataset {
- @Id
- @Column(name = "participant_id")
- private int participantId;
- @Column(name = "old_participant_id")
- private String oldparticipantId;
- @Column(name = "redcap_id")
- private String redcapId;
- @Column(name = "age_binned")
- private String ageBinned;
- private String sex;
- @Column(name = "tissue_source")
- private String tissueSource;
- private String protocol;
- @Column(name = "sample_type")
- private String sampleType;
- @Column(name = "tissue_type")
- private String tissueType;
- @Column(name = "clinical_data")
- private String clinicalData;
-
- public int getParticipantId() {
- return participantId;
- }
-
- public void setParticipantId(int participantId) {
- this.participantId = participantId;
- }
-
- public String getOldParticipantId() {
- return oldparticipantId;
- }
-
- public void setOldParticipantId(String oldparticipantId) {
- this.oldparticipantId = oldparticipantId;
- }
-
- public String getRedcapId() {
- return redcapId;
- }
-
- public void setRedcapId(String redcapId) {
- this.redcapId = redcapId;
- }
-
- public String getAgeBinned() {
- return ageBinned;
- }
-
- public void setAgeBinned(String ageBinned) {
- this.ageBinned = ageBinned;
- }
-
- public String getSex() {
- return sex;
- }
-
- public void setSex(String sex) {
- this.sex = sex;
- }
-
- public String getTissueSource() {
- return tissueSource;
- }
-
- public void setTissueSource(String tissueSource) {
- this.tissueSource = tissueSource;
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- public String getSampleType() {
- return sampleType;
- }
-
- public void setSampleType(String sampleType) {
- this.sampleType = sampleType;
- }
-
- public String getTissueType() {
- return tissueType;
- }
-
- public void setTissueType(String tissueType) {
- this.tissueType = tissueType;
- }
-
- public String getClinicalData() {
- return clinicalData;
- }
-
- public void setClinicalData(String clinicalData) {
- this.clinicalData = clinicalData;
- }
+public class ParticipantSummaryDataset implements Serializable {
+ private static final long serialVersionUID = -6616360991151079273L;
+ @Id
+ @Column(name = "participant_id")
+ private int participantId;
+ @Column(name = "old_participant_id")
+ private String oldparticipantId;
+ @Column(name = "redcap_id")
+ private String redcapId;
+ @Column(name = "age_binned")
+ private String ageBinned;
+ private String sex;
+ @Column(name = "tissue_source")
+ private String tissueSource;
+ private String protocol;
+ @Column(name = "sample_type")
+ private String sampleType;
+ @Column(name = "tissue_type")
+ private String tissueType;
+ @Column(name = "clinical_data")
+ private String clinicalData;
+
+ public int getParticipantId() {
+ return participantId;
+ }
+
+ public void setParticipantId(int participantId) {
+ this.participantId = participantId;
+ }
+
+ public String getOldParticipantId() {
+ return oldparticipantId;
+ }
+
+ public void setOldParticipantId(String oldparticipantId) {
+ this.oldparticipantId = oldparticipantId;
+ }
+
+ public String getRedcapId() {
+ return redcapId;
+ }
+
+ public void setRedcapId(String redcapId) {
+ this.redcapId = redcapId;
+ }
+
+ public String getAgeBinned() {
+ return ageBinned;
+ }
+
+ public void setAgeBinned(String ageBinned) {
+ this.ageBinned = ageBinned;
+ }
+
+ public String getSex() {
+ return sex;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+ public String getTissueSource() {
+ return tissueSource;
+ }
+
+ public void setTissueSource(String tissueSource) {
+ this.tissueSource = tissueSource;
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ public String getSampleType() {
+ return sampleType;
+ }
+
+ public void setSampleType(String sampleType) {
+ this.sampleType = sampleType;
+ }
+
+ public String getTissueType() {
+ return tissueType;
+ }
+
+ public void setTissueType(String tissueType) {
+ this.tissueType = tissueType;
+ }
+
+ public String getClinicalData() {
+ return clinicalData;
+ }
+
+ public void setClinicalData(String clinicalData) {
+ this.clinicalData = clinicalData;
+ }
}
diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java
old mode 100644
new mode 100755
index d998cf7..6862bf6
--- a/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java
+++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDatasetRepository.java
@@ -1,12 +1,18 @@
package org.kpmp.participant;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
@Repository
-public interface ParticipantSummaryDatasetRepository extends CrudRepository {
+public interface ParticipantSummaryDatasetRepository extends CrudRepository {
+ @Cacheable("participantByRedcap")
ParticipantSummaryDataset findByRedcapId(@Param("redcap_id") String redcapId);
+ @Cacheable("partipantByTissueType")
+ @Query(value = "select count(*) from participant where tissue_type= :tissue_type", nativeQuery = true)
+ Long getDataSummaryCount(@Param("tissue_type") String tissue_type);
}
diff --git a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java
new file mode 100644
index 0000000..2c0b70f
--- /dev/null
+++ b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java
@@ -0,0 +1,40 @@
+package org.kpmp.participant;
+
+import java.io.Serializable;
+
+public class ParticipantTissueTypeSummary implements Serializable {
+ private static final long serialVersionUID = 4596059416539472482L;
+ private Long akiCount;
+ private Long ckdCount;
+ private Long hrtCount;
+
+ public ParticipantTissueTypeSummary(Long akiCount, Long ckdCount, Long hrtCount) {
+ this.akiCount = akiCount;
+ this.ckdCount = ckdCount;
+ this.hrtCount = hrtCount;
+ }
+
+ public Long getAkiCount() {
+ return this.akiCount;
+ }
+
+ public void setAkiCount(Long akiCount) {
+ this.akiCount = akiCount;
+ }
+
+ public Long getCkdCount() {
+ return this.ckdCount;
+ }
+
+ public void setCkdCount(Long ckdCount) {
+ this.ckdCount = ckdCount;
+ }
+
+ public Long getHrtCount() {
+ return this.hrtCount;
+ }
+
+ public void setHrtCount(Long hrtCount) {
+ this.hrtCount = hrtCount;
+ }
+}
diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadata.java b/src/main/java/org/kpmp/participant/SingleCellMetadata.java
old mode 100644
new mode 100755
index df60828..6dc4c08
--- a/src/main/java/org/kpmp/participant/SingleCellMetadata.java
+++ b/src/main/java/org/kpmp/participant/SingleCellMetadata.java
@@ -1,5 +1,7 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -7,8 +9,9 @@
@Entity
@Table(name = "sc_metadata")
-class SingleCellMetadata {
+class SingleCellMetadata implements Serializable {
+ private static final long serialVersionUID = -7074542040879592316L;
@Id
private String barcode;
@Column(name = "specimen_id")
diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java
old mode 100644
new mode 100755
index d675e0b..6b59e13
--- a/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java
+++ b/src/main/java/org/kpmp/participant/SingleCellMetadataRepository.java
@@ -1,9 +1,11 @@
package org.kpmp.participant;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.CrudRepository;
interface SingleCellMetadataRepository extends CrudRepository {
+ @Cacheable("scParticipantExistsByRedcap")
boolean existsByRedcapId(String redcapId);
}
diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
old mode 100644
new mode 100755
index b8f066d..417e59c
--- a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
+++ b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
@@ -1,5 +1,7 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -7,8 +9,9 @@
@Entity
@Table(name = "sn_metadata")
-class SingleNucleusMetadata {
+class SingleNucleusMetadata implements Serializable {
+ private static final long serialVersionUID = -504357775835334661L;
@Id
private String barcode;
@Column(name = "specimen_id")
diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java
old mode 100644
new mode 100755
index 77acf32..fbaad99
--- a/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java
+++ b/src/main/java/org/kpmp/participant/SingleNucleusMetadataRepository.java
@@ -1,9 +1,12 @@
package org.kpmp.participant;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.CrudRepository;
public interface SingleNucleusMetadataRepository extends CrudRepository {
+ @Cacheable("snParticipantExistsByRedcap")
+
boolean existsByRedcapId(String redcapId);
}
diff --git a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java
old mode 100644
new mode 100755
index 6b9503d..44f2985
--- a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java
+++ b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java
@@ -1,5 +1,7 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -7,7 +9,9 @@
@Entity
@Table(name = "sv_data_type_v")
-class SpatialViewerDataType {
+class SpatialViewerDataType implements Serializable {
+
+ private static final long serialVersionUID = 3095549192644880754L;
@Id
@Column(name = "data_type")
diff --git a/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java b/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java
old mode 100644
new mode 100755
index c539297..60b808e
--- a/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java
+++ b/src/main/java/org/kpmp/participant/SpatialViewerTypeRepository.java
@@ -2,6 +2,7 @@
import java.util.List;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@@ -9,6 +10,7 @@
public interface SpatialViewerTypeRepository extends CrudRepository {
@Override
+ @Cacheable("svType")
public List findAll();
}
diff --git a/src/main/java/org/kpmp/umap/FeatureData.java b/src/main/java/org/kpmp/umap/FeatureData.java
old mode 100644
new mode 100755
index 35e8235..8ebb50f
--- a/src/main/java/org/kpmp/umap/FeatureData.java
+++ b/src/main/java/org/kpmp/umap/FeatureData.java
@@ -1,17 +1,18 @@
package org.kpmp.umap;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-public class FeatureData {
+public class FeatureData implements Serializable {
+ private static final long serialVersionUID = 6332061560137675936L;
private List xValues = new ArrayList<>();
private List yValues = new ArrayList<>();
private List expression = new ArrayList<>();
- private List hoverDisplay = new ArrayList<>();
+ private List hoverDisplay = new ArrayList<>();
-
- public List getXValues() {
+ public List getXValues() {
return xValues;
}
@@ -47,16 +48,16 @@ public void addExpression(Double expressionValue) {
this.expression.add(expressionValue);
}
- public List getHoverDisplay() {
- return hoverDisplay;
- }
+ public List getHoverDisplay() {
+ return hoverDisplay;
+ }
- public void setHoverDisplay(List hoverDisplay) {
- this.hoverDisplay = hoverDisplay;
- }
+ public void setHoverDisplay(List hoverDisplay) {
+ this.hoverDisplay = hoverDisplay;
+ }
- public void addHoverDisplay(String hoverDisplay) {
- this.hoverDisplay.add(hoverDisplay);
- }
+ public void addHoverDisplay(String hoverDisplay) {
+ this.hoverDisplay.add(hoverDisplay);
+ }
}
diff --git a/src/main/java/org/kpmp/umap/PlotData.java b/src/main/java/org/kpmp/umap/PlotData.java
old mode 100644
new mode 100755
index 2635ac3..24f637f
--- a/src/main/java/org/kpmp/umap/PlotData.java
+++ b/src/main/java/org/kpmp/umap/PlotData.java
@@ -1,9 +1,11 @@
package org.kpmp.umap;
+import java.io.Serializable;
import java.util.List;
-public class PlotData {
+public class PlotData implements Serializable {
+ private static final long serialVersionUID = 7957121452487372467L;
private List referenceData;
private List featureData;
diff --git a/src/main/java/org/kpmp/umap/ReferenceCluster.java b/src/main/java/org/kpmp/umap/ReferenceCluster.java
old mode 100644
new mode 100755
index 3728625..d5a0080
--- a/src/main/java/org/kpmp/umap/ReferenceCluster.java
+++ b/src/main/java/org/kpmp/umap/ReferenceCluster.java
@@ -1,10 +1,12 @@
package org.kpmp.umap;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-public class ReferenceCluster {
+public class ReferenceCluster implements Serializable {
+ private static final long serialVersionUID = -3963666320832242935L;
private List xValues = new ArrayList<>();
private List yValues = new ArrayList<>();
private String color;
@@ -56,11 +58,11 @@ public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
+ public String getClusterAbbreviation() {
+ return clusterAbbreviation;
+ }
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
+ public void setClusterAbbreviation(String clusterAbbreviation) {
+ this.clusterAbbreviation = clusterAbbreviation;
+ }
}
diff --git a/src/main/java/org/kpmp/umap/SCMetadata.java b/src/main/java/org/kpmp/umap/SCMetadata.java
old mode 100644
new mode 100755
index 7e7e0d7..dff6125
--- a/src/main/java/org/kpmp/umap/SCMetadata.java
+++ b/src/main/java/org/kpmp/umap/SCMetadata.java
@@ -1,5 +1,7 @@
package org.kpmp.umap;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -8,14 +10,15 @@
@Entity
@Table(name = "sc_umap_point_v")
-public class SCMetadata implements UmapPoint {
+public class SCMetadata implements UmapPoint, Serializable {
+ private static final long serialVersionUID = 7947867645080936879L;
@Column(name = "umap_x")
private double umapX;
@Column(name = "umap_y")
private double umapY;
- @Column(name = "cluster_abbreviation")
- private String clusterAbbreviation;
+ @Column(name = "cluster_abbreviation")
+ private String clusterAbbreviation;
@Column(name = "cluster_name")
private String clusterName;
@Column(name = "cluster_color")
@@ -58,15 +61,15 @@ public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
- @Override
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
+ @Override
+ public String getClusterAbbreviation() {
+ return clusterAbbreviation;
+ }
- @Override
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
+ @Override
+ public void setClusterAbbreviation(String clusterAbbreviation) {
+ this.clusterAbbreviation = clusterAbbreviation;
+ }
@Override
public String getClusterColor() {
diff --git a/src/main/java/org/kpmp/umap/SCMetadataRepository.java b/src/main/java/org/kpmp/umap/SCMetadataRepository.java
old mode 100644
new mode 100755
index 0fbe55b..cbcad2e
--- a/src/main/java/org/kpmp/umap/SCMetadataRepository.java
+++ b/src/main/java/org/kpmp/umap/SCMetadataRepository.java
@@ -9,11 +9,11 @@
public interface SCMetadataRepository extends CrudRepository {
- @Cacheable("scMetadata")
+ @Cacheable("scMetadataAll")
@Override
List findAll();
- @Cacheable("scMetadata")
+ @Cacheable("scMetadataLimited")
@Query(value = "SELECT "
+ "umap_x, "
+ "umap_y, "
@@ -26,13 +26,13 @@ public interface SCMetadataRepository extends CrudRepository
+ "LIMIT :limit", nativeQuery = true)
List findLimited(@Param("limit") int limit);
- @Cacheable("scMetadata")
+ @Cacheable("scMetadataCount")
@Query(value = "SELECT COUNT(umap_x) FROM sc_umap_point_v;", nativeQuery = true)
int findCount();
List findByTissueType(String tissueType);
- @Cacheable("scMetadata")
+ @Cacheable("scMetadataWithTissue")
@Query(value = "SELECT "
+ "umap_x, "
+ "umap_y, "
diff --git a/src/main/java/org/kpmp/umap/SNMetadata.java b/src/main/java/org/kpmp/umap/SNMetadata.java
old mode 100644
new mode 100755
index f9a840d..7e2a5d4
--- a/src/main/java/org/kpmp/umap/SNMetadata.java
+++ b/src/main/java/org/kpmp/umap/SNMetadata.java
@@ -1,5 +1,7 @@
package org.kpmp.umap;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -8,14 +10,15 @@
@Entity
@Table(name = "sn_umap_point_v")
-public class SNMetadata implements UmapPoint {
+public class SNMetadata implements UmapPoint, Serializable {
+ private static final long serialVersionUID = -8871186152958713643L;
@Column(name = "umap_x")
private double umapX;
@Column(name = "umap_y")
private double umapY;
@Column(name = "cluster_abbreviation")
- private String clusterAbbreviation;
+ private String clusterAbbreviation;
@Column(name = "cluster_name")
private String clusterName;
@Column(name = "cluster_color")
@@ -58,17 +61,17 @@ public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
- @Override
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
+ @Override
+ public String getClusterAbbreviation() {
+ return clusterAbbreviation;
+ }
- @Override
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
+ @Override
+ public void setClusterAbbreviation(String clusterAbbreviation) {
+ this.clusterAbbreviation = clusterAbbreviation;
+ }
- @Override
+ @Override
public String getClusterColor() {
return clusterColor;
}
diff --git a/src/main/java/org/kpmp/umap/SNMetadataRepository.java b/src/main/java/org/kpmp/umap/SNMetadataRepository.java
old mode 100644
new mode 100755
index 19a0aa7..d3daeb3
--- a/src/main/java/org/kpmp/umap/SNMetadataRepository.java
+++ b/src/main/java/org/kpmp/umap/SNMetadataRepository.java
@@ -9,10 +9,11 @@
interface SNMetadataRepository extends CrudRepository {
- @Cacheable("snMetadata")
+ @Cacheable("snMetadataAll")
@Override
List findAll();
+ @Cacheable("snMetadataLimited")
@Query(value = "SELECT "
+ "umap_x, "
+ "umap_y, "
@@ -25,12 +26,14 @@ interface SNMetadataRepository extends CrudRepository {
+ "LIMIT :limit", nativeQuery = true)
List findLimited(@Param("limit") int limit);
+ @Cacheable("snMetadataCount")
@Query(value = "SELECT COUNT(umap_x) FROM sn_umap_point_v;", nativeQuery = true)
int findCount();
+ @Cacheable("snMetadataByTissue")
List findByTissueType(String tissueType);
- @Cacheable("snMetadata")
+ @Cacheable("snMetadataWithTissue")
@Query(value = "SELECT "
+ "umap_x, "
+ "umap_y, "
diff --git a/src/main/java/org/kpmp/umap/UmapDataService.java b/src/main/java/org/kpmp/umap/UmapDataService.java
old mode 100644
new mode 100755
diff --git a/src/main/java/org/kpmp/umap/UmapPoint.java b/src/main/java/org/kpmp/umap/UmapPoint.java
old mode 100644
new mode 100755
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
old mode 100644
new mode 100755
diff --git a/src/main/resources/hazelcast.yaml b/src/main/resources/hazelcast.yaml
new file mode 100755
index 0000000..8b17b78
--- /dev/null
+++ b/src/main/resources/hazelcast.yaml
@@ -0,0 +1,5 @@
+hazelcast:
+ network:
+ join:
+ multicast:
+ enabled: true
\ No newline at end of file
diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls
old mode 100644
new mode 100755
index 2d9afbb..6d94de6
--- a/src/main/resources/knowledge_environment.graphqls
+++ b/src/main/resources/knowledge_environment.graphqls
@@ -13,6 +13,31 @@ type Query {
getDataTypeInformationByParticipant(redcapId: String!): ParticipantDataTypeSummary
participantSummaryDataset(redcapId: String): ParticipantSummaryDataset
participantClinicalDataset(redcapId: String): ParticipantSummaryDataset
+ getTissueTypeSummaryData: [ParticipantTissueTypeSummary]
+ getAtlasSummaryRows: AtlasRepoSummaryResult
+}
+
+type AtlasRepoSummaryResult {
+ totalFiles: Int
+ summaryRows: [AtlasRepoSummaryRow]
+}
+
+type AtlasRepoSummaryRow {
+ openCount: Int
+ controlledCount: Int
+ omicsType: String
+ linkInformation: AtlasRepoSummaryLinkInformation
+}
+
+type AtlasRepoSummaryLinkInformation {
+ linkType: String
+ linkValue: String
+}
+
+type ParticipantTissueTypeSummary {
+ akiCount: Long
+ ckdCount: Long
+ hrtCount: Long
}
type ParticipantDataTypeSummary {
diff --git a/src/test/java/org/kpmp/DataTypeEnumTest.java b/src/test/java/org/kpmp/DataTypeEnumTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/FullDataTypeEnumTest.java b/src/test/java/org/kpmp/FullDataTypeEnumTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/OmicsTypeEnumTest.java b/src/test/java/org/kpmp/OmicsTypeEnumTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java
old mode 100644
new mode 100755
index 0a257d4..6be38b3
--- a/src/test/java/org/kpmp/QueryTest.java
+++ b/src/test/java/org/kpmp/QueryTest.java
@@ -1,6 +1,7 @@
package org.kpmp;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
@@ -20,8 +21,9 @@
import org.kpmp.cellType.CellTypeService;
import org.kpmp.cellTypeSummary.ClusterHierarchy;
import org.kpmp.cellTypeSummary.ClusterHierarchyService;
+import org.kpmp.dataSummary.AtlasRepoSummaryResult;
import org.kpmp.dataSummary.DataSummaryService;
-import org.kpmp.datasetSummary.DatasetSummary;
+import org.kpmp.dataSummary.DataTypeSummary;
import org.kpmp.gene.GeneService;
import org.kpmp.gene.MyGeneInfoHit;
import org.kpmp.geneExpression.RTExpressionByTissueType;
@@ -33,6 +35,7 @@
import org.kpmp.participant.ParticipantDataTypeSummary;
import org.kpmp.participant.ParticipantService;
import org.kpmp.participant.ParticipantSummaryDataset;
+import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.umap.FeatureData;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.ReferenceCluster;
@@ -61,6 +64,8 @@ public class QueryTest {
private RTExpressionDataService rtExpressionDataService;
@Mock
private ParticipantService participantService;
+ @Mock
+ private ParticipantTissueTypeSummary participantTissueTypeSummary;
@Before
public void setUp() throws Exception {
@@ -75,6 +80,26 @@ public void tearDown() throws Exception {
query = null;
}
+ @Test
+ public void testGetAtlasSummaryRows() throws Exception {
+ AtlasRepoSummaryResult expectedResult = mock(AtlasRepoSummaryResult.class);
+ when(dataSummaryService.getAtlasRepoSummary()).thenReturn(expectedResult);
+
+ assertEquals(expectedResult, query.getAtlasSummaryRows());
+ }
+
+ @Test
+ public void testGetAtlasSummaryRows_throwsException() throws Exception {
+ when(dataSummaryService.getAtlasRepoSummary()).thenThrow(new Exception("ack"));
+
+ try {
+ query.getAtlasSummaryRows();
+ fail("Should have thrown exception");
+ } catch (Exception e) {
+ assertEquals("ack", e.getMessage());
+ }
+ }
+
@Test
public void testGenes() throws Exception {
List expectedResult = Arrays.asList(new MyGeneInfoHit());
@@ -189,17 +214,17 @@ public void dataTypesForConceptWhenClusterNameAndBlankGene() throws Exception {
@Test
public void getGeneDatasetInformation() throws Exception {
- List expectedResult = new ArrayList<>();
+ List expectedResult = new ArrayList<>();
- expectedResult.add(new DatasetSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ expectedResult.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(),
Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0)));
- expectedResult.add(new DatasetSummary(OmicsTypeEnum.NONE.getEnum(),
+ expectedResult.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(),
Long.valueOf(0), Long.valueOf(0), Long.valueOf(0), Long.valueOf(0)));
when(geneExpressionService.getGeneDatasetInformation("AAA")).thenReturn(expectedResult);
- List datasetSummary = query.getGeneDatasetInformation("AAA");
+ List datasetSummary = query.getGeneDatasetInformation("AAA");
assertEquals(expectedResult, datasetSummary);
}
@@ -248,5 +273,14 @@ public void testParticipantClinicalDataset() throws Exception {
assertEquals(expected, query.participantClinicalDataset("participant_id"));
}
-
-}
+
+ public void getParticipantTissueTypeSummary() throws Exception {
+ List expectedResult = new ArrayList<>();
+
+ expectedResult.add(new ParticipantTissueTypeSummary(Long.valueOf(4), Long.valueOf(5), Long.valueOf(6)));
+
+ List tissueSummary = query.getTissueTypeSummaryData();
+
+ assertEquals(expectedResult, tissueSummary);
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/org/kpmp/RTComparisonTypeEnumTest.java b/src/test/java/org/kpmp/RTComparisonTypeEnumTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/TissueTypeEnumTest.java b/src/test/java/org/kpmp/TissueTypeEnumTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/autocomplete/AutocompleteResultTest.java b/src/test/java/org/kpmp/autocomplete/AutocompleteResultTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/autocomplete/AutocompleteServiceTest.java b/src/test/java/org/kpmp/autocomplete/AutocompleteServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeHierarchyTest.java b/src/test/java/org/kpmp/cellType/CellTypeHierarchyTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java b/src/test/java/org/kpmp/cellType/CellTypeServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeStructureRegionTest.java b/src/test/java/org/kpmp/cellType/CellTypeStructureRegionTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeStructureSubregionTest.java b/src/test/java/org/kpmp/cellType/CellTypeStructureSubregionTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeSynonymIdTest.java b/src/test/java/org/kpmp/cellType/CellTypeSynonymIdTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeSynonymTest.java b/src/test/java/org/kpmp/cellType/CellTypeSynonymTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellType/CellTypeTest.java b/src/test/java/org/kpmp/cellType/CellTypeTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyIdTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyIdTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyTest.java b/src/test/java/org/kpmp/cellTypeSummary/ClusterHierarchyTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cluster/ClusterServiceTest.java b/src/test/java/org/kpmp/cluster/ClusterServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/cluster/ClusterTest.java b/src/test/java/org/kpmp/cluster/ClusterTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java
new file mode 100644
index 0000000..5d12f92
--- /dev/null
+++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java
@@ -0,0 +1,63 @@
+package org.kpmp.dataSummary;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class AtlasRepoSummaryLinkInformationTest {
+
+ @Before
+ public void setUp() throws Exception {
+
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testConstructor() {
+ AtlasRepoSummaryLinkInformation linkInfo = new AtlasRepoSummaryLinkInformation("type", "value");
+
+ assertEquals("type", linkInfo.getLinkType());
+ assertEquals("value", linkInfo.getLinkValue());
+ }
+
+ @Test
+ public void testSetLinkType() {
+ AtlasRepoSummaryLinkInformation linkInfo = new AtlasRepoSummaryLinkInformation("type", "value");
+ linkInfo.setLinkType("anotherType");
+
+ assertEquals("anotherType", linkInfo.getLinkType());
+ }
+
+ @Test
+ public void testSetLinkValue() {
+ AtlasRepoSummaryLinkInformation linkInfo = new AtlasRepoSummaryLinkInformation("type", "value");
+ linkInfo.setLinkValue("another value");
+
+ assertEquals("another value", linkInfo.getLinkValue());
+ }
+
+ @Test
+ public void testEqualsAndHashCode() throws Exception {
+ AtlasRepoSummaryLinkInformation base = new AtlasRepoSummaryLinkInformation("linkType", "linkValue");
+ AtlasRepoSummaryLinkInformation same = new AtlasRepoSummaryLinkInformation("linkType", "linkValue");
+ AtlasRepoSummaryLinkInformation differentLinkType = new AtlasRepoSummaryLinkInformation("another type",
+ "linkValue");
+ AtlasRepoSummaryLinkInformation differentLinkValue = new AtlasRepoSummaryLinkInformation("linkType",
+ "another value");
+ String anotherObject = "hey there";
+
+ assertEquals(base.hashCode(), base.hashCode());
+ assertEquals(base.hashCode(), same.hashCode());
+ assertEquals(true, base.equals(same));
+ assertEquals(true, base.equals(base));
+ assertEquals(false, base.equals(differentLinkType));
+ assertEquals(false, base.equals(differentLinkValue));
+ assertEquals(false, base.equals(anotherObject));
+
+ }
+}
diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java
new file mode 100644
index 0000000..23f5617
--- /dev/null
+++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryResultTest.java
@@ -0,0 +1,52 @@
+package org.kpmp.dataSummary;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+
+public class AtlasRepoSummaryResultTest {
+
+ private AtlasRepoSummaryResult result;
+ @Mock
+ private List summaryRows;
+
+ @Before
+ public void setUp() throws Exception {
+ result = new AtlasRepoSummaryResult();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ result = null;
+ }
+
+ @Test
+ public void testConstructor() throws Exception {
+ int totalFiles = 5;
+ AtlasRepoSummaryResult constructorTest = new AtlasRepoSummaryResult(summaryRows, totalFiles);
+
+ assertEquals(summaryRows, constructorTest.getSummaryRows());
+ assertEquals(5, constructorTest.getTotalFiles());
+
+ }
+
+ @Test
+ public void testSetSummaryRows() {
+ result.setSummaryRows(summaryRows);
+
+ assertEquals(summaryRows, result.getSummaryRows());
+ }
+
+ @Test
+ public void testSetTotalFiles() {
+ result.setTotalFiles(58);
+
+ assertEquals(58, result.getTotalFiles());
+ }
+
+}
diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java
new file mode 100644
index 0000000..1d12217
--- /dev/null
+++ b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryRowTest.java
@@ -0,0 +1,85 @@
+package org.kpmp.dataSummary;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class AtlasRepoSummaryRowTest {
+
+ @Mock
+ AtlasRepoSummaryLinkInformation linkInformation;
+ private AtlasRepoSummaryRow row;
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.openMocks(this);
+ row = new AtlasRepoSummaryRow("omicsType", linkInformation);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ MockitoAnnotations.openMocks(this).close();
+ row = null;
+ }
+
+ @Test
+ public void testConstructor() throws Exception {
+ AtlasRepoSummaryLinkInformation expectedLinkInformation = mock(AtlasRepoSummaryLinkInformation.class);
+ AtlasRepoSummaryRow rowToTest = new AtlasRepoSummaryRow("stuff", expectedLinkInformation);
+
+ assertEquals("stuff", rowToTest.getOmicsType());
+ assertEquals(expectedLinkInformation, rowToTest.getLinkInformation());
+ assertEquals(0, rowToTest.getOpenCount());
+ assertEquals(0, rowToTest.getControlledCount());
+ }
+
+ @Test
+ public void testSetOpenCount() {
+ row.setOpenCount(43);
+
+ assertEquals(43, row.getOpenCount());
+ }
+
+ @Test
+ public void testSetControlledCount() {
+ row.setControlledCount(44);
+
+ assertEquals(44, row.getControlledCount());
+ }
+
+ @Test
+ public void testSetOmicsType() {
+ row.setOmicsType("omicsType 2");
+ assertEquals("omicsType 2", row.getOmicsType());
+ }
+
+ @Test
+ public void testAddToControlledCount() {
+ row.setControlledCount(2);
+ row.addToControlledCount(30);
+
+ assertEquals(32, row.getControlledCount());
+ }
+
+ @Test
+ public void testAddToOpenCount() {
+ row.setOpenCount(5);
+ row.addToOpenCount(5);
+
+ assertEquals(10, row.getOpenCount());
+ }
+
+ @Test
+ public void testSetLinkInformation() {
+ AtlasRepoSummaryLinkInformation expectedLinkInformation = mock(AtlasRepoSummaryLinkInformation.class);
+ row.setLinkInformation(expectedLinkInformation);
+
+ assertEquals(expectedLinkInformation, row.getLinkInformation());
+
+ }
+}
diff --git a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java
old mode 100644
new mode 100755
index 834bed1..65bb950
--- a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java
+++ b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java
@@ -3,6 +3,7 @@
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
+import java.util.Arrays;
import java.util.List;
import org.junit.After;
@@ -11,7 +12,6 @@
import org.kpmp.DataTypeEnum;
import org.kpmp.FullDataTypeEnum;
import org.kpmp.TissueTypeEnum;
-import org.kpmp.datasetSummary.DatasetSummary;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -19,11 +19,13 @@ public class DataSummaryServiceTest {
private DataSummaryService dataSummaryService;
@Mock
private DataSummaryRepository dataSummaryRepository;
+ @Mock
+ private AtlasRepoSummaryRepository atlasRepoSummaryRepository;
@Before
public void setUp() throws Exception {
MockitoAnnotations.openMocks(this);
- dataSummaryService = new DataSummaryService(dataSummaryRepository);
+ dataSummaryService = new DataSummaryService(dataSummaryRepository, atlasRepoSummaryRepository);
}
@After
@@ -32,6 +34,66 @@ public void tearDown() throws Exception {
dataSummaryService = null;
}
+ @Test
+ public void testGetAtlasRepoSummary() throws Exception {
+ ExperimentalStrategyValue clinicalData = new ExperimentalStrategyValue();
+ clinicalData.setDataCategory("stuff");
+ clinicalData.setExperimentalStrategy("");
+ clinicalData.setDataType("Clinical Study Data");
+ clinicalData.setCount(1);
+ clinicalData.setAccess("open");
+ ExperimentalStrategyValue biomarker1 = new ExperimentalStrategyValue();
+ biomarker1.setDataCategory("Biomarker");
+ biomarker1.setExperimentalStrategy("something");
+ biomarker1.setDataType("stuff");
+ biomarker1.setDataCategory("Biomarker");
+ biomarker1.setCount(5);
+ biomarker1.setAccess("open");
+ ExperimentalStrategyValue biomarker2 = new ExperimentalStrategyValue();
+ biomarker2.setDataCategory("Biomarker");
+ biomarker2.setDataType("more stuff");
+ biomarker2.setExperimentalStrategy("something else");
+ biomarker2.setDataCategory("Biomarker");
+ biomarker2.setCount(10);
+ biomarker2.setAccess("open");
+ ExperimentalStrategyValue other1 = new ExperimentalStrategyValue();
+ other1.setDataCategory("data category");
+ other1.setDataType("different stuff");
+ other1.setExperimentalStrategy("strategy1");
+ other1.setCount(10);
+ other1.setAccess("open");
+ ExperimentalStrategyValue other2 = new ExperimentalStrategyValue();
+ other2.setDataCategory("data category2");
+ other2.setDataType("even more different stuff");
+ other2.setExperimentalStrategy("strategy1");
+ other2.setCount(10);
+ other2.setAccess("controlled");
+ List strategyValues = Arrays.asList(clinicalData, biomarker1, biomarker2, other1,
+ other2);
+ when(atlasRepoSummaryRepository.findAll()).thenReturn(strategyValues);
+
+ AtlasRepoSummaryResult result = dataSummaryService.getAtlasRepoSummary();
+ List summaryRows = result.getSummaryRows();
+ assertEquals(3, summaryRows.size());
+ assertEquals("Biomarkers", summaryRows.get(0).getOmicsType());
+ assertEquals(0, summaryRows.get(0).getControlledCount());
+ assertEquals(15, summaryRows.get(0).getOpenCount());
+ assertEquals(new AtlasRepoSummaryLinkInformation("data_category", "Biomarker"),
+ summaryRows.get(0).getLinkInformation());
+ assertEquals("Clinical Study Data", summaryRows.get(1).getOmicsType());
+ assertEquals(0, summaryRows.get(1).getControlledCount());
+ assertEquals(1, summaryRows.get(1).getOpenCount());
+ assertEquals(new AtlasRepoSummaryLinkInformation("data_category", "stuff"),
+ summaryRows.get(1).getLinkInformation());
+ assertEquals("strategy1", summaryRows.get(2).getOmicsType());
+ assertEquals(10, summaryRows.get(2).getControlledCount());
+ assertEquals(10, summaryRows.get(2).getOpenCount());
+ assertEquals(new AtlasRepoSummaryLinkInformation("experimental_strategy", "strategy1"),
+ summaryRows.get(2).getLinkInformation());
+ assertEquals(36, result.getTotalFiles());
+
+ }
+
@Test
public void testGetGeneDatasetInformation() throws Exception {
when(dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(),
@@ -103,7 +165,7 @@ public void testGetGeneDatasetInformation() throws Exception {
.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()))
.thenReturn(Long.valueOf(22));
- List result = dataSummaryService.getSummaryData();
+ List result = dataSummaryService.getSummaryData();
assertEquals(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName(), result.get(0).getDataType());
assertEquals(DataTypeEnum.SPATIAL_TRANSCRIPTOMICS.getAbbreviation(), result.get(0).getDataTypeShort());
diff --git a/src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java b/src/test/java/org/kpmp/dataSummary/DataTypeSummaryTest.java
old mode 100644
new mode 100755
similarity index 93%
rename from src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java
rename to src/test/java/org/kpmp/dataSummary/DataTypeSummaryTest.java
index 47cfcad..a85aecd
--- a/src/test/java/org/kpmp/datasetSummary/DatasetSummaryTest.java
+++ b/src/test/java/org/kpmp/dataSummary/DataTypeSummaryTest.java
@@ -1,4 +1,4 @@
-package org.kpmp.datasetSummary;
+package org.kpmp.dataSummary;
import static org.junit.Assert.assertEquals;
@@ -9,14 +9,14 @@
import org.kpmp.FullDataTypeEnum;
import org.kpmp.OmicsTypeEnum;
-public class DatasetSummaryTest {
+public class DataTypeSummaryTest {
- private DatasetSummary datasetSummary;
+ private DataTypeSummary datasetSummary;
@Before
public void setUp() {
- datasetSummary = new DatasetSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
+ datasetSummary = new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
FullDataTypeEnum.SINGLE_CELL_FULL.getFullName(), DataTypeEnum.SINGLE_CELL.getAbbreviation(),
Long.valueOf(2), Long.valueOf(4), Long.valueOf(6), Long.valueOf(8));
}
diff --git a/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java
new file mode 100644
index 0000000..d9d80ac
--- /dev/null
+++ b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyIdTest.java
@@ -0,0 +1,35 @@
+package org.kpmp.dataSummary;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ExperimentalStrategyIdTest {
+
+ private ExperimentalStrategyId id;
+
+ @Before
+ public void setUp() throws Exception {
+ id = new ExperimentalStrategyId();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ id = null;
+ }
+
+ @Test
+ public void testSetExperimentalStrategy() {
+ id.setExperimentalStrategy("strategy");
+ assertEquals("strategy", id.getExperimentalStrategy());
+ }
+
+ @Test
+ public void testSetAccess() {
+ id.setAccess("open");
+ assertEquals("open", id.getAccess());
+ }
+
+}
diff --git a/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java
new file mode 100644
index 0000000..b2b3346
--- /dev/null
+++ b/src/test/java/org/kpmp/dataSummary/ExperimentalStrategyValueTest.java
@@ -0,0 +1,53 @@
+package org.kpmp.dataSummary;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ExperimentalStrategyValueTest {
+
+ private ExperimentalStrategyValue value;
+
+ @Before
+ public void setUp() throws Exception {
+ value = new ExperimentalStrategyValue();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ value = null;
+ }
+
+ @Test
+ public void testSetCount() {
+ value.setCount(23);
+ assertEquals(23, value.getCount());
+ }
+
+ @Test
+ public void testSetExperimentalStrategy() {
+ value.setExperimentalStrategy("experimentalStrategy");
+ assertEquals("experimentalStrategy", value.getExperimentalStrategy());
+ }
+
+ @Test
+ public void testSetAccess() {
+ value.setAccess("open");
+ assertEquals("open", value.getAccess());
+ }
+
+ @Test
+ public void testSetDataType() {
+ value.setDataType("dataType");
+ assertEquals("dataType", value.getDataType());
+ }
+
+ @Test
+ public void testSetDataCategory() {
+ value.setDataCategory("dataCategory");
+ assertEquals("dataCategory", value.getDataCategory());
+ }
+
+}
diff --git a/src/test/java/org/kpmp/errors/ErrorControllerTest.java b/src/test/java/org/kpmp/errors/ErrorControllerTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/errors/FrontEndErrorTest.java b/src/test/java/org/kpmp/errors/FrontEndErrorTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/gene/GeneServiceTest.java b/src/test/java/org/kpmp/gene/GeneServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/gene/MyGeneInfoHitTest.java b/src/test/java/org/kpmp/gene/MyGeneInfoHitTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/gene/MyGeneInfoResultTest.java b/src/test/java/org/kpmp/gene/MyGeneInfoResultTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/ExpressionDataServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionByTissueTypeTest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionByTissueTypeTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsTest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionDataAllSegmentsTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionDataGTITest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionDataGTITest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/RTGeneExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/RTGeneExpressionDataServiceTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java b/src/test/java/org/kpmp/geneExpression/SCExpressionDataTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java b/src/test/java/org/kpmp/geneExpression/SNExpressionDataTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionIdTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionIdTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java
old mode 100644
new mode 100755
index 83c25b8..e7f5054
--- a/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java
+++ b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java
@@ -12,7 +12,7 @@
import org.junit.Before;
import org.junit.Test;
import org.kpmp.DataTypeEnum;
-import org.kpmp.datasetSummary.DatasetSummary;
+import org.kpmp.dataSummary.DataTypeSummary;
import org.kpmp.geneExpression.RTExpressionDataAllSegmentsRepository;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -204,10 +204,10 @@ public void testGetGeneDatasetInformation() throws Exception {
when(snrnaGeneExpressionRepository.getCountByTissue("hrt")).thenReturn(Long.valueOf(0));
when(snrnaParticipantRepository.getParticipantCount()).thenReturn(Long.valueOf(0));
- List result = geneExpressionService.getGeneDatasetInformation("AAA");
- DatasetSummary resultDataSC = result.get(0);
- DatasetSummary resultDataSN = result.get(1);
- DatasetSummary resultDataRt = result.get(2);
+ List result = geneExpressionService.getGeneDatasetInformation("AAA");
+ DataTypeSummary resultDataSC = result.get(0);
+ DataTypeSummary resultDataSN = result.get(1);
+ DataTypeSummary resultDataRt = result.get(2);
assertEquals(Long.valueOf(0), resultDataSC.getAkiCount());
assertEquals(Long.valueOf(0), resultDataSC.getCkdCount());
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/ParticipantIdTest.java b/src/test/java/org/kpmp/geneExpressionSummary/ParticipantIdTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/RTParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/RTParticipantValueTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionSummaryValueTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValueTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionSummaryValueTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java b/src/test/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValueTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java b/src/test/java/org/kpmp/participant/ParticipantDataTypeSummaryTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java
old mode 100644
new mode 100755
index f91acd2..4e168a6
--- a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java
+++ b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java
@@ -6,7 +6,7 @@
import java.util.Arrays;
import java.util.List;
-
+import org.kpmp.TissueTypeEnum;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -124,4 +124,20 @@ public void testGetExperimentCounts() {
}
+ @Test
+ public void testGetTissueCounts() throws Exception {
+ when(participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType())).thenReturn(Long .valueOf(4));
+ when(participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType())).thenReturn(Long .valueOf(5));
+ when(participantSummaryDatasetRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType())).thenReturn(Long .valueOf(6));
+
+ List result = participantService.getTissueData();
+ ParticipantTissueTypeSummary resultDataAki = result.get(0);
+ ParticipantTissueTypeSummary resultDataCkd = result.get(0);
+ ParticipantTissueTypeSummary resultDataHrt = result.get(0);
+
+
+ assertEquals(Long.valueOf(4), resultDataAki.getAkiCount());
+ assertEquals(Long.valueOf(5), resultDataCkd.getCkdCount());
+ assertEquals(Long.valueOf(6), resultDataHrt.getHrtCount());
+ }
}
\ No newline at end of file
diff --git a/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java b/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java b/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java
new file mode 100644
index 0000000..9432f13
--- /dev/null
+++ b/src/test/java/org/kpmp/participant/ParticipantTissueTypeSummaryTest.java
@@ -0,0 +1,45 @@
+package org.kpmp.participant;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ParticipantTissueTypeSummaryTest {
+ private ParticipantTissueTypeSummary tissueSummary;
+
+ @Before
+ public void setUp() {
+ tissueSummary = new ParticipantTissueTypeSummary(Long.valueOf(4), Long.valueOf(5), Long.valueOf(6));
+ }
+
+ @After
+ public void tearDown() {
+ tissueSummary = null;
+ }
+
+ @Test
+ public void testInitialSetup() throws Exception {
+ assertEquals(Long.valueOf(4), tissueSummary.getAkiCount());
+ assertEquals(Long.valueOf(5), tissueSummary.getCkdCount());
+ assertEquals(Long.valueOf(6), tissueSummary.getHrtCount());
+ }
+
+ @Test
+ public void testSetAkiCount() throws Exception {
+ tissueSummary.setAkiCount(Long.valueOf(4*10));
+ assertEquals(Long.valueOf(4*10), tissueSummary.getAkiCount());
+ }
+
+ @Test
+ public void testSetCkdCount() throws Exception {
+ tissueSummary.setCkdCount(Long.valueOf(5*10));
+ assertEquals(Long.valueOf(5*10), tissueSummary.getCkdCount());
+ }
+
+ @Test
+ public void testSetHrtCount() throws Exception {
+ tissueSummary.setHrtCount(Long.valueOf(6*10));
+ assertEquals(Long.valueOf(6*10), tissueSummary.getHrtCount());
+ }
+}
\ 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
old mode 100644
new mode 100755
index 019b79d..dbea114
--- a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
+++ b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
@@ -6,7 +6,7 @@
import org.junit.Before;
import org.junit.Test;
-public class SingleCellMetadataTest extends SingleCellMetadata {
+public class SingleCellMetadataTest {
private SingleCellMetadata scMetadata;
diff --git a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
old mode 100644
new mode 100755
index 9e95d0d..2c62101
--- a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
+++ b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
@@ -6,7 +6,7 @@
import org.junit.Before;
import org.junit.Test;
-public class SingleNucleusMetadataTest extends SingleNucleusMetadata {
+public class SingleNucleusMetadataTest {
private SingleNucleusMetadata snMetadata;
diff --git a/src/test/java/org/kpmp/participant/SpatialViewerDataTypeTest.java b/src/test/java/org/kpmp/participant/SpatialViewerDataTypeTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/umap/FeatureDataTest.java b/src/test/java/org/kpmp/umap/FeatureDataTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/umap/PlotDataTest.java b/src/test/java/org/kpmp/umap/PlotDataTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/umap/ReferenceClusterTest.java b/src/test/java/org/kpmp/umap/ReferenceClusterTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/umap/SCMetadataTest.java b/src/test/java/org/kpmp/umap/SCMetadataTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/umap/SNMetadataTest.java b/src/test/java/org/kpmp/umap/SNMetadataTest.java
old mode 100644
new mode 100755
diff --git a/src/test/java/org/kpmp/umap/UmapDataServiceTest.java b/src/test/java/org/kpmp/umap/UmapDataServiceTest.java
old mode 100644
new mode 100755