diff --git a/.classpath b/.classpath
index f00842b..639c8b2 100755
--- a/.classpath
+++ b/.classpath
@@ -1,25 +1,638 @@
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 7728c0a..e91f6df 100755
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,4 @@ build
.settings
bin
.gradle
+.DS_Store
diff --git a/.project b/.project
index 974292e..b0a8cd9 100755
--- a/.project
+++ b/.project
@@ -2,29 +2,27 @@
pegasus-data
-
-
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.buildship.core.gradleprojectnature
+
org.eclipse.jdt.core.javabuilder
-
-
+
org.eclipse.buildship.core.gradleprojectbuilder
-
-
+
-
- org.eclipse.jdt.core.javanature
- org.eclipse.buildship.core.gradleprojectnature
-
+
1
-
30
+
org.eclipse.core.resources.regexFilterMatcher
node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
diff --git a/README.md b/README.md
index 6931273..821d0e8 100755
--- a/README.md
+++ b/README.md
@@ -34,3 +34,11 @@ Repository for the Atlas Explorer Tool service layer
2. Update .env ENV_MYSQL_PASSWORD to the password for QA KE
3. Add your IP address to a new security group called sg-0597e054f11d2e31a (Developer to KE Mariadb)
4. Restart your knowledge-environment (don't worry that you have your own copy of mariadb, it'll be ignored)
+
+If you have already followed these steps and are still having trouble connecting, check to see if your ip address has changed, you may need to update the security group rules
+
+# Talking to GraphQL
+
+1. Start up your atlas/knowledge-environment server
+2. Open a tool like GraphQLPlayground and connect to "http://localhost:3030/graphql"
+3. Write and execute your query
diff --git a/src/main/java/org/kpmp/Query.java b/src/main/java/org/kpmp/Query.java
index 30c0d1f..be63d44 100755
--- 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;
@@ -20,9 +21,9 @@
import org.kpmp.geneExpressionSummary.GeneExpressionSummary;
import org.kpmp.geneExpressionSummary.GeneExpressionSummaryService;
import org.kpmp.participant.ParticipantDataTypeSummary;
-import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.participant.ParticipantService;
import org.kpmp.participant.ParticipantSummaryDataset;
+import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.UmapDataService;
import org.slf4j.Logger;
@@ -100,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) {
@@ -109,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) {
@@ -170,9 +171,18 @@ public ParticipantSummaryDataset participantClinicalDataset(String redcap_id) th
public List getTissueTypeSummaryData() throws Exception {
try {
return participantService.getTissueData();
- }catch (Exception e) {
+ } catch (Exception e) {
logger.error(e.getMessage());
throw e;
- }
+ }
+ }
+
+ public AtlasRepoSummaryResult getAtlasSummaryRows() throws Exception {
+ try {
+ return dataSummaryService.getAtlasRepoSummary();
+ } catch (Exception e) {
+ logger.error("Unable to get Atlas Summary data: ", e.getMessage());
+ throw e;
+ }
}
}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java
index 2c0284f..3d07095 100755
--- a/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java
+++ b/src/main/java/org/kpmp/autocomplete/AutocompleteResult.java
@@ -5,6 +5,7 @@
public class AutocompleteResult implements Serializable {
+ private static final long serialVersionUID = 762733408490639258L;
private String value;
private String name;
private String id;
diff --git a/src/main/java/org/kpmp/cellType/CellType.java b/src/main/java/org/kpmp/cellType/CellType.java
index 2c18d3c..e336d0d 100755
--- a/src/main/java/org/kpmp/cellType/CellType.java
+++ b/src/main/java/org/kpmp/cellType/CellType.java
@@ -17,6 +17,8 @@
@Table(name = "cell_type")
public class CellType implements Serializable {
+ private static final long serialVersionUID = -7240769211757430938L;
+
@Id
@Column(name = "cell_type_id")
private int cellTypeId;
diff --git a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
index c30e8e3..dfc7470 100755
--- a/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeHierarchy.java
@@ -10,7 +10,8 @@
@Component
public class CellTypeHierarchy implements Serializable {
-
+
+ private static final long serialVersionUID = 4174487460309851924L;
private Map cellTypeRegionMap = new HashMap<>();
public List getCellTypeRegions() {
@@ -20,7 +21,7 @@ public List getCellTypeRegions() {
}
public void addCellTypeStructureRegion(CellTypeStructureRegion region) {
-
+
if (cellTypeRegionMap.containsKey(region.getRegionName())) {
CellTypeStructureRegion existingRegion = cellTypeRegionMap.get(region.getRegionName());
List subregions = region.getCellTypeSubregions();
@@ -32,7 +33,4 @@ public void addCellTypeStructureRegion(CellTypeStructureRegion region) {
}
}
-
-
}
-
diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java
index d80efeb..185fe66 100755
--- a/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeStructureRegion.java
@@ -8,6 +8,7 @@
public class CellTypeStructureRegion implements Serializable {
+ private static final long serialVersionUID = 3141535632314917816L;
private String regionName;
private Map subregionMap = new HashMap<>();
private List subregionOrderdList = new ArrayList<>();
diff --git a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java
index d8a9315..b6be2c0 100755
--- a/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeStructureSubregion.java
@@ -8,6 +8,7 @@
public class CellTypeStructureSubregion implements Serializable {
+ private static final long serialVersionUID = 1366955014710403152L;
private String subregionName;
private List cellTypes = new ArrayList<>();
diff --git a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java
index 3f0ad7f..f33f904 100755
--- a/src/main/java/org/kpmp/cellType/CellTypeSynonym.java
+++ b/src/main/java/org/kpmp/cellType/CellTypeSynonym.java
@@ -1,45 +1,48 @@
package org.kpmp.cellType;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "celltype_synonym")
@IdClass(CellTypeSynonymId.class)
public class CellTypeSynonym implements Serializable {
- @Id
- @Column(name="cell_type_id")
- private int cellTypeId;
+ private static final long serialVersionUID = -5650797130903696615L;
+
+ @Id
+ @Column(name = "cell_type_id")
+ private int cellTypeId;
- @Id
- @Column(name="cell_type_synonym")
- private String cellTypeSynonym;
+ @Id
+ @Column(name = "cell_type_synonym")
+ private String cellTypeSynonym;
- @ManyToOne(fetch = FetchType.EAGER)
- @JoinColumn(name="cell_type_id", nullable = false, insertable = false, updatable = false)
- private CellType cellType;
+ @ManyToOne(fetch = FetchType.EAGER)
+ @JoinColumn(name = "cell_type_id", nullable = false, insertable = false, updatable = false)
+ private CellType cellType;
- public int getCellTypeId() {
- return cellTypeId;
- }
+ public int getCellTypeId() {
+ return cellTypeId;
+ }
- public void setCellTypeId(int cellTypeId) {
- this.cellTypeId = cellTypeId;
- }
+ public void setCellTypeId(int cellTypeId) {
+ this.cellTypeId = cellTypeId;
+ }
- public String getCellTypeSynonym() {
- return cellTypeSynonym;
- }
+ public String getCellTypeSynonym() {
+ return cellTypeSynonym;
+ }
- public void setCellTypeSynonym(String cellTypeSynonym) {
- this.cellTypeSynonym = cellTypeSynonym;
- }
+ public void setCellTypeSynonym(String cellTypeSynonym) {
+ this.cellTypeSynonym = cellTypeSynonym;
+ }
}
diff --git a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
index 1d3a777..8313e73 100755
--- a/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
+++ b/src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
@@ -1,19 +1,21 @@
package org.kpmp.cellTypeSummary;
-import org.springframework.lang.Nullable;
+import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
-import java.io.Serializable;
+
+import org.springframework.lang.Nullable;
@Entity
@Table(name = "cluster_hierarchy_v")
@IdClass(ClusterHierarchyId.class)
public class ClusterHierarchy implements Serializable {
+ private static final long serialVersionUID = -7707637379989017634L;
@Id
@Column(name = "cell_type_id")
private int cellTypeId;
@@ -31,11 +33,11 @@ public class ClusterHierarchy implements Serializable {
@Column(name = "is_single_nuc")
private String isSingleNucCluster;
@Column(name = "is_rt")
- private String isRegionalTranscriptomics;
+ private String isRegionalTranscriptomics;
@Column(name = "cell_type")
private String cellType;
@Column(name = "cell_type_order")
- private Double cellTypeOrder;
+ private Double cellTypeOrder;
public int getCellTypeId() {
return cellTypeId;
@@ -45,7 +47,7 @@ public void setCellTypeId(int cellTypeId) {
this.cellTypeId = cellTypeId;
}
- @Nullable
+ @Nullable
public int getClusterId() {
return clusterId;
}
@@ -62,7 +64,7 @@ public void setStructureRegion(String structureRegion) {
this.structureRegion = structureRegion;
}
- @Nullable
+ @Nullable
public String getStructureSubregion() {
return structureSubregion;
}
@@ -71,7 +73,7 @@ public void setStructureSubregion(String structureSubregion) {
this.structureSubregion = structureSubregion;
}
- @Nullable
+ @Nullable
public String getClusterName() {
return clusterName;
}
@@ -96,29 +98,29 @@ public void setIsSingleNucCluster(String isSingleNucCluster) {
this.isSingleNucCluster = isSingleNucCluster;
}
- public String getIsRegionalTranscriptomics() {
- return isRegionalTranscriptomics;
- }
+ public String getIsRegionalTranscriptomics() {
+ return isRegionalTranscriptomics;
+ }
- public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
- this.isRegionalTranscriptomics = isRegionalTranscriptomics;
- }
+ public void setIsRegionalTranscriptomics(String isRegionalTranscriptomics) {
+ this.isRegionalTranscriptomics = isRegionalTranscriptomics;
+ }
- @Nullable
- public Double getCellTypeOrder() {
- return cellTypeOrder;
- }
+ @Nullable
+ public Double getCellTypeOrder() {
+ return cellTypeOrder;
+ }
- public void setCellTypeOrder(Double cellTypeOrder) {
- this.cellTypeOrder = cellTypeOrder;
- }
+ public void setCellTypeOrder(Double cellTypeOrder) {
+ this.cellTypeOrder = cellTypeOrder;
+ }
- @Nullable
- public String getCellType() {
- return cellType;
- }
+ @Nullable
+ public String getCellType() {
+ return cellType;
+ }
- public void setCellType(String cellType) {
- this.cellType = cellType;
- }
+ public void setCellType(String cellType) {
+ this.cellType = cellType;
+ }
}
diff --git a/src/main/java/org/kpmp/dataSummary/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/DataSummaryService.java b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java
index ae4b84a..5d198ec 100755
--- a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java
+++ b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java
@@ -1,90 +1,186 @@
package org.kpmp.dataSummary;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.kpmp.DataTypeEnum;
import org.kpmp.FullDataTypeEnum;
import org.kpmp.OmicsTypeEnum;
import org.kpmp.TissueTypeEnum;
-import org.kpmp.datasetSummary.DatasetSummary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class DataSummaryService {
+ private static final String EXPERIMENTAL_STRATEGY = "experimental_strategy";
+ private static final String DATA_CATEGORY = "data_category";
+ private static final String CONTROLLED_ACCESS = "controlled";
+ private static final String OPEN_ACCESS = "open";
+ private static final String BIOMARKERS = "Biomarkers";
+ private static final String BIOMARKER = "Biomarker";
+ private static final String CLINICAL_STUDY_DATA = "Clinical Study Data";
+
private DataSummaryRepository dataSummaryRepository;
+ private AtlasRepoSummaryRepository repoSummaryRepository;
@Autowired
- public DataSummaryService(DataSummaryRepository dataSummaryRepository) {
+ public DataSummaryService(DataSummaryRepository dataSummaryRepository,
+ AtlasRepoSummaryRepository repoSummaryRepository) {
this.dataSummaryRepository = dataSummaryRepository;
+ this.repoSummaryRepository = repoSummaryRepository;
}
- public List 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
index 624cb14..476517c 100755
--- a/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java
+++ b/src/main/java/org/kpmp/dataSummary/DataSummaryValue.java
@@ -1,15 +1,18 @@
package org.kpmp.dataSummary;
-import org.springframework.lang.Nullable;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
+
+import org.springframework.lang.Nullable;
@Entity
@Table(name = "sv_file_v")
public class DataSummaryValue implements Serializable {
+ private static final long serialVersionUID = -1934662137113288596L;
@Id
@Column(name = "file_id")
private Integer fileId;
@@ -25,9 +28,9 @@ public class DataSummaryValue implements Serializable {
private String fileName;
@Column(name = "package_id")
private String packageId;
- @Column(name = "file_size")
+ @Column(name = "file_size")
private Long fileSize;
- @Column(name = "participant_id")
+ @Column(name = "participant_id")
private Integer participantId;
@Column(name = "redcap_id")
private String redcapId;
@@ -37,130 +40,130 @@ public class DataSummaryValue implements Serializable {
private String protocol;
@Column(name = "sample_type")
private String sampleType;
- @Column(name = "sex")
+ @Column(name = "sex")
private String sex;
- @Column(name = "tissue_source")
+ @Column(name = "tissue_source")
private String tissueSource;
- @Column(name = "tissue_type")
+ @Column(name = "tissue_type")
private String tissueType;
- @Column(name = "spectrack_sample_id")
+ @Column(name = "spectrack_sample_id")
private String spectrackSampleId;
@Nullable
public Integer getFileId() {
return fileId;
}
-
+
public void setFileId(Integer fileId) {
this.fileId = fileId;
}
-
+
@Nullable
public String getConfigType() {
return configType;
}
-
+
public void setConfigType(String configType) {
this.configType = configType;
}
-
+
@Nullable
public String getImageType() {
return imageType;
}
-
+
public void setImageType(String imageType) {
this.imageType = imageType;
}
-
+
@Nullable
public String getDataType() {
return dataType;
}
-
+
public void setDataType(String dataType) {
this.dataType = dataType;
}
-
+
public String getDlFileId() {
return dlFileId;
}
-
+
public void setDlFileIdd(String dlFileId) {
this.dlFileId = dlFileId;
}
-
+
public String getFileName() {
return fileName;
}
-
+
public void setFileName(String fileName) {
this.fileName = fileName;
}
-
+
@Nullable
public String getPackageId() {
return packageId;
}
-
+
public void setPackageId(String packageId) {
this.packageId = packageId;
}
-
+
@Nullable
public Long getFileSize() {
return fileSize;
}
-
+
public void setFileSize(Long fileSize) {
this.fileSize = fileSize;
}
-
+
@Nullable
public Integer getParticipantId() {
return participantId;
}
-
+
public void setParticipantId(Integer participantId) {
this.participantId = participantId;
}
-
+
@Nullable
public String getRedcapId() {
return redcapId;
}
-
+
public void setRedcapId(String redcapId) {
this.redcapId = redcapId;
}
-
+
@Nullable
public String getAge() {
return age;
}
-
+
public void setAge(String age) {
this.age = age;
}
-
+
@Nullable
public String getProtocol() {
return protocol;
}
-
+
public void setProtocol(String protocol) {
this.protocol = protocol;
}
-
+
@Nullable
public String getSampleType() {
return sampleType;
}
-
+
public void setSampleType(String sampleType) {
this.sampleType = sampleType;
}
-
+
@Nullable
public String getSex() {
return sex;
@@ -174,7 +177,7 @@ public void setSex(String sex) {
public String getTissueSource() {
return tissueSource;
}
-
+
public void setTissueSource(String tissueSource) {
this.tissueSource = tissueSource;
}
@@ -187,7 +190,7 @@ public String getTissueType() {
public void setTissueType(String tissueType) {
this.tissueType = tissueType;
}
-
+
@Nullable
public String getSpectrackSampleId() {
return spectrackSampleId;
diff --git a/src/main/java/org/kpmp/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 100755
index 125485c..0000000
--- a/src/main/java/org/kpmp/datasetSummary/DatasetSummary.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.kpmp.datasetSummary;
-
-import java.io.Serializable;
-
-public class DatasetSummary implements Serializable {
- private String omicsType;
- private String dataType;
- private String dataTypeShort;
- private Long akiCount;
- private Long ckdCount;
- private Long hrtCount;
- private Long participantCount;
-
- public DatasetSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount, Long hrtCount, Long participantCount) {
- this.omicsType = omicsType;
- this.dataType = dataType;
- this.dataTypeShort = dataTypeShort;
- this.akiCount = akiCount;
- this.ckdCount = ckdCount;
- this.hrtCount = hrtCount;
- this.participantCount = participantCount;
- }
- public String getOmicsType() {
- return this.omicsType;
- }
- public void setOmicsType(String omicsType) {
- this.omicsType = omicsType;
- }
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataTypeType(String dataType) {
- this.dataType = dataType;
- }
-
- public String getDataTypeShort() {
- return this.dataTypeShort;
- }
- public void setDataTypeShort(String dataTypeShort) {
- this.dataTypeShort = dataTypeShort;
- }
-
- public Long getAkiCount() {
- return this.akiCount;
- }
-
- public void setAkiCount(Long akiCount) {
- this.akiCount = akiCount;
- }
-
- public Long getCkdCount() {
- return this.ckdCount;
- }
-
- public void setCkdCount(Long ckdCount) {
- this.ckdCount = ckdCount;
- }
-
- public Long getHrtCount() {
- return this.hrtCount;
- }
-
- public void setHrtCount(Long hrtCount) {
- this.hrtCount = hrtCount;
- }
-
- public Long getParticipantCount() {
- return this.participantCount;
- }
-
- public void setParticipantCount(Long participantCount) {
- this.participantCount = participantCount;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java
index ea25152..82cf3bc 100755
--- a/src/main/java/org/kpmp/gene/MyGeneInfoHit.java
+++ b/src/main/java/org/kpmp/gene/MyGeneInfoHit.java
@@ -7,56 +7,57 @@
import com.fasterxml.jackson.annotation.JsonProperty;
public class MyGeneInfoHit implements Comparable, Serializable {
- private String id;
- private String symbol;
- private String name;
- private String entrezgene;
- @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
- private List alias;
-
- public String getId() {
- return id;
- }
-
- @JsonProperty("_id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSymbol() {
- return symbol;
- }
-
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
-
- public String getEntrezgene() {
- return entrezgene;
- }
-
- public void setEntrezgene(String entrezgene) {
- this.entrezgene = entrezgene;
- }
-
- public List getAlias() {
- return alias;
- }
-
- public void setAlias(List alias) {
- this.alias = alias;
- }
-
- @Override
- public int compareTo(MyGeneInfoHit hit) {
- return this.getSymbol().compareTo(hit.getSymbol());
- }
+ private static final long serialVersionUID = 7498017467676968095L;
+ private String id;
+ private String symbol;
+ private String name;
+ private String entrezgene;
+ @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+ private List alias;
+
+ public String getId() {
+ return id;
+ }
+
+ @JsonProperty("_id")
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public String getEntrezgene() {
+ return entrezgene;
+ }
+
+ public void setEntrezgene(String entrezgene) {
+ this.entrezgene = entrezgene;
+ }
+
+ public List getAlias() {
+ return alias;
+ }
+
+ public void setAlias(List alias) {
+ this.alias = alias;
+ }
+
+ @Override
+ public int compareTo(MyGeneInfoHit hit) {
+ return this.getSymbol().compareTo(hit.getSymbol());
+ }
}
diff --git a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java
index b0fa067..2214db2 100755
--- a/src/main/java/org/kpmp/gene/MyGeneInfoResult.java
+++ b/src/main/java/org/kpmp/gene/MyGeneInfoResult.java
@@ -4,22 +4,23 @@
import java.util.List;
public class MyGeneInfoResult implements Serializable {
- private int total;
- private List hits;
+ private static final long serialVersionUID = 2296351561705106315L;
+ private int total;
+ private List hits;
- public int getTotal() {
- return total;
- }
+ public int getTotal() {
+ return total;
+ }
- public void setTotal(int total) {
- this.total = total;
- }
+ public void setTotal(int total) {
+ this.total = total;
+ }
- public List getHits() {
- return hits;
- }
+ public List getHits() {
+ return hits;
+ }
- public void setHits(List hits) {
- this.hits = hits;
- }
+ public void setHits(List hits) {
+ this.hits = hits;
+ }
}
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
index 97235e8..30cb93b 100755
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataAllSegments.java
@@ -1,15 +1,17 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "rt_segments")
public class RTExpressionDataAllSegments implements RTExpressionData, Serializable {
+ private static final long serialVersionUID = 9029734049386312455L;
@Id
@Column(name = "id")
private Integer id;
@@ -122,10 +124,12 @@ public void setSampleCount(Integer sampleCount) {
this.sampleCount = sampleCount;
}
+ @Override
public String getSegmentName() {
return segmentName;
}
+ @Override
public void setSegmentName(String segmentName) {
this.segmentName = segmentName;
}
diff --git a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java
index 603ea54..0a33cf2 100755
--- a/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java
+++ b/src/main/java/org/kpmp/geneExpression/RTExpressionDataGTI.java
@@ -1,15 +1,17 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "rt_gti")
public class RTExpressionDataGTI implements RTExpressionData, Serializable {
+ private static final long serialVersionUID = 4789000526795024990L;
@Id
@Column(name = "id")
private Integer id;
@@ -122,10 +124,12 @@ public void setSampleCount(Integer sampleCount) {
this.sampleCount = sampleCount;
}
+ @Override
public String getSegmentName() {
return segmentName;
}
+ @Override
public void setSegmentName(String segmentName) {
this.segmentName = segmentName;
}
diff --git a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
index 020c8ef..7a738ff 100755
--- a/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
+++ b/src/main/java/org/kpmp/geneExpression/SCExpressionData.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -8,12 +10,11 @@
import org.json.JSONException;
import org.json.JSONObject;
-import java.io.Serializable;
-
@Entity
@Table(name = "sc_feature_data")
class SCExpressionData implements Serializable {
+ private static final long serialVersionUID = 1079445825708102694L;
@Id
@Column(name = "gene_symbol")
private String geneSymbol;
diff --git a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
index 7929651..1e21871 100755
--- a/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
+++ b/src/main/java/org/kpmp/geneExpression/SNExpressionData.java
@@ -1,5 +1,7 @@
package org.kpmp.geneExpression;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@@ -8,12 +10,11 @@
import org.json.JSONException;
import org.json.JSONObject;
-import java.io.Serializable;
-
@Entity
@Table(name = "sn_feature_data")
class SNExpressionData implements Serializable {
+ private static final long serialVersionUID = -3363426907715685587L;
@Id
@Column(name = "gene_symbol")
private String geneSymbol;
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java b/src/main/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryService.java
index 0e32c16..91e0452 100755
--- 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/RTParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java
index 4a5639b..62df11f 100755
--- a/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/RTParticipantValue.java
@@ -1,17 +1,20 @@
package org.kpmp.geneExpressionSummary;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "rt_participant_tissue_v")
@IdClass(ParticipantId.class)
class RTParticipantValue implements Participant, Serializable {
+ private static final long serialVersionUID = 5368734102102552073L;
+
@Column(name = "tissue_type")
private String tissueType;
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java
index 4aa8c40..8cc08ef 100755
--- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAGeneExpressionExpressionSummaryValue.java
@@ -17,6 +17,7 @@
@IdClass(GeneExpressionId.class)
public class SCRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable {
+ private static final long serialVersionUID = 7265280085624504185L;
@Column(name = "id")
private Integer id;
@Column(name = "tissue_type")
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java
index d52bda7..a758ab5 100755
--- a/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SCRNAParticipantValue.java
@@ -1,17 +1,20 @@
package org.kpmp.geneExpressionSummary;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "sn_participant_tissue_v")
@IdClass(ParticipantId.class)
public class SCRNAParticipantValue implements Serializable {
+ private static final long serialVersionUID = 8746341469788157316L;
+
@Column(name = "tissue_type")
private String tissueType;
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java
index 6f12920..7093151 100755
--- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAGeneExpressionExpressionSummaryValue.java
@@ -1,7 +1,6 @@
package org.kpmp.geneExpressionSummary;
-import org.kpmp.DataTypeEnum;
-import org.springframework.lang.Nullable;
+import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -9,13 +8,17 @@
import javax.persistence.IdClass;
import javax.persistence.Table;
import javax.persistence.Transient;
-import java.io.Serializable;
+
+import org.kpmp.DataTypeEnum;
+import org.springframework.lang.Nullable;
@Entity
@Table(name = "sn_rnaseq")
@IdClass(GeneExpressionId.class)
public class SNRNAGeneExpressionExpressionSummaryValue implements GeneExpressionSummary, Serializable {
+ private static final long serialVersionUID = -443713903175981503L;
+
@Column(name = "id")
private Integer id;
@@ -96,20 +99,24 @@ public void setGene(String gene) {
this.gene = gene;
}
+ @Override
@Nullable
public Double getPVal() {
return pVal;
}
+ @Override
public void setPVal(Double pVal) {
this.pVal = pVal;
}
+ @Override
@Nullable
public Double getPValAdj() {
return pValAdj;
}
+ @Override
public void setPValAdj(Double pValAdj) {
this.pValAdj = pValAdj;
}
@@ -203,6 +210,7 @@ public boolean equals(Object obj) {
if (!(obj instanceof SNRNAGeneExpressionExpressionSummaryValue))
return false;
SNRNAGeneExpressionExpressionSummaryValue snrnaGeneExpressionExpressionSummaryValue = (SNRNAGeneExpressionExpressionSummaryValue) obj;
- return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene()) && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster()));
+ return (snrnaGeneExpressionExpressionSummaryValue.getGene().equals(this.getGene())
+ && snrnaGeneExpressionExpressionSummaryValue.getCluster().equals(this.getCluster()));
}
}
diff --git a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java
index 2b6eb04..6c9dadc 100755
--- a/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java
+++ b/src/main/java/org/kpmp/geneExpressionSummary/SNRNAParticipantValue.java
@@ -1,17 +1,20 @@
package org.kpmp.geneExpressionSummary;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "sn_participant_tissue_v")
@IdClass(ParticipantId.class)
public class SNRNAParticipantValue implements Participant, Serializable {
+ private static final long serialVersionUID = -2404700991479961255L;
+
@Column(name = "tissue_type")
private String tissueType;
diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java
index 58e5897..c90a5a0 100755
--- a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java
+++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java
@@ -1,112 +1,114 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "participant")
-public class ParticipantSummaryDataset implements Serializable {
- @Id
- @Column(name = "participant_id")
- private int participantId;
- @Column(name = "old_participant_id")
- private String oldparticipantId;
- @Column(name = "redcap_id")
- private String redcapId;
- @Column(name = "age_binned")
- private String ageBinned;
- private String sex;
- @Column(name = "tissue_source")
- private String tissueSource;
- private String protocol;
- @Column(name = "sample_type")
- private String sampleType;
- @Column(name = "tissue_type")
- private String tissueType;
- @Column(name = "clinical_data")
- private String clinicalData;
-
- public int getParticipantId() {
- return participantId;
- }
-
- public void setParticipantId(int participantId) {
- this.participantId = participantId;
- }
-
- public String getOldParticipantId() {
- return oldparticipantId;
- }
-
- public void setOldParticipantId(String oldparticipantId) {
- this.oldparticipantId = oldparticipantId;
- }
-
- public String getRedcapId() {
- return redcapId;
- }
-
- public void setRedcapId(String redcapId) {
- this.redcapId = redcapId;
- }
-
- public String getAgeBinned() {
- return ageBinned;
- }
-
- public void setAgeBinned(String ageBinned) {
- this.ageBinned = ageBinned;
- }
-
- public String getSex() {
- return sex;
- }
-
- public void setSex(String sex) {
- this.sex = sex;
- }
-
- public String getTissueSource() {
- return tissueSource;
- }
-
- public void setTissueSource(String tissueSource) {
- this.tissueSource = tissueSource;
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- public String getSampleType() {
- return sampleType;
- }
-
- public void setSampleType(String sampleType) {
- this.sampleType = sampleType;
- }
-
- public String getTissueType() {
- return tissueType;
- }
-
- public void setTissueType(String tissueType) {
- this.tissueType = tissueType;
- }
-
- public String getClinicalData() {
- return clinicalData;
- }
-
- public void setClinicalData(String clinicalData) {
- this.clinicalData = clinicalData;
- }
+public class ParticipantSummaryDataset implements Serializable {
+ private static final long serialVersionUID = -6616360991151079273L;
+ @Id
+ @Column(name = "participant_id")
+ private int participantId;
+ @Column(name = "old_participant_id")
+ private String oldparticipantId;
+ @Column(name = "redcap_id")
+ private String redcapId;
+ @Column(name = "age_binned")
+ private String ageBinned;
+ private String sex;
+ @Column(name = "tissue_source")
+ private String tissueSource;
+ private String protocol;
+ @Column(name = "sample_type")
+ private String sampleType;
+ @Column(name = "tissue_type")
+ private String tissueType;
+ @Column(name = "clinical_data")
+ private String clinicalData;
+
+ public int getParticipantId() {
+ return participantId;
+ }
+
+ public void setParticipantId(int participantId) {
+ this.participantId = participantId;
+ }
+
+ public String getOldParticipantId() {
+ return oldparticipantId;
+ }
+
+ public void setOldParticipantId(String oldparticipantId) {
+ this.oldparticipantId = oldparticipantId;
+ }
+
+ public String getRedcapId() {
+ return redcapId;
+ }
+
+ public void setRedcapId(String redcapId) {
+ this.redcapId = redcapId;
+ }
+
+ public String getAgeBinned() {
+ return ageBinned;
+ }
+
+ public void setAgeBinned(String ageBinned) {
+ this.ageBinned = ageBinned;
+ }
+
+ public String getSex() {
+ return sex;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+ public String getTissueSource() {
+ return tissueSource;
+ }
+
+ public void setTissueSource(String tissueSource) {
+ this.tissueSource = tissueSource;
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ public String getSampleType() {
+ return sampleType;
+ }
+
+ public void setSampleType(String sampleType) {
+ this.sampleType = sampleType;
+ }
+
+ public String getTissueType() {
+ return tissueType;
+ }
+
+ public void setTissueType(String tissueType) {
+ this.tissueType = tissueType;
+ }
+
+ public String getClinicalData() {
+ return clinicalData;
+ }
+
+ public void setClinicalData(String clinicalData) {
+ this.clinicalData = clinicalData;
+ }
}
diff --git a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java
index 7ec6cc0..2c0b70f 100644
--- a/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java
+++ b/src/main/java/org/kpmp/participant/ParticipantTissueTypeSummary.java
@@ -1,7 +1,9 @@
package org.kpmp.participant;
+
import java.io.Serializable;
-import java.lang.Long;
-public class ParticipantTissueTypeSummary implements Serializable{
+
+public class ParticipantTissueTypeSummary implements Serializable {
+ private static final long serialVersionUID = 4596059416539472482L;
private Long akiCount;
private Long ckdCount;
private Long hrtCount;
@@ -13,26 +15,26 @@ public ParticipantTissueTypeSummary(Long akiCount, Long ckdCount, Long hrtCount)
}
public Long getAkiCount() {
- return this.akiCount;
- }
+ return this.akiCount;
+ }
- public void setAkiCount(Long akiCount) {
- this.akiCount = akiCount;
- }
+ public void setAkiCount(Long akiCount) {
+ this.akiCount = akiCount;
+ }
- public Long getCkdCount() {
- return this.ckdCount;
- }
+ public Long getCkdCount() {
+ return this.ckdCount;
+ }
- public void setCkdCount(Long ckdCount) {
- this.ckdCount = ckdCount;
- }
+ public void setCkdCount(Long ckdCount) {
+ this.ckdCount = ckdCount;
+ }
- public Long getHrtCount() {
- return this.hrtCount;
- }
+ public Long getHrtCount() {
+ return this.hrtCount;
+ }
- public void setHrtCount(Long hrtCount) {
- this.hrtCount = hrtCount;
- }
+ public void setHrtCount(Long hrtCount) {
+ this.hrtCount = hrtCount;
+ }
}
diff --git a/src/main/java/org/kpmp/participant/SingleCellMetadata.java b/src/main/java/org/kpmp/participant/SingleCellMetadata.java
index fea984b..6dc4c08 100755
--- a/src/main/java/org/kpmp/participant/SingleCellMetadata.java
+++ b/src/main/java/org/kpmp/participant/SingleCellMetadata.java
@@ -1,15 +1,17 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "sc_metadata")
class SingleCellMetadata implements Serializable {
+ private static final long serialVersionUID = -7074542040879592316L;
@Id
private String barcode;
@Column(name = "specimen_id")
diff --git a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
index d92341f..417e59c 100755
--- a/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
+++ b/src/main/java/org/kpmp/participant/SingleNucleusMetadata.java
@@ -1,15 +1,17 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "sn_metadata")
class SingleNucleusMetadata implements Serializable {
+ private static final long serialVersionUID = -504357775835334661L;
@Id
private String barcode;
@Column(name = "specimen_id")
diff --git a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java
index 738231c..44f2985 100755
--- a/src/main/java/org/kpmp/participant/SpatialViewerDataType.java
+++ b/src/main/java/org/kpmp/participant/SpatialViewerDataType.java
@@ -1,15 +1,18 @@
package org.kpmp.participant;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import java.io.Serializable;
@Entity
@Table(name = "sv_data_type_v")
class SpatialViewerDataType implements Serializable {
+ private static final long serialVersionUID = 3095549192644880754L;
+
@Id
@Column(name = "data_type")
private String dataType;
diff --git a/src/main/java/org/kpmp/umap/FeatureData.java b/src/main/java/org/kpmp/umap/FeatureData.java
index afa311e..8ebb50f 100755
--- a/src/main/java/org/kpmp/umap/FeatureData.java
+++ b/src/main/java/org/kpmp/umap/FeatureData.java
@@ -6,13 +6,13 @@
public class FeatureData implements Serializable {
+ private static final long serialVersionUID = 6332061560137675936L;
private List xValues = new ArrayList<>();
private List yValues = new ArrayList<>();
private List expression = new ArrayList<>();
- private List hoverDisplay = new ArrayList<>();
+ private List hoverDisplay = new ArrayList<>();
-
- public List getXValues() {
+ public List getXValues() {
return xValues;
}
@@ -48,16 +48,16 @@ public void addExpression(Double expressionValue) {
this.expression.add(expressionValue);
}
- public List getHoverDisplay() {
- return hoverDisplay;
- }
+ public List getHoverDisplay() {
+ return hoverDisplay;
+ }
- public void setHoverDisplay(List hoverDisplay) {
- this.hoverDisplay = hoverDisplay;
- }
+ public void setHoverDisplay(List hoverDisplay) {
+ this.hoverDisplay = hoverDisplay;
+ }
- public void addHoverDisplay(String hoverDisplay) {
- this.hoverDisplay.add(hoverDisplay);
- }
+ public void addHoverDisplay(String hoverDisplay) {
+ this.hoverDisplay.add(hoverDisplay);
+ }
}
diff --git a/src/main/java/org/kpmp/umap/PlotData.java b/src/main/java/org/kpmp/umap/PlotData.java
index 47b3b3d..24f637f 100755
--- a/src/main/java/org/kpmp/umap/PlotData.java
+++ b/src/main/java/org/kpmp/umap/PlotData.java
@@ -5,6 +5,7 @@
public class PlotData implements Serializable {
+ private static final long serialVersionUID = 7957121452487372467L;
private List referenceData;
private List featureData;
diff --git a/src/main/java/org/kpmp/umap/ReferenceCluster.java b/src/main/java/org/kpmp/umap/ReferenceCluster.java
index c65eb87..d5a0080 100755
--- a/src/main/java/org/kpmp/umap/ReferenceCluster.java
+++ b/src/main/java/org/kpmp/umap/ReferenceCluster.java
@@ -6,6 +6,7 @@
public class ReferenceCluster implements Serializable {
+ private static final long serialVersionUID = -3963666320832242935L;
private List xValues = new ArrayList<>();
private List yValues = new ArrayList<>();
private String color;
@@ -57,11 +58,11 @@ public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
+ public String getClusterAbbreviation() {
+ return clusterAbbreviation;
+ }
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
+ public void setClusterAbbreviation(String clusterAbbreviation) {
+ this.clusterAbbreviation = clusterAbbreviation;
+ }
}
diff --git a/src/main/java/org/kpmp/umap/SCMetadata.java b/src/main/java/org/kpmp/umap/SCMetadata.java
index 96aa658..dff6125 100755
--- a/src/main/java/org/kpmp/umap/SCMetadata.java
+++ b/src/main/java/org/kpmp/umap/SCMetadata.java
@@ -1,22 +1,24 @@
package org.kpmp.umap;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
-import java.io.Serializable;
@Entity
@Table(name = "sc_umap_point_v")
public class SCMetadata implements UmapPoint, Serializable {
+ private static final long serialVersionUID = 7947867645080936879L;
@Column(name = "umap_x")
private double umapX;
@Column(name = "umap_y")
private double umapY;
- @Column(name = "cluster_abbreviation")
- private String clusterAbbreviation;
+ @Column(name = "cluster_abbreviation")
+ private String clusterAbbreviation;
@Column(name = "cluster_name")
private String clusterName;
@Column(name = "cluster_color")
@@ -59,15 +61,15 @@ public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
- @Override
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
+ @Override
+ public String getClusterAbbreviation() {
+ return clusterAbbreviation;
+ }
- @Override
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
+ @Override
+ public void setClusterAbbreviation(String clusterAbbreviation) {
+ this.clusterAbbreviation = clusterAbbreviation;
+ }
@Override
public String getClusterColor() {
diff --git a/src/main/java/org/kpmp/umap/SNMetadata.java b/src/main/java/org/kpmp/umap/SNMetadata.java
index 5365c50..7e2a5d4 100755
--- a/src/main/java/org/kpmp/umap/SNMetadata.java
+++ b/src/main/java/org/kpmp/umap/SNMetadata.java
@@ -1,22 +1,24 @@
package org.kpmp.umap;
+import java.io.Serializable;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
-import java.io.Serializable;
@Entity
@Table(name = "sn_umap_point_v")
public class SNMetadata implements UmapPoint, Serializable {
+ private static final long serialVersionUID = -8871186152958713643L;
@Column(name = "umap_x")
private double umapX;
@Column(name = "umap_y")
private double umapY;
@Column(name = "cluster_abbreviation")
- private String clusterAbbreviation;
+ private String clusterAbbreviation;
@Column(name = "cluster_name")
private String clusterName;
@Column(name = "cluster_color")
@@ -59,17 +61,17 @@ public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
- @Override
- public String getClusterAbbreviation() {
- return clusterAbbreviation;
- }
+ @Override
+ public String getClusterAbbreviation() {
+ return clusterAbbreviation;
+ }
- @Override
- public void setClusterAbbreviation(String clusterAbbreviation) {
- this.clusterAbbreviation = clusterAbbreviation;
- }
+ @Override
+ public void setClusterAbbreviation(String clusterAbbreviation) {
+ this.clusterAbbreviation = clusterAbbreviation;
+ }
- @Override
+ @Override
public String getClusterColor() {
return clusterColor;
}
diff --git a/src/main/resources/knowledge_environment.graphqls b/src/main/resources/knowledge_environment.graphqls
index 6d12b12..6d94de6 100755
--- a/src/main/resources/knowledge_environment.graphqls
+++ b/src/main/resources/knowledge_environment.graphqls
@@ -14,6 +14,24 @@ type Query {
participantSummaryDataset(redcapId: String): ParticipantSummaryDataset
participantClinicalDataset(redcapId: String): ParticipantSummaryDataset
getTissueTypeSummaryData: [ParticipantTissueTypeSummary]
+ getAtlasSummaryRows: AtlasRepoSummaryResult
+}
+
+type AtlasRepoSummaryResult {
+ totalFiles: Int
+ summaryRows: [AtlasRepoSummaryRow]
+}
+
+type AtlasRepoSummaryRow {
+ openCount: Int
+ controlledCount: Int
+ omicsType: String
+ linkInformation: AtlasRepoSummaryLinkInformation
+}
+
+type AtlasRepoSummaryLinkInformation {
+ linkType: String
+ linkValue: String
}
type ParticipantTissueTypeSummary {
diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java
index 7f542f9..6be38b3 100755
--- a/src/test/java/org/kpmp/QueryTest.java
+++ b/src/test/java/org/kpmp/QueryTest.java
@@ -1,6 +1,7 @@
package org.kpmp;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
@@ -20,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;
@@ -31,9 +33,9 @@
import org.kpmp.geneExpressionSummary.SCRNAGeneExpressionExpressionSummaryValue;
import org.kpmp.geneExpressionSummary.SNRNAGeneExpressionExpressionSummaryValue;
import org.kpmp.participant.ParticipantDataTypeSummary;
-import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.participant.ParticipantService;
import org.kpmp.participant.ParticipantSummaryDataset;
+import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.umap.FeatureData;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.ReferenceCluster;
@@ -78,6 +80,26 @@ public void tearDown() throws Exception {
query = null;
}
+ @Test
+ public void testGetAtlasSummaryRows() throws Exception {
+ AtlasRepoSummaryResult expectedResult = mock(AtlasRepoSummaryResult.class);
+ when(dataSummaryService.getAtlasRepoSummary()).thenReturn(expectedResult);
+
+ assertEquals(expectedResult, query.getAtlasSummaryRows());
+ }
+
+ @Test
+ public void testGetAtlasSummaryRows_throwsException() throws Exception {
+ when(dataSummaryService.getAtlasRepoSummary()).thenThrow(new Exception("ack"));
+
+ try {
+ query.getAtlasSummaryRows();
+ fail("Should have thrown exception");
+ } catch (Exception e) {
+ assertEquals("ack", e.getMessage());
+ }
+ }
+
@Test
public void testGenes() throws Exception {
List expectedResult = Arrays.asList(new MyGeneInfoHit());
@@ -192,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);
}
@@ -251,12 +273,12 @@ public void testParticipantClinicalDataset() throws Exception {
assertEquals(expected, query.participantClinicalDataset("participant_id"));
}
-
+
public void getParticipantTissueTypeSummary() throws Exception {
List expectedResult = new ArrayList<>();
expectedResult.add(new ParticipantTissueTypeSummary(Long.valueOf(4), Long.valueOf(5), Long.valueOf(6)));
-
+
List tissueSummary = query.getTissueTypeSummaryData();
assertEquals(expectedResult, tissueSummary);
diff --git a/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java b/src/test/java/org/kpmp/dataSummary/AtlasRepoSummaryLinkInformationTest.java
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
index 834bed1..65bb950 100755
--- a/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java
+++ b/src/test/java/org/kpmp/dataSummary/DataSummaryServiceTest.java
@@ -3,6 +3,7 @@
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
+import java.util.Arrays;
import java.util.List;
import org.junit.After;
@@ -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
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 100755
--- 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/geneExpressionSummary/GeneExpressionSummaryServiceTest.java b/src/test/java/org/kpmp/geneExpressionSummary/GeneExpressionSummaryServiceTest.java
index 83c25b8..e7f5054 100755
--- 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/participant/SingleCellMetadataTest.java b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
index 019b79d..dbea114 100755
--- a/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
+++ b/src/test/java/org/kpmp/participant/SingleCellMetadataTest.java
@@ -6,7 +6,7 @@
import org.junit.Before;
import org.junit.Test;
-public class SingleCellMetadataTest extends SingleCellMetadata {
+public class SingleCellMetadataTest {
private SingleCellMetadata scMetadata;
diff --git a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
index 9e95d0d..2c62101 100755
--- a/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
+++ b/src/test/java/org/kpmp/participant/SingleNucleusMetadataTest.java
@@ -6,7 +6,7 @@
import org.junit.Before;
import org.junit.Test;
-public class SingleNucleusMetadataTest extends SingleNucleusMetadata {
+public class SingleNucleusMetadataTest {
private SingleNucleusMetadata snMetadata;