Skip to content

Commit

Permalink
Genomic data bin counts endpoint and Generic Assay data bin counts en…
Browse files Browse the repository at this point in the history
…dpoint
  • Loading branch information
dippindots committed Aug 22, 2024
1 parent 21f8990 commit 54b27ab
Show file tree
Hide file tree
Showing 13 changed files with 1,016 additions and 268 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.cbioportal.model.ClinicalEventTypeCount;
import org.cbioportal.model.CopyNumberCountByGene;
import org.cbioportal.model.GenomicDataCount;
import org.cbioportal.model.MolecularProfile;
import org.cbioportal.model.Sample;
import org.cbioportal.web.parameter.ClinicalDataType;
import org.cbioportal.web.parameter.StudyViewFilter;
Expand All @@ -33,7 +34,7 @@ public interface StudyViewRepository {
List<GenomicDataCount> getGenomicDataCounts(StudyViewFilter studyViewFilter);

List<ClinicalAttribute> getClinicalAttributes();

Map<String, ClinicalDataType> getClinicalAttributeDatatypeMap();

List<CaseListDataCount> getCaseListDataCounts(StudyViewFilter studyViewFilter);
Expand All @@ -47,4 +48,10 @@ public interface StudyViewRepository {
int getTotalProfiledCountsByAlterationType(StudyViewFilter studyViewFilter, String alterationType);

List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter studyViewFilter);

List<ClinicalDataCount> getGenomicDataBinCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes);

List<ClinicalDataCount> getGenericAssayDataBinCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes);

List<MolecularProfile> getGenericAssayProfiles();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.cbioportal.model.CopyNumberCountByGene;
import org.cbioportal.model.GenePanelToGene;
import org.cbioportal.model.GenomicDataCount;
import org.cbioportal.model.MolecularProfile;
import org.cbioportal.model.Sample;
import org.cbioportal.persistence.helper.AlterationFilterHelper;
import org.cbioportal.web.parameter.CategorizedClinicalDataCountFilter;
Expand Down Expand Up @@ -41,7 +42,7 @@ List<ClinicalDataCount> getClinicalDataCounts(StudyViewFilter studyViewFilter, C
List<ClinicalAttribute> getClinicalAttributes();

List<ClinicalData> getSampleClinicalDataFromStudyViewFilter(StudyViewFilter studyViewFilter, CategorizedClinicalDataCountFilter categorizedClinicalDataCountFilter, boolean applyPatientIdFilters, List<String> attributeIds);

List<ClinicalData> getPatientClinicalDataFromStudyViewFilter(StudyViewFilter studyViewFilter, CategorizedClinicalDataCountFilter categorizedClinicalDataCountFilter, boolean applyPatientIdFilters, List<String> attributeIds);

@MapKey("hugoGeneSymbol")
Expand All @@ -54,4 +55,11 @@ List<ClinicalDataCount> getClinicalDataCounts(StudyViewFilter studyViewFilter, C
int getTotalProfiledCountByAlterationType(StudyViewFilter studyViewFilter, CategorizedClinicalDataCountFilter categorizedClinicalDataCountFilter, boolean applyPatientIdFilters, String alterationType);

List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter studyViewFilter, CategorizedClinicalDataCountFilter categorizedClinicalDataCountFilter, boolean applyPatientIdFilters);

List<ClinicalDataCount> getGenomicDataBinCounts(StudyViewFilter studyViewFilter, CategorizedClinicalDataCountFilter categorizedClinicalDataCountFilter,
boolean applyPatientIdFilters, List<String> attributeIds, List<String> filteredAttributeValues);
List<ClinicalDataCount> getGenericAssayDataBinCounts(StudyViewFilter studyViewFilter, CategorizedClinicalDataCountFilter categorizedClinicalDataCountFilter,
boolean applyPatientIdFilters, List<String> attributeIds, List<String> filteredAttributeValues);

List<MolecularProfile> getGenericAssayProfiles();
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ public interface StudyViewColumnarService {
List<GenomicDataCount> getGenomicDataCounts(StudyViewFilter studyViewFilter);

List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter studyViewFilter);

List<ClinicalDataCountItem> getGenomicDataBinCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes);

List<ClinicalDataCountItem> getGenericAssayDataBinCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes);

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ public List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter s
return studyViewRepository.getClinicalEventTypeCounts(studyViewFilter);
}

@Override
public List<ClinicalDataCountItem> getGenomicDataBinCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes) {
return studyViewRepository.getGenomicDataBinCounts(studyViewFilter, filteredAttributes)
.stream().collect(Collectors.groupingBy(ClinicalDataCount::getAttributeId))
.entrySet().parallelStream().map(e -> {
ClinicalDataCountItem item = new ClinicalDataCountItem();
item.setAttributeId(e.getKey());
item.setCounts(e.getValue());
return item;
}).collect(Collectors.toList());
}

@Override
public List<ClinicalDataCountItem> getGenericAssayDataBinCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes) {
return studyViewRepository.getGenericAssayDataBinCounts(studyViewFilter, filteredAttributes)
.stream().collect(Collectors.groupingBy(ClinicalDataCount::getAttributeId))
.entrySet().parallelStream().map(e -> {
ClinicalDataCountItem item = new ClinicalDataCountItem();
item.setAttributeId(e.getKey());
item.setCounts(e.getValue());
return item;
}).collect(Collectors.toList());
}

public List<CopyNumberCountByGene> getCnaGenes(StudyViewFilter studyViewFilter) {
return alterationCountService.getCnaGenes(studyViewFilter);
}
Expand Down
Loading

0 comments on commit 54b27ab

Please sign in to comment.