Skip to content

Commit

Permalink
Merge pull request #133 from KPMP/develop
Browse files Browse the repository at this point in the history
Release v2.3.1
  • Loading branch information
rlreamy authored May 21, 2024
2 parents 77c5438 + 8197b0d commit aa63786
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .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
IMAGE_TAG: 2.3.1
runs-on: ubuntu-latest
steps:
- name: Get branch names
Expand Down Expand Up @@ -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 }}"
docker push "kingstonduo/pegasus-data:${{ steps.branch-names.outputs.current_branch }}"
22 changes: 11 additions & 11 deletions 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'
version= '2.3.1'
}

repositories {
Expand Down Expand Up @@ -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)
Expand All @@ -74,16 +74,16 @@ def getTagInfo() {
}
} catch (e) {
}
if (gitBranch == "develop" || gitBranch == "master"){
return "${jar.version}"
if (gitBranch == "develop" || gitBranch == "master"){
return jar.version
}else{
return gitBranch
}
}
}

docker {
name "${project.group}/${jar.baseName}:" + getTagInfo()
name "kingstonduo/${jar.baseName}:" + getCurrentGitBranch()
copySpec.from(tasks.unpack.outputs).into("dependency")
buildArgs(['DEPENDENCY': "dependency"])
}
}
5 changes: 4 additions & 1 deletion src/main/java/org/kpmp/DataTypeEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum DataTypeEnum {
SPATIAL_LIPIDOMICS("sl"),
SPATIAL_METABOLOMICS("sm"),
SPATIAL_NGLYCOMICS("sng"),
IMAGING_MASS_CYTOMETRY("imc"),
UNKNOWN("");

private String abbreviation;
Expand Down Expand Up @@ -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;
}
}
5 changes: 4 additions & 1 deletion src/main/java/org/kpmp/FullDataTypeEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
15 changes: 15 additions & 0 deletions src/main/java/org/kpmp/dataSummary/DataSummaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,21 @@ public List<DataTypeSummary> 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;
}
}
5 changes: 4 additions & 1 deletion src/test/java/org/kpmp/DataTypeEnumTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
}

Expand All @@ -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));
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/kpmp/FullDataTypeEnumTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
}

Expand All @@ -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));
Expand Down

0 comments on commit aa63786

Please sign in to comment.