From 626f27cfe650b09b048a235cc347c57e22413890 Mon Sep 17 00:00:00 2001 From: "Zhaoyuan (Ryan) Fu" Date: Fri, 27 Sep 2024 14:45:15 -0400 Subject: [PATCH] Filtering with NA for generic-assay-data-bin-counts --- .../StudyViewFilterMapper.xml | 143 +++++++++++------- .../mybatisclickhouse/StudyViewMapper.xml | 4 +- 2 files changed, 95 insertions(+), 52 deletions(-) diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml index 6fd03f409d9..b398acf3422 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml @@ -152,7 +152,7 @@ - + @@ -469,59 +469,100 @@ + + SELECT sample_unique_id, value + FROM generic_assay_data_derived + WHERE profile_type = #{genericAssayDataFilter.profileType} + AND entity_stable_id = #{genericAssayDataFilter.stableId} + + AND datatype = 'LIMIT-VALUE' + + - - SELECT ${unique_id} - FROM ${table_name} - WHERE entity_stable_id = '${genericAssayDataFilter.stableId}' AND - profile_type='${genericAssayDataFilter.profileType}' - - - - AND - - - - - - AND match(value, '^>?=?[-+]?[0-9]*[.,]?[0-9]+$') - - - AND match(value, '^<?=?[-+]?[0-9]*[.,]?[0-9]+$') - - - AND match(value, '^[-+]?[0-9]*[.,]?[0-9]+$') - - - - - AND abs( - minus( - - - , - ${dataFilterValue.start} - ) - ) < exp(-11) - - - - AND - - - > ${dataFilterValue.start} - - - AND + + + + + + + + + + + + + + + + + SELECT DISTINCT sd.sample_unique_id + FROM sample_derived sd + LEFT JOIN () AS generic_numerical_query ON sd.sample_unique_id = generic_numerical_query.sample_unique_id + WHERE value IS null OR + + + = 'NA' + + + + UNION ALL + + + + SELECT DISTINCT sample_unique_id + FROM () AS generic_numerical_query + WHERE + + + != 'NA' + + + + AND + + + + + + AND match(value, '^>?=?[-+]?[0-9]*[.,]?[0-9]+$') + + + AND match(value, '^<?=?[-+]?[0-9]*[.,]?[0-9]+$') + + + AND match(value, '^[-+]?[0-9]*[.,]?[0-9]+$') + + + + + AND abs( + minus( - <= ${dataFilterValue.end} - - - - - - + , + ${dataFilterValue.start} + ) + ) < exp(-11) + + + + AND + + + > ${dataFilterValue.start} + + + AND + + + <= ${dataFilterValue.end} + + + + + + + diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml index 73ec0453371..ac0d54407e8 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml @@ -623,15 +623,17 @@