Skip to content

Commit

Permalink
change singleStudyUnfiltered to just unfiltered
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Lai committed Oct 24, 2024
1 parent 98a8255 commit 569e010
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ClinicalDataDensityPlotServiceImpl implements ClinicalDataDensityPl

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public DensityPlotData getDensityPlotData(List<ClinicalData> sampleClinicalData, DensityPlotParameters densityPlotParameters, StudyViewFilter studyViewFilter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public StudyViewColumnarServiceImpl(StudyViewRepository studyViewRepository, Alt

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<Sample> getFilteredSamples(StudyViewFilter studyViewFilter) {
Expand All @@ -64,7 +64,7 @@ public List<Sample> getFilteredSamples(StudyViewFilter studyViewFilter) {

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<AlterationCountByGene> getMutatedGenes(StudyViewFilter studyViewFilter) throws StudyNotFoundException {
Expand All @@ -73,7 +73,7 @@ public List<AlterationCountByGene> getMutatedGenes(StudyViewFilter studyViewFilt

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCount> getMolecularProfileSampleCounts(StudyViewFilter studyViewFilter) {
Expand All @@ -82,7 +82,7 @@ public List<GenomicDataCount> getMolecularProfileSampleCounts(StudyViewFilter st

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter studyViewFilter) {
Expand All @@ -91,7 +91,7 @@ public List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter s

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public PatientTreatmentReport getPatientTreatmentReport(StudyViewFilter studyViewFilter) {
Expand All @@ -100,7 +100,7 @@ public PatientTreatmentReport getPatientTreatmentReport(StudyViewFilter studyVie

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public SampleTreatmentReport getSampleTreatmentReport(StudyViewFilter studyViewFilter) {
Expand All @@ -109,7 +109,7 @@ public SampleTreatmentReport getSampleTreatmentReport(StudyViewFilter studyViewF

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalDataCountItem> getGenomicDataBinCounts(StudyViewFilter studyViewFilter, List<GenomicDataBinFilter> genomicDataBinFilters) {
Expand All @@ -118,7 +118,7 @@ public List<ClinicalDataCountItem> getGenomicDataBinCounts(StudyViewFilter study

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalDataCountItem> getGenericAssayDataBinCounts(StudyViewFilter studyViewFilter, List<GenericAssayDataBinFilter> genericAssayDataBinFilters) {
Expand All @@ -131,7 +131,7 @@ public List<CopyNumberCountByGene> getCnaGenes(StudyViewFilter studyViewFilter)

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<AlterationCountByGene> getStructuralVariantGenes(StudyViewFilter studyViewFilter) throws StudyNotFoundException {
Expand All @@ -140,7 +140,7 @@ public List<AlterationCountByGene> getStructuralVariantGenes(StudyViewFilter stu

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public Map<String, ClinicalDataType> getClinicalAttributeDatatypeMap() {
Expand All @@ -149,7 +149,7 @@ public Map<String, ClinicalDataType> getClinicalAttributeDatatypeMap() {

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalDataCountItem> getClinicalDataCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes) {
Expand All @@ -168,7 +168,7 @@ public List<ClinicalDataCountItem> getClinicalDataCounts(StudyViewFilter studyVi

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<CaseListDataCount> getCaseListDataCounts(StudyViewFilter studyViewFilter) {
Expand All @@ -180,7 +180,7 @@ public List<CaseListDataCount> getCaseListDataCounts(StudyViewFilter studyViewFi

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalData> getPatientClinicalData(StudyViewFilter studyViewFilter, List<String> attributeIds) {
Expand All @@ -189,7 +189,7 @@ public List<ClinicalData> getPatientClinicalData(StudyViewFilter studyViewFilter

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalData> getSampleClinicalData(StudyViewFilter studyViewFilter, List<String> attributeIds) {
Expand All @@ -198,7 +198,7 @@ public List<ClinicalData> getSampleClinicalData(StudyViewFilter studyViewFilter,

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCountItem> getCNACountsByGeneSpecific(StudyViewFilter studyViewFilter, List<GenomicDataFilter> genomicDataFilters) {
Expand All @@ -207,7 +207,7 @@ public List<GenomicDataCountItem> getCNACountsByGeneSpecific(StudyViewFilter stu

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<GenericAssayDataCountItem> getGenericAssayDataCounts(StudyViewFilter studyViewFilter, List<GenericAssayDataFilter> genericAssayDataFilters) {
Expand All @@ -216,7 +216,7 @@ public List<GenericAssayDataCountItem> getGenericAssayDataCounts(StudyViewFilter

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCountItem> getMutationCountsByGeneSpecific(StudyViewFilter studyViewFilter, List<GenomicDataFilter> genomicDataFilters) {
Expand All @@ -237,7 +237,7 @@ public List<GenomicDataCountItem> getMutationCountsByGeneSpecific(StudyViewFilte

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCountItem> getMutationTypeCountsByGeneSpecific(StudyViewFilter studyViewFilter, List<GenomicDataFilter> genomicDataFilters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ViolinPlotServiceImpl implements ViolinPlotService {

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isUnfiltered(#studyViewFilter)"
)
public ClinicalViolinPlotData getClinicalViolinPlotData(
List<ClinicalData> sampleClinicalDataForViolinPlot,
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/cbioportal/web/util/StudyViewFilterUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,16 @@ public List<ClinicalDataCountItem> getClinicalDataCountsFromCustomData(Collectio
}

public boolean isSingleStudyUnfiltered(StudyViewFilter filter) {
return isSingleStudy(filter) && isUnfiltered(filter);
}

public boolean isSingleStudy(StudyViewFilter filter) {
return filter.getStudyIds() != null &&
filter.getStudyIds().size() == 1;
}

public boolean isUnfiltered(StudyViewFilter filter) {
return filter.getStudyIds() != null &&
filter.getStudyIds().size() == 1 &&
(filter.getClinicalDataFilters() == null || filter.getClinicalDataFilters().isEmpty()) &&
(filter.getGeneFilters() == null || filter.getGeneFilters().isEmpty()) &&
(filter.getSampleTreatmentFilters() == null || filter.getSampleTreatmentFilters().getFilters().isEmpty()) &&
Expand Down

0 comments on commit 569e010

Please sign in to comment.