Skip to content

Commit

Permalink
Merge pull request #138 from KPMP/develop
Browse files Browse the repository at this point in the history
Release v2.4
  • Loading branch information
rlreamy authored Jul 2, 2024
2 parents aa63786 + 1fc97e4 commit 536eb84
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-gradle-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
build-gradle-project:
env:
IMAGE_TAG: 2.3.1
IMAGE_TAG: 2.4.0
runs-on: ubuntu-latest
steps:
- name: Get branch names
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apply plugin: 'io.spring.dependency-management'

jar {
baseName='pegasus-data'
version= '2.3.1'
version= '2.4.0'
}

repositories {
Expand Down
14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## Release 2.4 [unreleased]
Brief summary of what's in this release:
- added a total column to show total number of files for a grouping (needed back end because total includes groups not shown on atlas home page or explorer home page)

### Breaking changes

Breaking changes include any database updates needed, if we need to edit any files on system (like .env or certs, etc). Things that are outside of the code itself that need changed for the system to work.


### Non-breaking changes

Just a place to keep track of things that have changed in the code that we may want to pay special attention to when smoke testing, etc.
9 changes: 9 additions & 0 deletions src/main/java/org/kpmp/dataSummary/AtlasRepoSummaryRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class AtlasRepoSummaryRow {
private Long ckdCount;
private Long hrtCount;
private Long dmrCount;
private Long totalCount;

public AtlasRepoSummaryRow(String omicsType, AtlasRepositoryLinkInformation linkInformation) {
this.omicsType = omicsType;
Expand Down Expand Up @@ -45,6 +46,14 @@ public void setDmrCount(Long dmrCount) {
this.dmrCount = dmrCount;
}

public Long getTotalCount() {
return this.totalCount;
}

public void setTotalCount(Long totalCount) {
this.totalCount = totalCount;
}

public String getOmicsType() {
return omicsType;
}
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,39 @@ public interface DataSummaryRepository extends CrudRepository<DataSummaryValue,
+ "join file f on f.file_id= fp.file_id " + "join sv_file_info sv on sv.file_id = f.file_id "
+ "where sv.config_type = :data_type " + "and p.tissue_type = :tissue_type", nativeQuery = true)
Long getDataSummaryCount(@Param("tissue_type") String tissue_type, @Param("data_type") String data_type);

@Cacheable("dataSummaryTotal")
@Query(value = "select count(distinct(redcap_id)) from participant p "
+ "join file_participant fp on p.participant_id = fp.participant_id "
+ "join file f on f.file_id= fp.file_id " + "join sv_file_info sv on sv.file_id = f.file_id "
+ "where sv.config_type = :data_type ", nativeQuery = true)
Long getDataSummaryTotal(@Param("data_type") String data_type);

@Cacheable("repoDataSummaryCount")
@Query(value = "select count(distinct(dl_file_id)) from repo_file_v where experimental_strategy = :exp_strat and tissue_type = :tissue_type", nativeQuery = true)
Long getRepoDataSummaryCount(@Param("tissue_type") String tissue_type, @Param("exp_strat") String exp_strat);

@Cacheable("repoDataSummaryTotal")
@Query(value = "select count(distinct(dl_file_id)) from repo_file_v where experimental_strategy = :exp_strat", nativeQuery = true)
Long getRepoDataSummaryTotal(@Param("exp_strat") String exp_strat);

@Cacheable("repoBiomarkerSummaryCount")
@Query(value = "select count(distinct(dl_file_id)) from repo_file_v where data_category = 'Biomarker' and tissue_type = :tissue_type", nativeQuery = true)
Long getRepoBiomarkerSummaryCount(@Param("tissue_type") String tissue_type);

@Cacheable("repoBiomarkerSummaryTotal")
@Query(value = "select count(distinct(dl_file_id)) from repo_file_v where data_category = 'Biomarker' ", nativeQuery = true)
Long getRepoBiomarkerSummaryTotal();

@Cacheable("dataSummaryLinkCount")
@Query(value = "select count(distinct(redcap_id)) " + "from sv_link_v " + "where data_type = :data_type "
+ "and tissue_type = :tissue_type", nativeQuery = true)
Long getDataSummaryLinkCount(@Param("tissue_type") String tissue_type, @Param("data_type") String data_type);

@Cacheable("dataSummaryLinkTotal")
@Query(value = "select count(distinct(redcap_id)) " + "from sv_link_v " + "where data_type = :data_type ", nativeQuery = true)
Long getDataSummaryLinkTotal(@Param("data_type") String data_type);

@Cacheable("dataParticipantSummaryCount")
@Query(value = "SELECT count(*) FROM sv_file_v WHERE data_type= :data_type", nativeQuery = true)
Long getParticipantSummaryCount(@Param("data_type") String data_type);
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/org/kpmp/dataSummary/DataSummaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ private void setCounts(ExperimentalStrategyValue experimentalStrategyValue, Atla
TissueTypeEnum.DMR.getParticipantTissueType()
)
);
atlasRepoSummaryRow.setTotalCount(
dataSummaryRepository.getRepoBiomarkerSummaryTotal()
);
}
else {
atlasRepoSummaryRow.setAkiCount(
Expand All @@ -136,6 +139,11 @@ private void setCounts(ExperimentalStrategyValue experimentalStrategyValue, Atla
experimentalStrategyValue.getExperimentalStrategy()
)
);
atlasRepoSummaryRow.setTotalCount(
dataSummaryRepository.getRepoDataSummaryTotal(
experimentalStrategyValue.getExperimentalStrategy()
)
);
}
}

Expand All @@ -153,6 +161,7 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryTotal(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryCount(FullDataTypeEnum.SPATIAL_TRANSCRIPTOMICS_FULL.getFullName())));

Expand All @@ -167,6 +176,7 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
dataSummaryRepository.getDataSummaryTotal(FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName()),
dataSummaryRepository.getParticipantSummaryCount(
FullDataTypeEnum.TISSUE_IMAGING_AND_CYTOMETRY_3D_FULL.getFullName())));

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

Expand All @@ -194,6 +206,7 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.CODEX_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.CODEX_FULL.getFullName()),
dataSummaryRepository.getDataSummaryTotal(FullDataTypeEnum.CODEX_FULL.getFullName()),
dataSummaryRepository.getParticipantSummaryCount(FullDataTypeEnum.CODEX_FULL.getFullName())));

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

Expand All @@ -223,6 +237,7 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkTotal(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName())));

Expand All @@ -238,6 +253,7 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
dataSummaryRepository.getDataSummaryLinkTotal(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName())));

Expand All @@ -253,6 +269,7 @@ public List<DataTypeSummary> getSummaryData() {
FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()),
dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(),
FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()),
dataSummaryRepository.getDataSummaryTotal(FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()),
dataSummaryRepository
.getParticipantSummaryCount(FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName())));
return summaryData;
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/org/kpmp/dataSummary/DataTypeSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class DataTypeSummary implements Serializable {
private Long hrtCount;
private Long participantCount;
private Long dmrCount;
private Long totalCount;

public DataTypeSummary(String omicsType, String dataType, String dataTypeShort, Long akiCount, Long ckdCount,
Long hrtCount, Long dmrCount, Long participantCount) {
Expand All @@ -24,6 +25,19 @@ public DataTypeSummary(String omicsType, String dataType, String dataTypeShort,
this.dmrCount = dmrCount;
this.participantCount = participantCount;
}

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

public String getOmicsType() {
return this.omicsType;
Expand Down Expand Up @@ -88,4 +102,12 @@ public Long getDmrCount() {
public void setDmrCount(Long dmrCount) {
this.dmrCount = dmrCount;
}

public Long getTotalCount() {
return this.totalCount;
}

public void setTotalCount(Long totalCount) {
this.totalCount = totalCount;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public List<DataTypeSummary> getDataTypeSummaryInformation() {
scrnaGeneExpressionRepository
.getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()),
scrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.DMR.getParticipantTissueType()),
scrnaParticipantRepository.getParticipantCount(),
scrnaParticipantRepository.getParticipantCount()));
dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName(), DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation(),
Expand All @@ -143,6 +144,7 @@ public List<DataTypeSummary> getDataTypeSummaryInformation() {
snrnaGeneExpressionRepository
.getCountByTissue(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()),
snrnaGeneExpressionRepository.getCountByTissue(TissueTypeEnum.DMR.getParticipantTissueType()),
snrnaParticipantRepository.getParticipantCount(),
snrnaParticipantRepository.getParticipantCount()));
dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS_FULL.getFullName(),
Expand All @@ -152,6 +154,7 @@ public List<DataTypeSummary> getDataTypeSummaryInformation() {
rtParticipantRepository
.getCountByTissueType(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()),
rtParticipantRepository.getCountByTissueType(TissueTypeEnum.DMR.getParticipantTissueType()),
rtParticipantRepository.getParticipantCount(),
rtParticipantRepository.getParticipantCount()));
dataTypeSummary.add(new DataTypeSummary(OmicsTypeEnum.NONE.getEnum(),
FullDataTypeEnum.REGIONAL_PROTEOMICS_FULL.getFullName(),
Expand All @@ -161,6 +164,7 @@ public List<DataTypeSummary> getDataTypeSummaryInformation() {
rpParticipantRepository
.getCountByTissueType(TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType()),
rpParticipantRepository.getCountByTissueType(TissueTypeEnum.DMR.getParticipantTissueType()),
rpParticipantRepository.getParticipantCount(),
rpParticipantRepository.getParticipantCount()));
return dataTypeSummary;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/knowledge_environment.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type AtlasRepoSummaryRow {
ckdCount: Long
hrtCount: Long
dmrCount: Long
totalCount: Long
omicsType: String
linkInformation: AtlasRepositoryLinkInformation
}
Expand Down Expand Up @@ -85,6 +86,7 @@ type DataTypeSummaryInformation {
ckdCount: Long
hrtCount: Long
dmrCount: Long
totalCount: Long
participantCount: Long
}

Expand Down

0 comments on commit 536eb84

Please sign in to comment.