diff --git a/src/main/java/org/kpmp/QueryController.java b/src/main/java/org/kpmp/QueryController.java index 1e31bdf..a556504 100755 --- a/src/main/java/org/kpmp/QueryController.java +++ b/src/main/java/org/kpmp/QueryController.java @@ -141,7 +141,7 @@ public List dataTypesForConcept(@Argument String geneSymbol, @Argument S } @QueryMapping - public RTExpressionByEnrollmentCategory getRTGeneExpressionByTissue(@Argument String comparisonType, @Argument String geneSymbol) + public RTExpressionByEnrollmentCategory getRTGeneExpressionByEnrollment(@Argument String comparisonType, @Argument String geneSymbol) throws Exception { try { return rtExpressionDataService.getByComparisonTypeAndGeneSymbolPerEnrollment(comparisonType, geneSymbol); @@ -152,9 +152,9 @@ public RTExpressionByEnrollmentCategory getRTGeneExpressionByTissue(@Argument St } @QueryMapping - public RPExpressionByEnrollmentCategory getRPGeneExpressionByTissueAndProtein(@Argument String geneSymbol, @Argument String protein) throws Exception { + public RPExpressionByEnrollmentCategory getRPGeneExpressionByEnrollmentAndProtein(@Argument String geneSymbol, @Argument String protein) throws Exception { try { - return rpExpressionDataService.getByGeneSymbolAndProteinPerTissue(geneSymbol, protein); + return rpExpressionDataService.getByGeneSymbolAndProteinPerEnrollment(geneSymbol, protein); } catch (Exception e) { logger.error(e.getMessage()); throw e; @@ -182,10 +182,10 @@ public List getRPGeneExpressionByStructure(@Argument String st } @QueryMapping - public List getRPGeneExpressionByTissue(@Argument String geneSymbol) + public List getRPGeneExpressionByEnrollment(@Argument String geneSymbol) throws Exception { try { - return rpExpressionDataService.getByGeneSymbolPerTissue(geneSymbol); + return rpExpressionDataService.getByGeneSymbolPerEnrollment(geneSymbol); } catch (Exception e) { logger.error(e.getMessage()); throw e; diff --git a/src/main/java/org/kpmp/geneExpression/RPExpressionDataService.java b/src/main/java/org/kpmp/geneExpression/RPExpressionDataService.java index 6d23df9..48552ba 100755 --- a/src/main/java/org/kpmp/geneExpression/RPExpressionDataService.java +++ b/src/main/java/org/kpmp/geneExpression/RPExpressionDataService.java @@ -17,18 +17,18 @@ public RPExpressionDataService(RPExpressionDataRepository rpExpressionDataReposi this.rpExpressionDataRepository = rpExpressionDataRepository; } - public List getByGeneSymbolPerTissue(String geneSymbol) { + public List getByGeneSymbolPerEnrollment(String geneSymbol) { List accessionNums = rpExpressionDataRepository.findAccessionByGeneSymbol(geneSymbol); List groups = new ArrayList<>(); for (String accession: accessionNums) { - RPExpressionByEnrollmentCategory rpExpressionByEnrollmentCategory = getByGeneSymbolAndProteinPerTissue(geneSymbol, accession); + RPExpressionByEnrollmentCategory rpExpressionByEnrollmentCategory = getByGeneSymbolAndProteinPerEnrollment(geneSymbol, accession); RPAccessionGroup group = new RPAccessionGroup(accession, rpExpressionByEnrollmentCategory); groups.add(group); } return groups; } - public RPExpressionByEnrollmentCategory getByGeneSymbolAndProteinPerTissue(String geneSymbol, String protein) { + public RPExpressionByEnrollmentCategory getByGeneSymbolAndProteinPerEnrollment(String geneSymbol, String protein) { RPExpressionByEnrollmentCategory rpExpressionByEnrollmentCategory = new RPExpressionByEnrollmentCategory(); rpExpressionByEnrollmentCategory.setAll(rpExpressionDataRepository.findByGeneSymbolAndEnrollmentCategoryAndProteinWithCounts(geneSymbol, EnrollmentCategoryEnum.ALL.getParticipantEnrollmentCategory(), protein)); diff --git a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java index e674e2c..97ff032 100755 --- a/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java +++ b/src/main/java/org/kpmp/participant/ParticipantSummaryDataset.java @@ -28,8 +28,6 @@ public class ParticipantSummaryDataset implements Serializable { private String sampleType; @Column(name = "enrollment_category") private String enrollmentCategory; - @Column(name = "clinical_data") - private String clinicalData; public int getParticipantId() { return participantId; @@ -103,12 +101,4 @@ public void setEnrollmentCategory(String enrollmentCategory) { this.enrollmentCategory = enrollmentCategory; } - public String getClinicalData() { - return clinicalData; - } - - public void setClinicalData(String clinicalData) { - this.clinicalData = clinicalData; - } - } diff --git a/src/main/resources/graphql/knowledge_environment.graphqls b/src/main/resources/graphql/knowledge_environment.graphqls index 105dcf2..f56b661 100755 --- a/src/main/resources/graphql/knowledge_environment.graphqls +++ b/src/main/resources/graphql/knowledge_environment.graphqls @@ -220,7 +220,6 @@ type ParticipantSummaryDataset { participantId: String redcapId: String enrollmentCategory: String - clinicalData: String } type ParticipantClinicalDataset { diff --git a/src/test/java/org/kpmp/QueryControllerTest.java b/src/test/java/org/kpmp/QueryControllerTest.java index 9e22965..120dba8 100755 --- a/src/test/java/org/kpmp/QueryControllerTest.java +++ b/src/test/java/org/kpmp/QueryControllerTest.java @@ -240,7 +240,7 @@ public void testGetRTGeneExpression() throws Exception { rtExpressionByEnrollmentCategory.setAki(data); when(rtExpressionDataService.getByComparisonTypeAndGeneSymbolPerEnrollment("all_segments", "gene")) .thenReturn(rtExpressionByEnrollmentCategory); - assertEquals(rtExpressionByEnrollmentCategory, query.getRTGeneExpressionByTissue("all_segments", "gene")); + assertEquals(rtExpressionByEnrollmentCategory, query.getRTGeneExpressionByEnrollment("all_segments", "gene")); assertEquals(rtExpressionByEnrollmentCategory.getAki(), data); } @@ -253,11 +253,11 @@ public void testGetRTGeneExpressionByStructure() throws Exception { } @Test - public void testGetRPGeneExpressionByTissueAndProtein() throws Exception { + public void testGetRPGeneExpressionByEnrollmentAndProtein() throws Exception { RPExpressionByEnrollmentCategory expected = new RPExpressionByEnrollmentCategory(); - when(rpExpressionDataService.getByGeneSymbolAndProteinPerTissue("APOL1", "steak")).thenReturn(expected); + when(rpExpressionDataService.getByGeneSymbolAndProteinPerEnrollment("APOL1", "steak")).thenReturn(expected); - RPExpressionByEnrollmentCategory result = query.getRPGeneExpressionByTissueAndProtein("APOL1", "steak"); + RPExpressionByEnrollmentCategory result = query.getRPGeneExpressionByEnrollmentAndProtein("APOL1", "steak"); assertEquals(expected, result); } diff --git a/src/test/java/org/kpmp/geneExpression/RPExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/RPExpressionDataServiceTest.java index bd3c513..6c0ba71 100755 --- a/src/test/java/org/kpmp/geneExpression/RPExpressionDataServiceTest.java +++ b/src/test/java/org/kpmp/geneExpression/RPExpressionDataServiceTest.java @@ -35,7 +35,7 @@ public void tearDown() throws Exception { } @Test - public void testGetByGeneSymbolPerTissue() throws Exception { + public void testGetByGeneSymbolPerEnrollment() throws Exception { List accessions = new ArrayList<>(); accessions.add("a1"); @@ -52,7 +52,7 @@ public void testGetByGeneSymbolPerTissue() throws Exception { when(rpExpressionDataRepository.findByGeneSymbolAndEnrollmentCategoryAndProteinWithCounts("gene", EnrollmentCategoryEnum.ALL.getParticipantEnrollmentCategory(), "a2")). thenReturn(rpExpressionDataAll2); - List rpAccessionGroups = rpExpressionDataService.getByGeneSymbolPerTissue("gene"); + List rpAccessionGroups = rpExpressionDataService.getByGeneSymbolPerEnrollment("gene"); assertEquals("a1", rpAccessionGroups.get(0).getAccession()); assertEquals("a2", rpAccessionGroups.get(1).getAccession()); @@ -66,13 +66,13 @@ public void testGetByGeneSymbolPerTissue() throws Exception { } @Test - public void testGetByGeneSymbolAndProteinPerTissue() throws Exception { + public void testgetByGeneSymbolAndProteinPerEnrollment() throws Exception { List rpExpressionDataAll = Arrays.asList(new RPExpressionData[]{new RPExpressionData()}); when(rpExpressionDataRepository.findByGeneSymbolAndEnrollmentCategoryAndProteinWithCounts("gene", EnrollmentCategoryEnum.ALL.getParticipantEnrollmentCategory(), "protein")). thenReturn(rpExpressionDataAll); - RPExpressionByEnrollmentCategory rpExpressionByEnrollmentCategory = rpExpressionDataService.getByGeneSymbolAndProteinPerTissue("gene", "protein"); + RPExpressionByEnrollmentCategory rpExpressionByEnrollmentCategory = rpExpressionDataService.getByGeneSymbolAndProteinPerEnrollment("gene", "protein"); assertEquals(rpExpressionByEnrollmentCategory.getAll(), rpExpressionDataAll); } diff --git a/src/test/java/org/kpmp/geneExpression/RTExpressionDataServiceTest.java b/src/test/java/org/kpmp/geneExpression/RTExpressionDataServiceTest.java index c554238..1adf8cb 100755 --- a/src/test/java/org/kpmp/geneExpression/RTExpressionDataServiceTest.java +++ b/src/test/java/org/kpmp/geneExpression/RTExpressionDataServiceTest.java @@ -35,7 +35,7 @@ public void tearDown() throws Exception { } @Test - public void testGetByComparisonTypeAndGeneSymbolPerTissue_all() throws Exception { + public void testGetByComparisonTypeAndGeneSymbolPerEnrollment_all() throws Exception { RTExpressionDataAllSegments allallData = new RTExpressionDataAllSegments(); List allallDataList = Arrays.asList(allallData); @@ -58,7 +58,7 @@ public void testGetByComparisonTypeAndGeneSymbolPerTissue_all() throws Exception } @Test - public void testGetByComparisonTypeAndGeneSymbolPerTissue_hrt() throws Exception { + public void testGetByComparisonTypeAndGeneSymbolPerEnrollment_hrt() throws Exception { RTExpressionDataAllSegments allhrtData = new RTExpressionDataAllSegments(); List allhrtDataList = Arrays.asList(allhrtData); @@ -81,7 +81,7 @@ public void testGetByComparisonTypeAndGeneSymbolPerTissue_hrt() throws Exception } @Test - public void testGetByComparisonTypeAndGeneSymbolPerTissue_ckd() throws Exception { + public void testGetByComparisonTypeAndGeneSymbolPerEnrollment_ckd() throws Exception { RTExpressionDataAllSegments allckdData = new RTExpressionDataAllSegments(); List allckdDataList = Arrays.asList(allckdData); RTExpressionDataGTI gckdData = new RTExpressionDataGTI(); @@ -103,7 +103,7 @@ public void testGetByComparisonTypeAndGeneSymbolPerTissue_ckd() throws Exception } @Test - public void testGetByComparisonTypeAndGeneSymbolPerTissue_aki() throws Exception { + public void testGetByComparisonTypeAndGeneSymbolPerEnrollment_aki() throws Exception { RTExpressionDataAllSegments allAkiData = new RTExpressionDataAllSegments(); List allAkiDataList = Arrays.asList(allAkiData); RTExpressionDataGTI gAkiData = new RTExpressionDataGTI(); @@ -125,7 +125,7 @@ public void testGetByComparisonTypeAndGeneSymbolPerTissue_aki() throws Exception } @Test - public void testGetByComparisonTypeAndGeneSymbolPerTissue_dmr() throws Exception { + public void testGetByComparisonTypeAndGeneSymbolPerEnrollment_dmr() throws Exception { RTExpressionDataAllSegments allDmrData = new RTExpressionDataAllSegments(); List allDmrDataList = Arrays.asList(allDmrData); RTExpressionDataGTI gDmrData = new RTExpressionDataGTI(); diff --git a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java index c92f7ca..d0138a8 100755 --- a/src/test/java/org/kpmp/participant/ParticipantServiceTest.java +++ b/src/test/java/org/kpmp/participant/ParticipantServiceTest.java @@ -118,7 +118,6 @@ public void testGetParticipantSummaryDataset() throws Exception { expectedResult.setProtocol("7"); expectedResult.setSampleType("8"); expectedResult.setEnrollmentCategory("9"); - expectedResult.setClinicalData("10"); when(participantSummaryDatasetRepository.findByRedcapId("1")).thenReturn(expectedResult); @@ -135,7 +134,6 @@ public void testGetParticipantSummaryDataset() throws Exception { assertEquals("7", result.getProtocol()); assertEquals("8", result.getSampleType()); assertEquals("9", result.getEnrollmentCategory()); - assertEquals("10", result.getClinicalData()); } @Test diff --git a/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java b/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java index 589013a..1c1c619 100755 --- a/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java +++ b/src/test/java/org/kpmp/participant/ParticipantSummaryDatasetTest.java @@ -76,10 +76,4 @@ void setEnrollmentCategory() { assertEquals("tissue", participantSummaryDataset.getEnrollmentCategory()); } - @Test - void setClinicalData() { - participantSummaryDataset.setClinicalData("clinical"); - assertEquals("clinical", participantSummaryDataset.getClinicalData()); - } - } \ No newline at end of file