Skip to content

Commit

Permalink
Merge pull request #150 from KPMP/KPMP-5618_add_enrollment_category
Browse files Browse the repository at this point in the history
KPMP-5618: change tissue type to enrollment category
  • Loading branch information
zwright authored Oct 24, 2024
2 parents 40854ad + fa406a5 commit 4a712b3
Show file tree
Hide file tree
Showing 66 changed files with 626 additions and 626 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package org.kpmp;

public enum TissueTypeEnum {
public enum EnrollmentCategoryEnum {

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

private String requestType;
private String participantTissueType;
private String participantEnrollmentCategory;

private TissueTypeEnum(String requestType, String participantTissueType) {
private EnrollmentCategoryEnum(String requestType, String participantEnrollmentCategory) {
this.requestType = requestType;
this.participantTissueType = participantTissueType;
this.participantEnrollmentCategory = participantEnrollmentCategory;
}

public String getParticipantTissueType() {
return this.participantTissueType;
public String getParticipantEnrollmentCategory() {
return this.participantEnrollmentCategory;
}

public String getRequestType() {
return this.requestType;
}


public static TissueTypeEnum fromRequestType(String requestType) {
public static EnrollmentCategoryEnum fromRequestType(String requestType) {
if (ALL.requestType.equalsIgnoreCase(requestType)) {
return ALL;
} else if (AKI.requestType.equalsIgnoreCase(requestType)) {
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/kpmp/QueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.kpmp.participant.ParticipantRepoDataTypeSummary;
import org.kpmp.participant.ParticipantService;
import org.kpmp.participant.ParticipantSummaryDataset;
import org.kpmp.participant.ParticipantTissueTypeSummary;
import org.kpmp.participant.ParticipantEnrollmentCategorySummary;
import org.kpmp.umap.PlotData;
import org.kpmp.umap.UmapDataService;
import org.slf4j.Logger;
Expand Down Expand Up @@ -82,13 +82,13 @@ public CellTypeHierarchy cellTypeHierarchy() throws IOException {

@QueryMapping
public List<? extends GeneExpressionSummary> geneExpressionSummary(@Argument String dataType, @Argument String geneSymbol,
@Argument String cellType, @Argument String tissueType) throws IOException {
@Argument String cellType, @Argument String enrollmentCategory) throws IOException {
List<? extends GeneExpressionSummary> results = new ArrayList<>();
if (cellType.isEmpty()) {
results = geneExpressionSummaryService.getByDataTypeTissueTypeAndGene(dataType, geneSymbol, tissueType);
results = geneExpressionSummaryService.getByDataTypeEnrollmentCategoryAndGene(dataType, geneSymbol, enrollmentCategory);
} else if (geneSymbol.isEmpty()) {
results = geneExpressionSummaryService.getExpressionSummaryPerGeneByCellTypeAndTissueType(dataType,
cellType, tissueType);
results = geneExpressionSummaryService.getExpressionSummaryPerGeneByCellTypeAndEnrollmentCategory(dataType,
cellType, enrollmentCategory);
}
return results;
}
Expand All @@ -99,9 +99,9 @@ public List<ClusterHierarchy> getClusterHieararchies(@Argument String cellType)
}

@QueryMapping
public PlotData getUmapPlotData(@Argument String dataType, @Argument String geneSymbol, @Argument String tissueType) throws Exception {
public PlotData getUmapPlotData(@Argument String dataType, @Argument String geneSymbol, @Argument String enrollmentCategory) throws Exception {
try {
return umapService.getPlotData(dataType, geneSymbol, tissueType);
return umapService.getPlotData(dataType, geneSymbol, enrollmentCategory);
} catch (Exception e) {
logger.error(e.getMessage());
throw e;
Expand Down Expand Up @@ -140,18 +140,18 @@ public List<String> dataTypesForConcept(@Argument String geneSymbol, @Argument S
}

@QueryMapping
public RTExpressionByTissueType getRTGeneExpressionByTissue(@Argument String comparisonType, @Argument String geneSymbol)
public RTExpressionByEnrollmentCategory getRTGeneExpressionByTissue(@Argument String comparisonType, @Argument String geneSymbol)
throws Exception {
try {
return rtExpressionDataService.getByComparisonTypeAndGeneSymbolPerTissue(comparisonType, geneSymbol);
return rtExpressionDataService.getByComparisonTypeAndGeneSymbolPerEnrollment(comparisonType, geneSymbol);
} catch (Exception e) {
logger.error(e.getMessage());
throw e;
}
}

@QueryMapping
public RPExpressionByTissueType getRPGeneExpressionByTissueAndProtein(@Argument String geneSymbol, @Argument String protein) throws Exception {
public RPExpressionByEnrollmentCategory getRPGeneExpressionByTissueAndProtein(@Argument String geneSymbol, @Argument String protein) throws Exception {
try {
return rpExpressionDataService.getByGeneSymbolAndProteinPerTissue(geneSymbol, protein);
} catch (Exception e) {
Expand Down Expand Up @@ -225,9 +225,9 @@ public ParticipantRepoDataTypeInformation getTotalParticipantFilesCount(@Argumen
}

@QueryMapping
public List<ParticipantTissueTypeSummary> getTissueTypeSummaryData() throws Exception {
public List<ParticipantEnrollmentCategorySummary> getEnrollmentCategorySummaryData() throws Exception {
try {
return participantService.getTissueData();
return participantService.getEnrollmentData();
} catch (Exception e) {
logger.error(e.getMessage());
throw e;
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/kpmp/dataSummary/DataSummaryRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public interface DataSummaryRepository extends CrudRepository<DataSummaryValue,
@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 " + "and p.tissue_type = :tissue_type "
+ "where sv.config_type = :data_type " + "and p.enrollment_category = :enrollment_category "
+ "and sv.release_sunset_version is null", nativeQuery = true)
Long getDataSummaryCount(@Param("tissue_type") String tissue_type, @Param("data_type") String data_type);
Long getDataSummaryCount(@Param("enrollment_category") String enrollment_category, @Param("data_type") String data_type);

@Cacheable("dataSummaryTotal")
@Query(value = "select count(distinct(redcap_id)) from participant p "
Expand All @@ -26,25 +26,25 @@ public interface DataSummaryRepository extends CrudRepository<DataSummaryValue,
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);
@Query(value = "select count(distinct(dl_file_id)) from repo_file_v where experimental_strategy = :exp_strat and enrollment_category = :enrollment_category", nativeQuery = true)
Long getRepoDataSummaryCount(@Param("enrollment_category") String enrollment_category, @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);
@Query(value = "select count(distinct(dl_file_id)) from repo_file_v where data_category = 'Biomarker' and enrollment_category = :enrollment_category", nativeQuery = true)
Long getRepoBiomarkerSummaryCount(@Param("enrollment_category") String enrollment_category);

@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);
+ "and enrollment_category = :enrollment_category", nativeQuery = true)
Long getDataSummaryLinkCount(@Param("enrollment_category") String enrollment_category, @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)
Expand Down
Loading

0 comments on commit 4a712b3

Please sign in to comment.