Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPMP-5248_add-imc-technology #131

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading