Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not call next study view filter when no samples left #10124

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ private List<SampleIdentifier> equalityFilterClinicalData(List<SampleIdentifier>
private List<SampleIdentifier> filterMutatedGenes(List<GeneFilter> mutatedGenefilters,
Map<String, MolecularProfile> molecularProfileMap, List<SampleIdentifier> sampleIdentifiers) {

if (sampleIdentifiers == null || sampleIdentifiers.isEmpty()) {
return new ArrayList<>();
}

for (GeneFilter genefilter : mutatedGenefilters) {

List<MolecularProfile> filteredMolecularProfiles = genefilter
Expand Down Expand Up @@ -364,6 +368,10 @@ private List<SampleIdentifier> filterMutatedGenes(List<GeneFilter> mutatedGenefi

private List<SampleIdentifier> filterStructuralVariantGenes(List<GeneFilter> svGenefilters,
Map<String, MolecularProfile> molecularProfileMap, List<SampleIdentifier> sampleIdentifiers) {

if (sampleIdentifiers == null || sampleIdentifiers.isEmpty()) {
return new ArrayList<>();
}

for (GeneFilter genefilter : svGenefilters) {

Expand Down Expand Up @@ -433,6 +441,10 @@ private List<SampleIdentifier> filterStructuralVariantGenes(List<GeneFilter> svG

private List<SampleIdentifier> filterCNAGenes(List<GeneFilter> cnaGeneFilters,
Map<String, MolecularProfile> molecularProfileMap, List<SampleIdentifier> sampleIdentifiers) {

if (sampleIdentifiers == null || sampleIdentifiers.isEmpty()) {
return new ArrayList<>();
}

for (GeneFilter geneFilter : cnaGeneFilters) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.cbioportal.web.parameter.filter.AndedPatientTreatmentFilters;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -25,6 +26,11 @@ public List<SampleIdentifier> filter(
List<SampleIdentifier> identifiers,
StudyViewFilter filter
) {

if (identifiers == null || identifiers.isEmpty()) {
return new ArrayList<>();
}

AndedPatientTreatmentFilters filters = getFilters(filter);

List<String> sampleIds = identifiers.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.cbioportal.web.parameter.filter.AndedSampleTreatmentFilters;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -25,6 +26,11 @@ public List<SampleIdentifier> filter (
List<SampleIdentifier> identifiers,
StudyViewFilter filter
) {

if (identifiers == null || identifiers.isEmpty()) {
return new ArrayList<>();
}

AndedSampleTreatmentFilters filters = getFilters(filter);

List<String> sampleIds = identifiers.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
Expand All @@ -25,7 +26,11 @@ public final class ClinicalEventFilterApplier implements StudyViewSubFilterAppli

@Override
public List<SampleIdentifier> filter(@NonNull List<SampleIdentifier> toFilter, @NonNull StudyViewFilter filters) {


if (toFilter == null || toFilter.isEmpty()) {
return new ArrayList<>();
}

List<String> studyIds = toFilter.stream()
.map(SampleIdentifier::getStudyId)
.collect(Collectors.toList());
Expand Down