GSoC icon indicating copy to clipboard operation
GSoC copied to clipboard

Frequency & Counts Tables for Generic Assay Data

Open dippindots opened this issue 10 months ago • 6 comments

Background

cBioPortal uses the Generic Assay Format to store diverse data types that do not fit into standard molecular categories (e.g., microbiome data, mutational signatures, or arm-level copy number alterations). While these data types are accessible, they currently lack high-level cohort summaries in the Summary tab of Study View. Researchers need a way to see "at-a-glance" statistics—specifically counts and frequencies—for these events across an entire study or a filtered subset of samples. mutational-signature-binary-example

Goal

The objective of this project is to implement responsive, interactive Frequency/Counts Tables for studies containing Generic Assay Binary or Categorical data.

  • For Categorical Data: Show a summary of event types (e.g., 1p gain vs. 1p loss) across the cohort.
  • For Binary Data: Show a summary of "true/yes" events per entity.
  • Interactive Filtering: The table must serve as both a visualization and a tool; clicking a row should filter the global cohort, and changes to the global cohort should trigger a re-calculation of the table's frequencies.

Approach

This project requires a full-stack implementation to ensure high performance with large datasets and seamless interactivity.

1. Backend (Java / Spring Boot)

  • API Development: Create a new REST API endpoint (e.g., /api/generic-assays/fetch) to handle statistical aggregation.
  • Dynamic Calculation: Implement logic to calculate sample counts and percentage frequencies for each entity and category.
  • Server-Side Filtering: To ensure accuracy, the backend must accept a list of sampleIds or filter criteria to return real-time re-calculated frequencies based on the user's active cohort selection.

2. Frontend (React / TypeScript)

  • New Component: Build a GenericAssayFrequencyTable component within the cBioPortal frontend repo.
    • Categorical Layout: Entity (e.g., 1p) | Category (e.g., gain) | # samples | % samples
    • Binary Layout: Entity | # samples | % samples w/ positive value
  • State Management (MobX): Integrate the component with the StudyViewStore so it automatically re-fetches data when global filters change.
  • Visual Integration: Add the tables to the "Summary" tab of the Study View and ensure they are discoverable via the "Add Charts" menu.

Need skills

  • Java (Spring Boot): Required for developing and optimizing the backend aggregation service.
  • TypeScript & React: Required for building the table UI and managing frontend state.
  • Data Structures: Experience transforming API responses into aggregated frequency maps.

Possible mentors

  • @dippindots (Gaofei Zhao)

dippindots avatar Jan 21 '26 22:01 dippindots

Hi, I am interested in working on this GSoC 2026 project. I have experience with Java (Spring Boot), React, and TypeScript, and I am comfortable with data structures and APIs. Could you please assign this issue to me or let me know the next steps to get started?

PrashamJain1318 avatar Jan 30 '26 19:01 PrashamJain1318

Hi, I’ve read the description and I’m interested in working on this GSoC 2026 project. My understanding is that the goal is to implement full‑stack Frequency/Counts Tables for Generic Assay binary and categorical data in the Study View Summary tab, including a Java/Spring Boot API for aggregating counts and frequencies based on the active cohort, and a React/TypeScript component integrated with the StudyViewStore for interactive filtering. I have experience with Java (Spring Boot), React, TypeScript, and data structures, and I would like to contribute to this feature. Could you please confirm if my understanding of the issue is correct and let me know the suggested next steps to get started?

PrashamJain1318 avatar Jan 30 '26 19:01 PrashamJain1318

Hi @dippindots I’m Kartik Haritwal, a B.Tech student in Computer Science at IIIT-Delhi, and I’m very interested in working on the “Frequency & Counts Tables for Generic Assay Data” project for GSoC 2026. From my understanding, the goal is to implement a full-stack feature that:

  • Introduces a new backend aggregation endpoint (Java/Spring Boot) to compute dynamic counts and frequency percentages for Binary and Categorical Generic Assay data.
  • Supports server-side recalculation based on active cohort filters (sampleIds).
  • Builds a React/TypeScript component integrated with StudyViewStore (MobX) to ensure real-time updates when global filters change.
  • Embeds the new component cleanly into the Study View Summary tab. I have experience with Java, backend API design, SQL, and full-stack development. I’ve also worked in fast-paced hackathon environments and backend-focused roles where performance and data aggregation efficiency were critical. I had a few technical questions:
  1. Are Generic Assay datasets already indexed in a way that supports efficient grouping by entity/category, or would query optimization be part of this project?
  2. For large cohorts, are there expected performance benchmarks for the aggregation endpoint?
  3. Should frequency computation always be fully dynamic, or is there room for caching/pre-aggregation strategies? I would love to start exploring the relevant backend modules and frontend Study View components. Please let me know if there are any recommended starter tasks or areas I should begin with. Looking forward to contributing!

Kartikharitwal avatar Feb 11 '26 09:02 Kartikharitwal

Hi @dippindots,

I’ve been exploring the cBioPortal architecture and the way Generic Assay data is currently represented, and this project looks like an interesting extension of the Study View analytics layer.

From reading the documentation and related issues, my understanding is that the goal is to introduce a cohort-level aggregation view for Generic Assay Binary and Categorical data that behaves similarly to other Study View charts, but with entity/category frequency summaries.

Conceptually the pipeline seems to be:

StudyViewStore (MobX) → request aggregated frequencies from backend → backend groups Generic Assay rows by entity/category → return sample counts and percentages based on the active cohort

For the backend, I was thinking the aggregation endpoint could accept something like:

studyId + assayId + sampleIds

and compute:

  • Binary: COUNT(sampleId WHERE value = true) GROUP BY entity
  • Categorical: GROUP BY entity, category

so the computation remains database-side and scales well for larger cohorts.

One thing I’m curious about while exploring the repository:

Since cBioPortal now supports ClickHouse for large-scale cohort analytics, would the Generic Assay aggregation be expected to run entirely via SQL grouping queries, or are there cases where aggregation is performed in the service layer?

For the frontend, I’m planning to look at existing Study View charts to understand how they interact with StudyViewStore, so the new GenericAssayFrequencyTable can automatically recompute frequencies whenever the global cohort filter changes.

If there are specific parts of the codebase you’d recommend reviewing first (for example aggregation APIs used by existing Study View components), I’d love to start there.

Thanks!

arnvptl avatar Mar 15 '26 13:03 arnvptl

Hello @dippindots,

Thank you for opening this issue. The problem statement is very interesting and I’m considering working on it as part of my GSoC proposal.

While going through the description, I understood the overall goal of creating frequency/count tables for Generic Assay Binary and Categorical data in the Study View summary. However, I had a few questions and was hoping you could provide some additional clarification:

  1. Are there any existing implementations or components in cBioPortal (for other molecular data types) that implement similar cohort-level frequency summaries which could be used as a reference for this feature?
  2. Could you share any example datasets or studies in cBioPortal that currently contain Generic Assay Binary or Categorical data so I can better understand the expected input structure?
  3. Regarding the frontend integration, are there specific Study View components or charts whose architecture should be followed when building the GenericAssayFrequencyTable component?
  4. If possible, could you also point to any documentation or previous PRs related to Generic Assay handling in the portal?

These references would really help in understanding the expected architecture and preparing a stronger proposal.

Thank you for your time and guidance!

vikasp07 avatar Mar 16 '26 08:03 vikasp07

Hi @dippindots , I'm Varshini Gunti ([GitHub](https://github.com/VarshiniGunti) | [LinkedIn](https://www.linkedin.com/in/gunti-varshini-349580230/)), an Undergradutae CSE student at IIT Bhilai and interested in applying for GSoC 2026. I've been contributing to cBioPortal over the past few months and wanted to share my planned approach for this project and ask a few questions.

Relevant background: I've been working on PR #5439 in cbioportal-frontend, which fixes Generic Assay profile handling in PlotsTab.tsx for mixed-datatype studies. That work required understanding how genericAssayType and datatype interact for Binary vs Categorical profiles which maps directly to the core distinction this feature needs to handle. I've also merged PR #11972 in the backend (cbioportal) touching the service layer with unit tests, and have an open PR #71 in datahub-study-curation-tools adding timeline validation with comprehensive test coverage.

My proposed approach:

Backend: New endpoint POST /api/generic-assays/frequency/fetch accepting molecularProfileId, sampleIds[], and genericAssayType. Separate aggregation paths for Binary (count of positive values per entity) and Categorical (count per entity–category pair) using GROUP BY SQL to avoid loading all records into memory. Building on the existing GenericAssayDataRepository pattern.

Frontend: GenericAssayFrequencyTable component with MobX @computed on StudyViewStore.selectedSamples to trigger re-fetch on cohort filter changes. Row click calls StudyViewStore.updateFilter(). Registration in the Add Charts menu conditioned on datatype being BINARY or CATEGORICAL.

A few questions before I finalize my proposal:

  1. For the backend: should I extend the existing GenericAssayController or create a dedicated controller?
  2. For the frontend: is ClinicalDataCountSummaryTable the right reference component to follow, or is there a more recent Study View chart tile I should model?
  3. Are there studies on the public cBioPortal instance with Binary or Categorical Generic Assay data I can use for manual testing alongside the mutational signatures study?

Happy to share my full draft proposal here or on Slack for early feedback. Thank you for the detailed issue description!

VarshiniGunti avatar Mar 22 '26 11:03 VarshiniGunti