From f0598fd4fe918882bac39ab193aa78110d911c6d Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Fri, 11 Oct 2024 10:48:06 -0400 Subject: [PATCH 1/7] :recycle: Refactor NewStudyViewFilterUtil --- .../columnar/StudyViewColumnStoreController.java | 4 ++-- .../columnar/util/NewClinicalDataBinUtil.java | 4 ++-- .../columnar/util/NewStudyViewFilterUtil.java | 16 ++++++---------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java b/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java index e5ebbfecda0..2caa76c563b 100644 --- a/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java +++ b/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java @@ -207,7 +207,7 @@ public ResponseEntity> fetchClinicalDataCounts( StudyViewFilter studyViewFilter = interceptedClinicalDataCountFilter.getStudyViewFilter(); if (attributes.size() == 1) { - NewStudyViewFilterUtil.removeSelfFromFilter(attributes.get(0).getAttributeId(), studyViewFilter); + NewStudyViewFilterUtil.removeClinicalDataFilter(attributes.getFirst().getAttributeId(), studyViewFilter.getClinicalDataFilters()); } // boolean singleStudyUnfiltered = studyViewFilterUtil.isSingleStudyUnfiltered(studyViewFilter); List result = studyViewColumnarService.getClinicalDataCounts(studyViewFilter, @@ -558,7 +558,7 @@ public ResponseEntity> fetchCustomDataCounts( List attributes = interceptedClinicalDataCountFilter.getAttributes(); StudyViewFilter studyViewFilter = interceptedClinicalDataCountFilter.getStudyViewFilter(); if (attributes.size() == 1) { - NewStudyViewFilterUtil.removeSelfCustomDataFromFilter(attributes.get(0).getAttributeId(), studyViewFilter); + NewStudyViewFilterUtil.removeClinicalDataFilter(attributes.getFirst().getAttributeId(), studyViewFilter.getCustomDataFilters()); } List filteredSampleIdentifiers = studyViewColumnarService.getFilteredSamples(studyViewFilter).stream().map(sample -> studyViewFilterUtil.buildSampleIdentifier(sample.getCancerStudyIdentifier(), sample.getStableId())).toList(); diff --git a/src/main/java/org/cbioportal/web/columnar/util/NewClinicalDataBinUtil.java b/src/main/java/org/cbioportal/web/columnar/util/NewClinicalDataBinUtil.java index b89066fc758..df1b9524c6e 100644 --- a/src/main/java/org/cbioportal/web/columnar/util/NewClinicalDataBinUtil.java +++ b/src/main/java/org/cbioportal/web/columnar/util/NewClinicalDataBinUtil.java @@ -25,7 +25,7 @@ public static StudyViewFilter removeSelfFromFilter(ClinicalDataBinCountFilter da StudyViewFilter studyViewFilter = dataBinCountFilter.getStudyViewFilter(); if (attributes.size() == 1) { - NewStudyViewFilterUtil.removeSelfFromFilter(attributes.get(0).getAttributeId(), studyViewFilter); + NewStudyViewFilterUtil.removeClinicalDataFilter(attributes.getFirst().getAttributeId(), studyViewFilter.getClinicalDataFilters()); } return studyViewFilter; @@ -36,7 +36,7 @@ public static StudyViewFilter removeSelfCustomDataFromFilter(ClinicalDataBinCoun StudyViewFilter studyViewFilter = dataBinCountFilter.getStudyViewFilter(); if (attributes.size() == 1) { - NewStudyViewFilterUtil.removeSelfCustomDataFromFilter(attributes.get(0).getAttributeId(), studyViewFilter); + NewStudyViewFilterUtil.removeClinicalDataFilter(attributes.getFirst().getAttributeId(), studyViewFilter.getCustomDataFilters()); } return studyViewFilter; diff --git a/src/main/java/org/cbioportal/web/columnar/util/NewStudyViewFilterUtil.java b/src/main/java/org/cbioportal/web/columnar/util/NewStudyViewFilterUtil.java index 305a7ce5bae..5363802afe2 100644 --- a/src/main/java/org/cbioportal/web/columnar/util/NewStudyViewFilterUtil.java +++ b/src/main/java/org/cbioportal/web/columnar/util/NewStudyViewFilterUtil.java @@ -1,19 +1,15 @@ package org.cbioportal.web.columnar.util; -import org.cbioportal.web.parameter.StudyViewFilter; +import org.cbioportal.web.parameter.ClinicalDataFilter; -public class NewStudyViewFilterUtil { +import java.util.List; - public static void removeSelfFromFilter(String attributeId, StudyViewFilter studyViewFilter) { - if (studyViewFilter!= null && studyViewFilter.getClinicalDataFilters() != null) { - studyViewFilter.getClinicalDataFilters().removeIf(f -> f.getAttributeId().equals(attributeId)); - } - } +public class NewStudyViewFilterUtil { - public static void removeSelfCustomDataFromFilter(String attributeId, StudyViewFilter studyViewFilter) { - if (studyViewFilter != null && studyViewFilter.getCustomDataFilters() != null) { - studyViewFilter.getCustomDataFilters().removeIf(f -> f.getAttributeId().equals(attributeId)); + public static void removeClinicalDataFilter(String attributeId, List dataFilterList ) { + if (dataFilterList != null) { + dataFilterList.removeIf(f -> f.getAttributeId().equals(attributeId)); } } } From 1621428b62715e11e8e83bbd54fa3621fc4fab7c Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Mon, 14 Oct 2024 11:42:05 -0400 Subject: [PATCH 2/7] Update SQL to return ClinicalDataCountItem.. NA's not implemented --- .../persistence/StudyViewRepository.java | 3 +- .../mybatisclickhouse/StudyViewMapper.java | 3 +- .../StudyViewMyBatisRepository.java | 3 +- .../impl/StudyViewColumnarServiceImpl.java | 20 ++--- .../StudyViewColumnStoreController.java | 2 - .../mybatisclickhouse/StudyViewMapper.xml | 54 +++++++++++- .../StudyViewMapperClinicalDataCountTest.java | 88 +++++++++---------- 7 files changed, 110 insertions(+), 63 deletions(-) diff --git a/src/main/java/org/cbioportal/persistence/StudyViewRepository.java b/src/main/java/org/cbioportal/persistence/StudyViewRepository.java index 6dab21a2081..c232490534e 100644 --- a/src/main/java/org/cbioportal/persistence/StudyViewRepository.java +++ b/src/main/java/org/cbioportal/persistence/StudyViewRepository.java @@ -5,6 +5,7 @@ import org.cbioportal.model.CaseListDataCount; import org.cbioportal.model.ClinicalData; import org.cbioportal.model.ClinicalDataCount; +import org.cbioportal.model.ClinicalDataCountItem; import org.cbioportal.model.ClinicalEventTypeCount; import org.cbioportal.model.CopyNumberCountByGene; import org.cbioportal.model.GenericAssayDataCountItem; @@ -37,7 +38,7 @@ public interface StudyViewRepository { List getStructuralVariantGenes(StudyViewFilterContext studyViewFilterContext); List getCnaGenes(StudyViewFilterContext studyViewFilterContext); - List getClinicalDataCounts(StudyViewFilterContext studyViewFilterContext, List filteredAttributes); + List getClinicalDataCounts(StudyViewFilterContext studyViewFilterContext, List filteredAttributes); List getMolecularProfileSampleCounts(StudyViewFilterContext studyViewFilterContext); diff --git a/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.java b/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.java index 00333c43a3c..bbb03419ef6 100644 --- a/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.java +++ b/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.java @@ -6,6 +6,7 @@ import org.cbioportal.model.ClinicalAttribute; import org.cbioportal.model.ClinicalData; import org.cbioportal.model.ClinicalDataCount; +import org.cbioportal.model.ClinicalDataCountItem; import org.cbioportal.model.ClinicalEventTypeCount; import org.cbioportal.model.CopyNumberCountByGene; import org.cbioportal.model.GenePanelToGene; @@ -38,7 +39,7 @@ public interface StudyViewMapper { List getStructuralVariantGenes(StudyViewFilterHelper studyViewFilterHelper, AlterationFilterHelper alterationFilterHelper); - List getClinicalDataCounts(StudyViewFilterHelper studyViewFilterHelper, List attributeIds, List filteredAttributeValues); + List getClinicalDataCounts(StudyViewFilterHelper studyViewFilterHelper, List attributeIds, List filteredAttributeValues); List getCaseListDataCountsPerStudy(@Param("studyViewFilterHelper") StudyViewFilterHelper studyViewFilterHelper); diff --git a/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMyBatisRepository.java b/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMyBatisRepository.java index 5419d12d1a9..df1abcb1c5a 100644 --- a/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMyBatisRepository.java +++ b/src/main/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMyBatisRepository.java @@ -4,6 +4,7 @@ import org.cbioportal.model.CaseListDataCount; import org.cbioportal.model.ClinicalData; import org.cbioportal.model.ClinicalDataCount; +import org.cbioportal.model.ClinicalDataCountItem; import org.cbioportal.model.ClinicalEventTypeCount; import org.cbioportal.model.GenePanelToGene; import org.cbioportal.model.GenericAssayDataCountItem; @@ -74,7 +75,7 @@ public List getStructuralVariantGenes(StudyViewFilterCont } @Override - public List getClinicalDataCounts(StudyViewFilterContext studyViewFilterContext, List filteredAttributes) { + public List getClinicalDataCounts(StudyViewFilterContext studyViewFilterContext, List filteredAttributes) { return mapper.getClinicalDataCounts(createStudyViewFilterHelper(studyViewFilterContext), filteredAttributes, FILTERED_CLINICAL_ATTR_VALUES); } diff --git a/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java b/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java index 7d64076e3a2..d0eed47401a 100644 --- a/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java +++ b/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java @@ -111,16 +111,16 @@ public Map getClinicalAttributeDatatypeMap() { @Override public List getClinicalDataCounts(StudyViewFilter studyViewFilter, List filteredAttributes) { StudyViewFilterContext studyViewFilterContext = createContext(studyViewFilter); - List dataCounts = studyViewRepository.getClinicalDataCounts(studyViewFilterContext, filteredAttributes); - List clinicalDataCountItems = generateDataCountItemsFromDataCounts(dataCounts); - - return calculateMissingNaCountsForClinicalDataCountItems( - clinicalDataCountItems, - filteredAttributes.stream().distinct().toList(), - this.getClinicalAttributeDatatypeMap(), - studyViewRepository.getFilteredSamplesCount(studyViewFilterContext), - studyViewRepository.getFilteredPatientCount(studyViewFilterContext) - ); + //List dataCounts = studyViewRepository.getClinicalDataCounts(studyViewFilterContext, filteredAttributes); + //List clinicalDataCountItems = generateDataCountItemsFromDataCounts(dataCounts); + return studyViewRepository.getClinicalDataCounts(studyViewFilterContext, filteredAttributes); +// return calculateMissingNaCountsForClinicalDataCountItems( +// clinicalDataCountItems, +// filteredAttributes, +// this.getClinicalAttributeDatatypeMap(), +// studyViewRepository.getFilteredSamplesCount(studyViewFilterContext), +// studyViewRepository.getFilteredPatientCount(studyViewFilterContext) +// ); } @Override diff --git a/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java b/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java index 2caa76c563b..5289da55045 100644 --- a/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java +++ b/src/main/java/org/cbioportal/web/columnar/StudyViewColumnStoreController.java @@ -209,10 +209,8 @@ public ResponseEntity> fetchClinicalDataCounts( if (attributes.size() == 1) { NewStudyViewFilterUtil.removeClinicalDataFilter(attributes.getFirst().getAttributeId(), studyViewFilter.getClinicalDataFilters()); } - // boolean singleStudyUnfiltered = studyViewFilterUtil.isSingleStudyUnfiltered(studyViewFilter); List result = studyViewColumnarService.getClinicalDataCounts(studyViewFilter, attributes.stream().map(ClinicalDataFilter::getAttributeId).collect(Collectors.toList())); - //studyIds, sampleIds, attributes.stream().map(a -> a.getAttributeId()).collect(Collectors.toList())); return new ResponseEntity<>(result, HttpStatus.OK); } diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml index e7b082753db..78784aef6b0 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml @@ -122,10 +122,14 @@ - + + + UNION ALL - + + + @@ -165,7 +169,40 @@ GROUP BY s.cancer_study_identifier, sl.stable_id, sl.name; - + + SELECT + attribute_name AS attributeId, + attribute_value AS value, + cast(count(*) AS INTEGER) as count + FROM clinical_data_derived + + type='${type}' + AND + + + + != 'NA' + AND + + + + + + + + + + + + + AND attribute_name IN + + #{attributeId} + + + GROUP BY attribute_name, attribute_value + + SELECT attribute_name as attributeId, @@ -395,6 +432,15 @@ + + + + + + + + + SELECT patient_unique_id diff --git a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java index 26a5466ace7..93e4a97ce00 100644 --- a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java +++ b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java @@ -47,13 +47,13 @@ public void getMutationCounts() { ); assertEquals(6, mutationsCounts.size()); - assertEquals(1, findClinicaDataCount(mutationsCounts, "11")); - assertEquals(1, findClinicaDataCount(mutationsCounts, "6")); - assertEquals(2, findClinicaDataCount(mutationsCounts, "4")); - assertEquals(4, findClinicaDataCount(mutationsCounts, "2")); - assertEquals(2, findClinicaDataCount(mutationsCounts, "1")); - // 1 empty string + 1 'NAN' + 11 samples with no data - assertEquals(13, findClinicaDataCount(mutationsCounts, "NA")); +// assertEquals(1, findClinicaDataCount(mutationsCounts, "11")); +// assertEquals(1, findClinicaDataCount(mutationsCounts, "6")); +// assertEquals(2, findClinicaDataCount(mutationsCounts, "4")); +// assertEquals(4, findClinicaDataCount(mutationsCounts, "2")); +// assertEquals(2, findClinicaDataCount(mutationsCounts, "1")); +// // 1 empty string + 1 'NAN' + 11 samples with no data +// assertEquals(13, findClinicaDataCount(mutationsCounts, "NA")); } @Test @@ -68,14 +68,14 @@ public void getCenterCounts() { ); assertEquals(7, categoricalClinicalDataCounts.size()); - assertEquals(3, findClinicaDataCount(categoricalClinicalDataCounts, "msk")); - assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "dfci")); - assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "chop")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "mda")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ohsu")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ucsf")); - // 1 empty string + 1 'NA' + 11 samples with no data - assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); +// assertEquals(3, findClinicaDataCount(categoricalClinicalDataCounts, "msk")); +// assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "dfci")); +// assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "chop")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "mda")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ohsu")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ucsf")); +// // 1 empty string + 1 'NA' + 11 samples with no data +// assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); } @Test @@ -90,17 +90,17 @@ public void getDeadCounts() { ); assertEquals(10, categoricalClinicalDataCounts.size()); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "True")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "TRUE")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "true")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "False")); - assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "FALSE")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "false")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Not Released")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Not Collected")); - assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Unknown")); - // 1 empty string + 1 'N/A' + 11 samples with no data - assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "True")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "TRUE")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "true")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "False")); +// assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "FALSE")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "false")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Not Released")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Not Collected")); +// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Unknown")); +// // 1 empty string + 1 'N/A' + 11 samples with no data +// assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); } @Test @@ -128,10 +128,10 @@ public void getAgeCounts() { Collections.emptyList() ); - assertAgeCounts(ageCounts); +// assertAgeCounts(ageCounts); // 1 empty string + 1 'NAN' + 1 'N/A' + 1 patient without data - assertEquals(4, findClinicaDataCount(ageCounts, "NA")); +// assertEquals(4, findClinicaDataCount(ageCounts, "NA")); } @Test @@ -147,7 +147,7 @@ public void getAgeCountsForMultipleStudies() { // everything should be exactly the same as single study (STUDY_GENIE_PUB) filter // except NA counts - assertAgeCounts(ageCounts); +// assertAgeCounts(ageCounts); // TODO this fails because of a known issue // (https://github.com/cBioPortal/rfc80-team/issues/39) @@ -191,9 +191,9 @@ public void getMutationCountsFilteredByAge() { ); assertEquals(3, mutationCountsFiltered.size()); - assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "2")); - assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "1")); - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "NA")); +// assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "2")); +// assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "1")); +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "NA")); } @Test @@ -213,13 +213,13 @@ public void getMutationCountsFilteredByAgeWithOpenStartValues() { ); assertEquals(4, mutationCountsFiltered.size()); - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "11")); // patient 301 - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "6")); // patient 302 - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 303 - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 306 - - // no patients/samples with NA - assertEquals(0, findClinicaDataCount(mutationCountsFiltered, "NA")); +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "11")); // patient 301 +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "6")); // patient 302 +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 303 +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 306 +// +// // no patients/samples with NA +// assertEquals(0, findClinicaDataCount(mutationCountsFiltered, "NA")); } @Test @@ -239,11 +239,11 @@ public void getMutationCountsFilteredByAgeWithOpenEndValues() { ); assertEquals(3, mutationCountsFiltered.size()); - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 304 - assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 305 - - // patients/samples with NA data: 317, 318, and 319 - assertEquals(3, findClinicaDataCount(mutationCountsFiltered, "NA")); +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 304 +// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 305 +// +// // patients/samples with NA data: 317, 318, and 319 +// assertEquals(3, findClinicaDataCount(mutationCountsFiltered, "NA")); } private ClinicalDataFilter buildClinicalDataFilter(String attributeId, Integer start, Integer end) { From 3338a3df897257cb79755d68f25c6e382e5b1e3f Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Tue, 15 Oct 2024 11:07:36 -0400 Subject: [PATCH 3/7] Add NA counts to SQL for clinical data counts --- .../mybatisclickhouse/StudyViewMapper.xml | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml index 78784aef6b0..2adb8b5dcfb 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml @@ -170,9 +170,11 @@ + ( + WITH clinical_data_query AS ( SELECT attribute_name AS attributeId, - attribute_value AS value, + upper(attribute_value) AS value, cast(count(*) AS INTEGER) as count FROM clinical_data_derived @@ -200,7 +202,28 @@ #{attributeId} - GROUP BY attribute_name, attribute_value + GROUP BY attribute_name, value ), + clinical_data_sum AS (SELECT attributeId, sum(count) AS sum FROM clinical_data_query GROUP BY attributeId) + + SELECT * FROM clinical_data_query + UNION ALL + SELECT attributeId, + 'NA' AS value, + (( + + + + + + + + + ) - clinical_data_sum.sum) AS count + FROM clinical_data_sum + + count > 0 + + ) From 471b45aef812aa54d95b3447a92a8f58260cfa19 Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Wed, 16 Oct 2024 10:10:43 -0400 Subject: [PATCH 4/7] Remove unused methods --- .../impl/StudyViewColumnarServiceImpl.java | 89 +------------------ .../mybatisclickhouse/StudyViewMapper.xml | 56 ------------ 2 files changed, 1 insertion(+), 144 deletions(-) diff --git a/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java b/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java index d0eed47401a..998a5e5bd63 100644 --- a/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java +++ b/src/main/java/org/cbioportal/service/impl/StudyViewColumnarServiceImpl.java @@ -110,17 +110,7 @@ public Map getClinicalAttributeDatatypeMap() { @Override public List getClinicalDataCounts(StudyViewFilter studyViewFilter, List filteredAttributes) { - StudyViewFilterContext studyViewFilterContext = createContext(studyViewFilter); - //List dataCounts = studyViewRepository.getClinicalDataCounts(studyViewFilterContext, filteredAttributes); - //List clinicalDataCountItems = generateDataCountItemsFromDataCounts(dataCounts); - return studyViewRepository.getClinicalDataCounts(studyViewFilterContext, filteredAttributes); -// return calculateMissingNaCountsForClinicalDataCountItems( -// clinicalDataCountItems, -// filteredAttributes, -// this.getClinicalAttributeDatatypeMap(), -// studyViewRepository.getFilteredSamplesCount(studyViewFilterContext), -// studyViewRepository.getFilteredPatientCount(studyViewFilterContext) -// ); + return studyViewRepository.getClinicalDataCounts(createContext(studyViewFilter), filteredAttributes); } @Override @@ -239,83 +229,6 @@ private List normalizeDataCounts(List data return new ArrayList<>(normalizedDataCounts); } - public static List calculateMissingNaCountsForClinicalDataCountItems( - List clinicalDataCountItems, - List filteredAttributes, - Map clinicalAttributeDatatypeMap, - int filteredSamplesCount, - int filteredPatientsCount - ) { - // Postprocess clinical data count items to adjust NA counts - List combinedClinicalDataCountItems = new ArrayList<>(); - - Map clinicalDataCountItemMap = clinicalDataCountItems - .stream() - .collect(Collectors.toMap( - ClinicalDataCountItem::getAttributeId, - item -> item - )); - - // go over all filtered attributes, not just attributes found in clinicalDataCountItems - for (String attributeId: filteredAttributes) { - ClinicalDataCountItem clinicalDataCountItem = clinicalDataCountItemMap.get(attributeId); - boolean isItemMissing = false; - - if (clinicalDataCountItem == null) { - isItemMissing = true; - clinicalDataCountItem = new ClinicalDataCountItem(); - clinicalDataCountItem.setAttributeId(attributeId); - clinicalDataCountItem.setCounts(new ArrayList<>()); - } - - Integer totalClinicalDataCount = clinicalDataCountItem - .getCounts() - .stream() - .map(ClinicalDataCount::getCount) - .reduce(0, Integer::sum); - // depending on clinical data type we either use filtered sample count or filtered patient count - int filteredCount = clinicalAttributeDatatypeMap.get(clinicalDataCountItem.getAttributeId()) == ClinicalDataType.SAMPLE ? - filteredSamplesCount: filteredPatientsCount; - int casesWithoutClinicalData = filteredCount - totalClinicalDataCount; - - if (casesWithoutClinicalData > 0) { - // some of these attributes may be completely missing in clinicalDataCountItem - // in case the only attribute value is NA. - // we need to manually add those missing items to make sure we have NA counts. - if (isItemMissing) { - combinedClinicalDataCountItems.add(clinicalDataCountItem); - } - - // find "NA" or else create a new one - Optional naClinicalDataCountOptional = clinicalDataCountItem - .getCounts() - .stream() - .filter(c -> c.getValue().equals("NA")) - .findFirst(); - - ClinicalDataCount naClinicalDataCount = naClinicalDataCountOptional - .orElseGet(() -> { - // this should only happen when there are multiple studies - ClinicalDataCount count = new ClinicalDataCount(); - count.setAttributeId(attributeId); - count.setValue("NA"); - count.setCount(0); - return count; - }); - - // if not present we need to add naClinicalDataCount to the existing counts - if (naClinicalDataCountOptional.isEmpty()) { - clinicalDataCountItem.getCounts().add(naClinicalDataCount); - } - - naClinicalDataCount.setCount(naClinicalDataCount.getCount() + casesWithoutClinicalData); - } - } - - combinedClinicalDataCountItems.addAll(clinicalDataCountItems); - return combinedClinicalDataCountItems; - } - public static List mergeCaseListCounts(List counts) { Map> countsPerListType = counts.stream() .collect((Collectors.groupingBy(CaseListDataCount::getValue))); diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml index 2adb8b5dcfb..85c5c7a7cd8 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml @@ -226,62 +226,6 @@ ) - - SELECT - attribute_name as attributeId, - - - as value, - count(value) as count - FROM clinical_data_derived - - type='sample' AND - - - - - AND UPPER(value) NOT IN - - #{filteredAttributeValue} - - - AND attribute_name IN - - #{attributeId} - - - GROUP BY attribute_name, - value - - - - SELECT - attribute_name as attributeId, - - - as value, - count(value) as count - FROM clinical_data_derived - - type='patient' AND - - - - - AND UPPER(value) NOT IN - - #{filteredAttributeValue} - - - AND attribute_name IN - - #{attributeId} - - - GROUP BY attribute_name, - value - - SELECT count(distinct sample_unique_id) as count FROM sample_derived From 598e9fe5df9b30f6f7063b7c3e3939d76e98957a Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Wed, 16 Oct 2024 10:56:10 -0400 Subject: [PATCH 5/7] Fix unit tests for clinical data counts --- .../StudyViewMapperClinicalDataCountTest.java | 156 ++++++++++++------ 1 file changed, 101 insertions(+), 55 deletions(-) diff --git a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java index 93e4a97ce00..a634717cfc9 100644 --- a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java +++ b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java @@ -1,6 +1,7 @@ package org.cbioportal.persistence.mybatisclickhouse; import org.cbioportal.model.ClinicalDataCount; +import org.cbioportal.model.ClinicalDataCountItem; import org.cbioportal.persistence.helper.StudyViewFilterHelper; import org.cbioportal.persistence.mybatisclickhouse.config.MyBatisConfig; import org.cbioportal.web.parameter.ClinicalDataFilter; @@ -21,6 +22,7 @@ import java.util.List; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; @RunWith(SpringRunner.class) @Import(MyBatisConfig.class) @@ -40,20 +42,26 @@ public void getMutationCounts() { StudyViewFilter studyViewFilter = new StudyViewFilter(); studyViewFilter.setStudyIds(List.of(STUDY_GENIE_PUB)); - var mutationsCounts = studyViewMapper.getClinicalDataCounts( + var clinicalDataCountItems = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("mutation_count"), Collections.emptyList() ); + var mutationsCountsOptional = clinicalDataCountItems.stream() + .filter(c -> c.getAttributeId().equals("mutation_count")).findFirst(); + + assertTrue(mutationsCountsOptional.isPresent()); + var mutationsCounts = mutationsCountsOptional.get().getCounts(); + assertEquals(6, mutationsCounts.size()); -// assertEquals(1, findClinicaDataCount(mutationsCounts, "11")); -// assertEquals(1, findClinicaDataCount(mutationsCounts, "6")); -// assertEquals(2, findClinicaDataCount(mutationsCounts, "4")); -// assertEquals(4, findClinicaDataCount(mutationsCounts, "2")); -// assertEquals(2, findClinicaDataCount(mutationsCounts, "1")); -// // 1 empty string + 1 'NAN' + 11 samples with no data -// assertEquals(13, findClinicaDataCount(mutationsCounts, "NA")); + assertEquals(1, findClinicaDataCount(mutationsCounts, "11")); + assertEquals(1, findClinicaDataCount(mutationsCounts, "6")); + assertEquals(2, findClinicaDataCount(mutationsCounts, "4")); + assertEquals(4, findClinicaDataCount(mutationsCounts, "2")); + assertEquals(2, findClinicaDataCount(mutationsCounts, "1")); + // 1 empty string + 1 'NAN' + 11 samples with no data + assertEquals(13, findClinicaDataCount(mutationsCounts, "NA")); } @Test @@ -61,21 +69,27 @@ public void getCenterCounts() { StudyViewFilter studyViewFilter = new StudyViewFilter(); studyViewFilter.setStudyIds(List.of(STUDY_GENIE_PUB)); - var categoricalClinicalDataCounts = studyViewMapper.getClinicalDataCounts( + var clinicalDataCounts = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("center"), Collections.emptyList() ); + var categoricalClinicalDataCountsOptional = clinicalDataCounts.stream() + .filter(c -> c.getAttributeId().equals("center")).findFirst(); + + assertTrue(categoricalClinicalDataCountsOptional.isPresent()); + var categoricalClinicalDataCounts = categoricalClinicalDataCountsOptional.get().getCounts(); + assertEquals(7, categoricalClinicalDataCounts.size()); -// assertEquals(3, findClinicaDataCount(categoricalClinicalDataCounts, "msk")); -// assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "dfci")); -// assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "chop")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "mda")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ohsu")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ucsf")); -// // 1 empty string + 1 'NA' + 11 samples with no data -// assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); + assertEquals(3, findClinicaDataCount(categoricalClinicalDataCounts, "MSK")); + assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "DFCI")); + assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "CHOP")); + assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "MDA")); + assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "OHSU")); + assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "UCSF")); + // 1 empty string + 1 'NA' + 11 samples with no data + assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); } @Test @@ -83,24 +97,26 @@ public void getDeadCounts() { StudyViewFilter studyViewFilter = new StudyViewFilter(); studyViewFilter.setStudyIds(List.of(STUDY_GENIE_PUB)); - var categoricalClinicalDataCounts = studyViewMapper.getClinicalDataCounts( + var clinicalDataCounts = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("dead"), Collections.emptyList() ); - assertEquals(10, categoricalClinicalDataCounts.size()); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "True")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "TRUE")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "true")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "False")); -// assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "FALSE")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "false")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Not Released")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Not Collected")); -// assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "Unknown")); -// // 1 empty string + 1 'N/A' + 11 samples with no data -// assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); + var categoricalClinicalDataCountsOptional = clinicalDataCounts.stream() + .filter(c -> c.getAttributeId().equals("dead")).findFirst(); + + assertTrue(categoricalClinicalDataCountsOptional.isPresent()); + var categoricalClinicalDataCounts = categoricalClinicalDataCountsOptional.get().getCounts(); + + assertEquals(6, categoricalClinicalDataCounts.size()); + assertEquals(3, findClinicaDataCount(categoricalClinicalDataCounts, "TRUE")); + assertEquals(4, findClinicaDataCount(categoricalClinicalDataCounts, "FALSE")); + assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "NOT RELEASED")); + assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "NOT COLLECTED")); + assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "UNKNOWN")); + // 1 empty string + 1 'N/A' + 11 samples with no data + assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA")); } @Test @@ -114,7 +130,7 @@ public void getMutationAndCenterCounts() { Collections.emptyList() ); - assertEquals(13, combinedClinicalDataCounts.size()); + assertEquals(2, combinedClinicalDataCounts.size()); } @Test @@ -122,16 +138,22 @@ public void getAgeCounts() { StudyViewFilter studyViewFilter = new StudyViewFilter(); studyViewFilter.setStudyIds(List.of(STUDY_GENIE_PUB)); - var ageCounts = studyViewMapper.getClinicalDataCounts( + var clinicalDataCountItems = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("age"), Collections.emptyList() ); -// assertAgeCounts(ageCounts); + var ageCountsOptional = clinicalDataCountItems.stream() + .filter(c -> c.getAttributeId().equals("age")).findFirst(); + + assertTrue(ageCountsOptional.isPresent()); + var ageCounts = ageCountsOptional.get().getCounts(); + + assertAgeCounts(ageCounts); // 1 empty string + 1 'NAN' + 1 'N/A' + 1 patient without data -// assertEquals(4, findClinicaDataCount(ageCounts, "NA")); + assertEquals(4, findClinicaDataCount(ageCounts, "NA")); } @Test @@ -139,20 +161,26 @@ public void getAgeCountsForMultipleStudies() { StudyViewFilter studyViewFilter = new StudyViewFilter(); studyViewFilter.setStudyIds(List.of(STUDY_GENIE_PUB, STUDY_ACC_TCGA)); - var ageCounts = studyViewMapper.getClinicalDataCounts( + var clinicalDataCountItems = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("age"), Collections.emptyList() ); + var ageCountsOptional = clinicalDataCountItems.stream() + .filter(c -> c.getAttributeId().equals("age")).findFirst(); + + assertTrue(ageCountsOptional.isPresent()); + var ageCounts = ageCountsOptional.get().getCounts(); + // everything should be exactly the same as single study (STUDY_GENIE_PUB) filter // except NA counts -// assertAgeCounts(ageCounts); + assertAgeCounts(ageCounts); // TODO this fails because of a known issue // (https://github.com/cBioPortal/rfc80-team/issues/39) // 1 empty string + 1 'NAN' + 1 'N/A' + 1 GENIE_PUB patient without data + 4 ACC_TCGA data without data - // assertEquals(8, findClinicaDataCount(ageCounts, "NA")); + assertEquals(8, findClinicaDataCount(ageCounts, "NA")); } private void assertAgeCounts(List ageCounts) { @@ -184,16 +212,22 @@ public void getMutationCountsFilteredByAge() { ClinicalDataFilter filter = buildClinicalDataFilter("age", 20, 70); studyViewFilter.setClinicalDataFilters(List.of(filter)); - var mutationCountsFiltered = studyViewMapper.getClinicalDataCounts( + var clinicalDataCountItems = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("mutation_count"), Collections.emptyList() ); + var mutationsCountsOptional = clinicalDataCountItems.stream() + .filter(c -> c.getAttributeId().equals("mutation_count")).findFirst(); + + assertTrue(mutationsCountsOptional.isPresent()); + var mutationCountsFiltered = mutationsCountsOptional.get().getCounts(); + assertEquals(3, mutationCountsFiltered.size()); -// assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "2")); -// assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "1")); -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "NA")); + assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "2")); + assertEquals(2, findClinicaDataCount(mutationCountsFiltered, "1")); + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "NA")); } @Test @@ -206,20 +240,26 @@ public void getMutationCountsFilteredByAgeWithOpenStartValues() { ClinicalDataFilter filter = buildClinicalDataFilter("age", null, 20); studyViewFilter.setClinicalDataFilters(List.of(filter)); - var mutationCountsFiltered = studyViewMapper.getClinicalDataCounts( + var clinicalDataCountItems = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("mutation_count"), Collections.emptyList() ); + var mutationsCountsOptional = clinicalDataCountItems.stream() + .filter(c -> c.getAttributeId().equals("mutation_count")).findFirst(); + + assertTrue(mutationsCountsOptional.isPresent()); + var mutationCountsFiltered = mutationsCountsOptional.get().getCounts(); + assertEquals(4, mutationCountsFiltered.size()); -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "11")); // patient 301 -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "6")); // patient 302 -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 303 -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 306 -// -// // no patients/samples with NA -// assertEquals(0, findClinicaDataCount(mutationCountsFiltered, "NA")); + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "11")); // patient 301 + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "6")); // patient 302 + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 303 + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 306 + + // no patients/samples with NA + assertEquals(0, findClinicaDataCount(mutationCountsFiltered, "NA")); } @Test @@ -232,18 +272,24 @@ public void getMutationCountsFilteredByAgeWithOpenEndValues() { ClinicalDataFilter filter = buildClinicalDataFilter("age", 80, null); studyViewFilter.setClinicalDataFilters(List.of(filter)); - var mutationCountsFiltered = studyViewMapper.getClinicalDataCounts( + var clinicalDataCountItems = studyViewMapper.getClinicalDataCounts( StudyViewFilterHelper.build(studyViewFilter, null, null), List.of("mutation_count"), Collections.emptyList() ); + var mutationsCountsOptional = clinicalDataCountItems.stream() + .filter(c -> c.getAttributeId().equals("mutation_count")).findFirst(); + + assertTrue(mutationsCountsOptional.isPresent()); + var mutationCountsFiltered = mutationsCountsOptional.get().getCounts(); + assertEquals(3, mutationCountsFiltered.size()); -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 304 -// assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 305 -// -// // patients/samples with NA data: 317, 318, and 319 -// assertEquals(3, findClinicaDataCount(mutationCountsFiltered, "NA")); + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "4")); // patient 304 + assertEquals(1, findClinicaDataCount(mutationCountsFiltered, "2")); // patient 305 + + // patients/samples with NA data: 317, 318, and 319 + assertEquals(3, findClinicaDataCount(mutationCountsFiltered, "NA")); } private ClinicalDataFilter buildClinicalDataFilter(String attributeId, Integer start, Integer end) { From ca357e46f294e164455029c79fc4946d652285ea Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Wed, 16 Oct 2024 15:13:08 -0400 Subject: [PATCH 6/7] Remove unused import --- .../mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java index a634717cfc9..80e0b202c10 100644 --- a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java +++ b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java @@ -1,7 +1,6 @@ package org.cbioportal.persistence.mybatisclickhouse; import org.cbioportal.model.ClinicalDataCount; -import org.cbioportal.model.ClinicalDataCountItem; import org.cbioportal.persistence.helper.StudyViewFilterHelper; import org.cbioportal.persistence.mybatisclickhouse.config.MyBatisConfig; import org.cbioportal.web.parameter.ClinicalDataFilter; From 9c534e8e719ba4d7398fdc1df9db821f32418711 Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Wed, 16 Oct 2024 17:04:44 -0400 Subject: [PATCH 7/7] Fix Review Comments --- .../mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java index 80e0b202c10..0760a81407e 100644 --- a/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java +++ b/src/test/java/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapperClinicalDataCountTest.java @@ -176,8 +176,6 @@ public void getAgeCountsForMultipleStudies() { // except NA counts assertAgeCounts(ageCounts); - // TODO this fails because of a known issue - // (https://github.com/cBioPortal/rfc80-team/issues/39) // 1 empty string + 1 'NAN' + 1 'N/A' + 1 GENIE_PUB patient without data + 4 ACC_TCGA data without data assertEquals(8, findClinicaDataCount(ageCounts, "NA")); }