diff --git a/.github/workflows/build-gradle-project.yml b/.github/workflows/build-gradle-project.yml index 7ae77c2..f20e1a6 100644 --- a/.github/workflows/build-gradle-project.yml +++ b/.github/workflows/build-gradle-project.yml @@ -6,7 +6,7 @@ on: jobs: build-gradle-project: env: - IMAGE_TAG: 2.3 + IMAGE_TAG: 2.3.1 runs-on: ubuntu-latest steps: - name: Get branch names @@ -42,8 +42,8 @@ jobs: if: steps.branch-names.outputs.current_branch == 'develop' run: | docker push "kingstonduo/pegasus-data:$IMAGE_TAG" - + - name: Push to Docker Hub if branch is not develop - if: ${{ !steps.branch-names.outputs.current_branch == 'develop' }} + if: steps.branch-names.outputs.current_branch != 'develop' run: | - docker push "kingstonduo/pegasus-data:${{ steps.branch-names.outputs.current_branch }}" \ No newline at end of file + docker push "kingstonduo/pegasus-data:${{ steps.branch-names.outputs.current_branch }}" diff --git a/build.gradle b/build.gradle index 235f3c1..647e08d 100755 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'io.spring.dependency-management' jar { baseName='pegasus-data' - version= '2.3' + version= '2.3.1' } repositories { @@ -59,12 +59,12 @@ task unpack(type: Copy) { into("build/dependency") } -def getTagInfo() { - if (project.hasProperty('tag')) { - def tagValue = project.property('tag') - return tagValue - } else { - def gitBranch = "Unknown branch" +def getCurrentGitBranch() { + if (project.hasProperty('tag')) { + def tagValue = project.property('tag') + return tagValue + } else { + def gitBranch = "Unknown branch" try { def workingDir = new File("${project.projectDir}") def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir) @@ -74,8 +74,8 @@ def getTagInfo() { } } catch (e) { } - if (gitBranch == "develop" || gitBranch == "master"){ - return "${jar.version}" + if (gitBranch == "develop" || gitBranch == "master"){ + return jar.version }else{ return gitBranch } @@ -83,7 +83,7 @@ def getTagInfo() { } docker { - name "${project.group}/${jar.baseName}:" + getTagInfo() + name "kingstonduo/${jar.baseName}:" + getCurrentGitBranch() copySpec.from(tasks.unpack.outputs).into("dependency") buildArgs(['DEPENDENCY': "dependency"]) -} \ No newline at end of file +} diff --git a/src/main/java/org/kpmp/DataTypeEnum.java b/src/main/java/org/kpmp/DataTypeEnum.java index 1dbb22a..a53da8a 100755 --- a/src/main/java/org/kpmp/DataTypeEnum.java +++ b/src/main/java/org/kpmp/DataTypeEnum.java @@ -14,6 +14,7 @@ public enum DataTypeEnum { SPATIAL_LIPIDOMICS("sl"), SPATIAL_METABOLOMICS("sm"), SPATIAL_NGLYCOMICS("sng"), + IMAGING_MASS_CYTOMETRY("imc"), UNKNOWN(""); private String abbreviation; @@ -49,7 +50,9 @@ public static DataTypeEnum fromAbbreviation(String abbreviation) { return SPATIAL_METABOLOMICS; } else if (SPATIAL_NGLYCOMICS.abbreviation.equals(abbreviation)) { return SPATIAL_NGLYCOMICS; - } + }else if (IMAGING_MASS_CYTOMETRY.abbreviation.equals(abbreviation)){ + return IMAGING_MASS_CYTOMETRY; + } return UNKNOWN; } } diff --git a/src/main/java/org/kpmp/FullDataTypeEnum.java b/src/main/java/org/kpmp/FullDataTypeEnum.java index f0eab0b..d5d4b8a 100755 --- a/src/main/java/org/kpmp/FullDataTypeEnum.java +++ b/src/main/java/org/kpmp/FullDataTypeEnum.java @@ -14,6 +14,7 @@ public enum FullDataTypeEnum { SPATIAL_LIPIDOMICS_FULL("Spatial Lipidomics"), SPATIAL_METABOLOMICS_FULL("Spatial Metabolomics"), SPATIAL_NGLYCOMICS_FULL("Spatial N-glycomics"), + IMAGING_MASS_CYTOMETRY_FULL("Imaging Mass Cytometry"), UNKNOWN_FULL(""); private String dataEnum; @@ -49,7 +50,9 @@ public static FullDataTypeEnum fromLong(String dataEnum) { return SPATIAL_METABOLOMICS_FULL; } else if (SPATIAL_NGLYCOMICS_FULL.dataEnum.equals(dataEnum)) { return SPATIAL_NGLYCOMICS_FULL; - } + }else if (IMAGING_MASS_CYTOMETRY_FULL.dataEnum.equals(dataEnum)){ + return IMAGING_MASS_CYTOMETRY_FULL; + } return UNKNOWN_FULL; } } diff --git a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java index 3e241fc..5ac4f50 100755 --- a/src/main/java/org/kpmp/dataSummary/DataSummaryService.java +++ b/src/main/java/org/kpmp/dataSummary/DataSummaryService.java @@ -240,6 +240,21 @@ public List getSummaryData() { FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()), dataSummaryRepository .getParticipantSummaryLinkCount(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()))); + + summaryData.add(new DataTypeSummary(OmicsTypeEnum.TRANSCRIPTOMICS.getEnum(), + FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName(), + DataTypeEnum.IMAGING_MASS_CYTOMETRY.getAbbreviation(), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.AKI.getParticipantTissueType(), + FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.CKD.getParticipantTissueType(), + FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount( + TissueTypeEnum.HEALTHY_REFERENCE.getParticipantTissueType(), + FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()), + dataSummaryRepository.getDataSummaryCount(TissueTypeEnum.DMR.getParticipantTissueType(), + FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()), + dataSummaryRepository + .getParticipantSummaryCount(FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()))); return summaryData; } } diff --git a/src/test/java/org/kpmp/DataTypeEnumTest.java b/src/test/java/org/kpmp/DataTypeEnumTest.java index 75d5fe0..9b87d33 100755 --- a/src/test/java/org/kpmp/DataTypeEnumTest.java +++ b/src/test/java/org/kpmp/DataTypeEnumTest.java @@ -4,11 +4,12 @@ import org.junit.Test; + public class DataTypeEnumTest { @Test public void testGetAbbreviation() { - assertEquals(12, DataTypeEnum.values().length); + assertEquals(13, DataTypeEnum.values().length); assertEquals("sn", DataTypeEnum.SINGLE_NUCLEUS.getAbbreviation()); assertEquals("sc", DataTypeEnum.SINGLE_CELL.getAbbreviation()); assertEquals("rt", DataTypeEnum.REGIONAL_TRANSCRIPTOMICS.getAbbreviation()); @@ -17,6 +18,7 @@ public void testGetAbbreviation() { assertEquals("sm", DataTypeEnum.SPATIAL_METABOLOMICS.getAbbreviation()); assertEquals("sng", DataTypeEnum.SPATIAL_NGLYCOMICS.getAbbreviation()); assertEquals("rp", DataTypeEnum.REGIONAL_PROTEOMICS.getAbbreviation()); + assertEquals("imc", DataTypeEnum.IMAGING_MASS_CYTOMETRY.getAbbreviation()); assertEquals("", DataTypeEnum.UNKNOWN.getAbbreviation()); } @@ -30,6 +32,7 @@ public void testFromAbbreviation() { assertEquals(DataTypeEnum.SPATIAL_METABOLOMICS, DataTypeEnum.fromAbbreviation("sm")); assertEquals(DataTypeEnum.SPATIAL_NGLYCOMICS, DataTypeEnum.fromAbbreviation("sng")); assertEquals(DataTypeEnum.REGIONAL_PROTEOMICS, DataTypeEnum.fromAbbreviation("rp")); + assertEquals(DataTypeEnum.IMAGING_MASS_CYTOMETRY, DataTypeEnum.fromAbbreviation("imc")); assertEquals(DataTypeEnum.UNKNOWN, DataTypeEnum.fromAbbreviation("xxx")); assertEquals(DataTypeEnum.UNKNOWN, DataTypeEnum.fromAbbreviation("")); assertEquals(DataTypeEnum.UNKNOWN, DataTypeEnum.fromAbbreviation(null)); diff --git a/src/test/java/org/kpmp/FullDataTypeEnumTest.java b/src/test/java/org/kpmp/FullDataTypeEnumTest.java index 203c958..f27f455 100755 --- a/src/test/java/org/kpmp/FullDataTypeEnumTest.java +++ b/src/test/java/org/kpmp/FullDataTypeEnumTest.java @@ -8,7 +8,7 @@ public class FullDataTypeEnumTest { @Test public void testGetLong() { - assertEquals(12, FullDataTypeEnum.values().length); + assertEquals(13, FullDataTypeEnum.values().length); assertEquals("Single-nucleus RNA-seq (snRNA-seq)", FullDataTypeEnum.SINGLE_NUCLEUS_FULL.getFullName()); assertEquals("Single-cell RNA-seq (scRNA-seq)", FullDataTypeEnum.SINGLE_CELL_FULL.getFullName()); assertEquals("Regional transcriptomics", FullDataTypeEnum.REGIONAL_TRANSCRIPTOMICS_FULL.getFullName()); @@ -17,6 +17,7 @@ public void testGetLong() { assertEquals("Spatial Metabolomics", FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL.getFullName()); assertEquals("Spatial N-glycomics", FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL.getFullName()); assertEquals("Regional proteomics", FullDataTypeEnum.REGIONAL_PROTEOMICS_FULL.getFullName()); + assertEquals("Imaging Mass Cytometry", FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL.getFullName()); assertEquals("", FullDataTypeEnum.UNKNOWN_FULL.getFullName()); } @@ -29,6 +30,7 @@ public void testFromLong() { assertEquals(FullDataTypeEnum.SPATIAL_LIPIDOMICS_FULL, FullDataTypeEnum.fromLong("Spatial Lipidomics")); assertEquals(FullDataTypeEnum.SPATIAL_METABOLOMICS_FULL, FullDataTypeEnum.fromLong("Spatial Metabolomics")); assertEquals(FullDataTypeEnum.SPATIAL_NGLYCOMICS_FULL, FullDataTypeEnum.fromLong("Spatial N-glycomics")); + assertEquals(FullDataTypeEnum.IMAGING_MASS_CYTOMETRY_FULL, FullDataTypeEnum.fromLong("Imaging Mass Cytometry")); assertEquals(FullDataTypeEnum.UNKNOWN_FULL, FullDataTypeEnum.fromLong("xxx")); assertEquals(FullDataTypeEnum.UNKNOWN_FULL, FullDataTypeEnum.fromLong("")); assertEquals(FullDataTypeEnum.UNKNOWN_FULL, FullDataTypeEnum.fromLong(null));