Skip to content

Commit

Permalink
Merge pull request #90 from KPMP/develop
Browse files Browse the repository at this point in the history
Prep for release 2.0
  • Loading branch information
rlreamy authored Jun 30, 2023
2 parents de0301f + 3274973 commit 77bb7e4
Show file tree
Hide file tree
Showing 26 changed files with 446 additions and 749 deletions.
621 changes: 4 additions & 617 deletions .classpath

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,32 @@
<projectDescription>
<name>pegasus-data</name>
<comment></comment>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments/>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<linkedResources/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1</id>
<id>1686668102644</id>
<name></name>
<type>30</type>
<name/>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/org/kpmp/TissueTypeEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public enum TissueTypeEnum {

ALL("all", "all"), AKI("aki", "AKI"), CKD("ckd", "CKD"), HEALTHY_REFERENCE("hrt", "Healthy Reference"),
UNKNOWN("", "");
DMR("dmr", "DM-R"), UNKNOWN("", "");

private String requestType;
private String participantTissueType;
Expand Down Expand Up @@ -31,7 +31,10 @@ public static TissueTypeEnum fromRequestType(String requestType) {
return CKD;
} else if (HEALTHY_REFERENCE.requestType.equalsIgnoreCase(requestType)) {
return HEALTHY_REFERENCE;
} else {
} else if (DMR.requestType.equalsIgnoreCase(requestType)) {
return DMR;
}
else {
return UNKNOWN;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
public class AtlasRepoSummaryResult {

private List<AtlasRepoSummaryRow> summaryRows;
private int totalFiles;
private Long totalFiles;

public AtlasRepoSummaryResult(List<AtlasRepoSummaryRow> summaryRows, int totalFiles) {
public AtlasRepoSummaryResult(List<AtlasRepoSummaryRow> summaryRows, Long totalFiles) {
this.summaryRows = summaryRows;
this.totalFiles = totalFiles;

Expand All @@ -26,11 +26,11 @@ public void setSummaryRows(List<AtlasRepoSummaryRow> summaryRows) {
this.summaryRows = summaryRows;
}

public int getTotalFiles() {
public Long getTotalFiles() {
return totalFiles;
}

public void setTotalFiles(int totalFiles) {
public void setTotalFiles(Long totalFiles) {
this.totalFiles = totalFiles;
}

Expand Down
25 changes: 20 additions & 5 deletions src/main/java/org/kpmp/dataSummary/DataSummaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.kpmp.FullDataTypeEnum;
import org.kpmp.OmicsTypeEnum;
import org.kpmp.TissueTypeEnum;
import org.kpmp.file.ARFileInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand All @@ -26,18 +27,20 @@ public class DataSummaryService {

private DataSummaryRepository dataSummaryRepository;
private AtlasRepoSummaryRepository repoSummaryRepository;
private ARFileInfoService fileInfoService;

@Autowired
public DataSummaryService(DataSummaryRepository dataSummaryRepository,
AtlasRepoSummaryRepository repoSummaryRepository) {
AtlasRepoSummaryRepository repoSummaryRepository, ARFileInfoService fileInfoService) {
this.dataSummaryRepository = dataSummaryRepository;
this.repoSummaryRepository = repoSummaryRepository;
this.fileInfoService = fileInfoService;
}

public AtlasRepoSummaryResult getAtlasRepoSummary() throws Exception {
List<ExperimentalStrategyValue> experimentalStrategies = repoSummaryRepository.findAll();
Map<String, AtlasRepoSummaryRow> summaryMap = new HashMap<>();
int totalFiles = 0;

for (ExperimentalStrategyValue experimentalStrategyValue : experimentalStrategies) {
String experimentalStrategy = experimentalStrategyValue.getExperimentalStrategy();
if (experimentalStrategy.isEmpty()
Expand All @@ -50,13 +53,11 @@ public AtlasRepoSummaryResult getAtlasRepoSummary() throws Exception {
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();
}
}

Expand All @@ -69,7 +70,7 @@ public int compare(AtlasRepoSummaryRow one, AtlasRepoSummaryRow two) {
}
});

return new AtlasRepoSummaryResult(results, totalFiles);
return new AtlasRepoSummaryResult(results, fileInfoService.getRepositoryTotalFileCount());
}

private AtlasRepoSummaryLinkInformation getLinkInformation(ExperimentalStrategyValue experimentalStrategy) {
Expand Down Expand Up @@ -106,6 +107,8 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName())));

Expand All @@ -118,6 +121,8 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
dataSummaryRepository.getParticipantSummaryCount(
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName())));

Expand All @@ -130,6 +135,8 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName()),
dataSummaryRepository.getParticipantSummaryCount(
FullDataTypeEnum.LIGHT_MICROSCOPIC_WHOLE_SLIDE_IMAGES_FULL.getFullName())));

Expand All @@ -141,6 +148,8 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.CODEX_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.CODEX_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.CODEX_FULL.getFullName()),
dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName())));

summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(),
Expand All @@ -153,6 +162,8 @@ public List<DataTypeSummary> getSummaryData() {
dataSummaryRepository.getDataSummaryLinkCount(
TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL.getFullName())));

Expand All @@ -166,6 +177,8 @@ public List<DataTypeSummary> getSummaryData() {
dataSummaryRepository.getDataSummaryLinkCount(
TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName())));

Expand All @@ -179,6 +192,8 @@ public List<DataTypeSummary> getSummaryData() {
dataSummaryRepository.getDataSummaryLinkCount(
TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName())));
return summaryData;
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/org/kpmp/dataSummary/DataTypeSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ public class DataTypeSummary implements Serializable {
private Long ckdCount;
private Long hrtCount;
private Long participantCount;
private Long dmrCount;

public DataTypeSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount,
Long hrtCount, Long participantCount) {
Long hrtCount, Long dmrCount, Long participantCount) {
this.omicsType = omicsType;
this.dataType = dataType;
this.dataTypeShort = dataTypeShort;
this.akiCount = akiCount;
this.ckdCount = ckdCount;
this.hrtCount = hrtCount;
this.dmrCount = dmrCount;
this.participantCount = participantCount;
}

Expand Down Expand Up @@ -78,4 +80,12 @@ public Long getParticipantCount() {
public void setParticipantCount(Long participantCount) {
this.participantCount = participantCount;
}

public Long getDmrCount() {
return this.dmrCount;
}

public void setDmrCount(Long dmrCount) {
this.dmrCount = dmrCount;
}
}
57 changes: 57 additions & 0 deletions src/main/java/org/kpmp/file/ARFileInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package org.kpmp.file;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "ar_file_info")
public class ARFileInfo {
@Id
private int arFileInfoId;
private int fileId;
private int releaseVersion;
private int releaseSunsetVersion;
private int metadataTypeId;

public int getMetadataTypeId() {
return metadataTypeId;
}

public void setMetadataTypeId(int metadataTypeId) {
this.metadataTypeId = metadataTypeId;
}

public int getArFileInfoId() {
return arFileInfoId;
}

public void setArFileInfoId(int arFileInfoId) {
this.arFileInfoId = arFileInfoId;
}

public int getFileId() {
return fileId;
}

public void setFileId(int fileId) {
this.fileId = fileId;
}

public int getReleaseVersion() {
return releaseVersion;
}

public void setReleaseVersion(int releaseVersion) {
this.releaseVersion = releaseVersion;
}

public int getReleaseSunsetVersion() {
return releaseSunsetVersion;
}

public void setReleaseSunsetVersion(int releaseSunsetVersion) {
this.releaseSunsetVersion = releaseSunsetVersion;
}

}
14 changes: 14 additions & 0 deletions src/main/java/org/kpmp/file/ARFileInfoRepository.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.kpmp.file;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

@Repository
interface ARFileInfoRepository extends CrudRepository<ARFileInfo, Integer>{

@Cacheable("totalFileCount")
@Query(value = "select count(distinct(file_id)) from ar_file_info where release_sunset_version is null" , nativeQuery = true)
Long getTotalFileCount();
}
20 changes: 20 additions & 0 deletions src/main/java/org/kpmp/file/ARFileInfoService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.kpmp.file;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ARFileInfoService {

private ARFileInfoRepository repository;

@Autowired
public ARFileInfoService (ARFileInfoRepository repository) {
this.repository = repository;
}

public Long getRepositoryTotalFileCount() {
return repository.getTotalFileCount();
}

}
Loading

0 comments on commit 77bb7e4

Please sign in to comment.